From 28d989e06fe9d5fd6f0d524fb642fd8b53c9daa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Thu, 12 Oct 2006 21:28:57 +0000 Subject: [PATCH] remove unneeded and move repo script into repo script dir --- scripts/check-source-repo.py | 32 ------------------ scripts/fetchAll.py | 63 ------------------------------------ 2 files changed, 95 deletions(-) delete mode 100755 scripts/check-source-repo.py delete mode 100755 scripts/fetchAll.py diff --git a/scripts/check-source-repo.py b/scripts/check-source-repo.py deleted file mode 100755 index 11fc6aef..00000000 --- a/scripts/check-source-repo.py +++ /dev/null @@ -1,32 +0,0 @@ -#! /usr/bin/python -# a simple tool to list stuff in source repository -# author: exa - -import sys -import os - -import pisi -import pisi.api -import pisi.config -import pisi.specfile as specfile -import pisi.context as ctx -import pisi.util - -options = pisi.config.Options() -if len(sys.argv) > 2: - options.destdir=sys.argv[2] -else: - options.destdir = '/' -pisi.api.init(database=False, options=options) -repo_uri = sys.argv[1] - -for root, dirs, files in os.walk(repo_uri): - for fn in files: - if fn == 'pspec.xml': - #ctx.ui.info(_('Adding %s to package index') % fn) - sf = specfile.SpecFile() - sf.read(pisi.util.join_path(root, fn)) - sf.check() - print '%s: %s' % (sf.source.name, sf.source.version) - -pisi.api.finalize() diff --git a/scripts/fetchAll.py b/scripts/fetchAll.py deleted file mode 100755 index e0ce3e09..00000000 --- a/scripts/fetchAll.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/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.api -import pisi.uri -import pisi.context as ctx -import pisi.specfile -import pisi.util as util -from pisi.fetcher import fetch_url - -def scanPSPEC(folder): - packages = [] - for root, dirs, files in os.walk(folder): - if "pspec.xml" in files: - packages.append(root) - # dont walk into the versioned stuff - if ".svn" in dirs: - dirs.remove(".svn") - return packages - -def isCached(file, sha1sum): - try: - return util.check_file_hash(os.path.join(ctx.config.archives_dir(), file), sha1sum) - except: - pass - -if __name__ == "__main__": - pisi.api.init(database=False, options='') - try: - packages = scanPSPEC(sys.argv[1]) - except: - print "Usage: fetchAll.py path2repo" - sys.exit(1) - - for package in packages: - spec = pisi.specfile.SpecFile() - spec.read(os.path.join(package, "pspec.xml")) - - URI = pisi.uri.URI(spec.source.archive.uri) - - if not isCached(URI.filename(), spec.source.archive.sha1sum): - print URI, " -> " , os.path.join(ctx.config.archives_dir(), URI.filename()) - try: - fetch_url(URI, ctx.config.archives_dir()) - except pisi.fetcher.FetchError, e: - print e - pass - else: - print URI, "already downloaded..." - pisi.api.finalize()