From 233c794672c45841e9b3af08b07ff6b7c0ea9cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Fri, 24 Jun 2005 14:52:10 +0000 Subject: [PATCH] iste bu da nur topu gibi yeni bir tool --- pisi-updateindex | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 pisi-updateindex diff --git a/pisi-updateindex b/pisi-updateindex new file mode 100755 index 00000000..cceabff2 --- /dev/null +++ b/pisi-updateindex @@ -0,0 +1,44 @@ +#! /usr/bin/python +# -*- coding: utf-8 -*- + +# sys modules +import sys +from optparse import OptionParser + +#sys.path.append("./lib") +from pisi.index import Index +import pisi.util +from pisi.ui import ui + +class ArgError(Exception): + pass + +def main(): + + usage = "usage: %prog [options] " + parser = OptionParser(usage=usage,version="%prog " + pisi.__version__) + parser.add_option("-D", "--destdir", action="store") + parser.add_option("-v", "--verbose", action="store_true", + dest="verbose", default=False, + help="detailed output") + parser.add_option("-d", "--debug", action="store_true", default=True) + parser.add_option("-n", "--dry-run", action="store_true", + default = "do not perform any action, just show what\ + would be done") + + (options, args) = parser.parse_args() + + if len(args) != 1: + print usage + raise ArgError, "pisi-build expects a PISI index file" + else: + index_file = args[0] + + ui.info('* Updating index from index file: ' + index_file + '\n') + + index = Index() + index.read(index_file) + index.update_db() + +if __name__ == "__main__": + main()