From 7f3288b72cda819187f8a94a815e21ff89ee73b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Mon, 19 Sep 2005 12:55:02 +0000 Subject: [PATCH] =?UTF-8?q?T=C3=BCm=20source'lar=C4=B1=20=C3=A7ek=20arac?= =?UTF-8?q?=C4=B1.=20Progress=20k=C3=BCsk=C3=BC=20modda=20oldu=C4=9Fu=20i?= =?UTF-8?q?=C3=A7in=20=C5=9Fimdilik=20kullan=C4=B1m=C4=B1yor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/fetchAll.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tools/fetchAll.py diff --git a/tools/fetchAll.py b/tools/fetchAll.py new file mode 100644 index 00000000..6e9749da --- /dev/null +++ b/tools/fetchAll.py @@ -0,0 +1,38 @@ +#!/usr/bin/python +# +# Copyright (C) 2005, TUBITAK/UEKAE +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# Please read the COPYING file. + +import os +import sys + +sys.path.append('.') + +import pisi.uri +import pisi.specfile +from pisi.config import config +from pisi.fetcher import fetch_url + +def scan_pspec(folder): + paks = [] + for root, dirs, files in os.walk(folder): + if "pspec.xml" in files: + paks.append(root) + # dont walk into the versioned stuff + if ".svn" in dirs: + dirs.remove(".svn") + return paks + +if __name__ == "__main__": + paks = scan_pspec(sys.argv[1]) + for pak in paks: + spec = pisi.specfile.SpecFile() + spec.read(os.path.join(pak, "pspec.xml")) + fetch_url(pisi.uri.URI(spec.source.archiveUri), config.archives_dir()) + print pisi.uri.URI(spec.source.archiveUri -> config.archives_dir()