From 88a840788e82289d417983acf4b49f2c2778296d Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 4 Jan 2011 16:15:53 +0000 Subject: fix problem with python threads on 2010.1 --- repsys | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 repsys (limited to 'repsys') diff --git a/repsys b/repsys new file mode 100755 index 0000000..99847bf --- /dev/null +++ b/repsys @@ -0,0 +1,93 @@ +#!/usr/bin/python +from RepSys import Error, plugins, config +from RepSys.command import * +import getopt +import sys + +VERSION="1.9.1-binrepo" + +HELP = """\ +Usage: repsys COMMAND [COMMAND ARGUMENTS] + +Tool to access and manage a package repository structure. + +http://wiki.mandriva.com/en/Development/Packaging/RepositorySystem/Quickstart + +Useful commands: + co checkout a package + ci commit changes + sync add-remove all file changes from the .spec + submit submit a package for build + putsrpm import a source package to the repository + getspec prints the spec + rpmlog prints the RPM changelog + getsrpm creates the source RPM + create create the structure of a new package + changed shows changes not submitted + authoremail prints the e-mail of a given author + switch relocate to mirror or upstream repository + +Run "repsys COMMAND --help" and "man 8 repsys" for more information. + +Written by Gustavo Niemeyer +""" + +command_aliases = {"import": "putsrpm"} + +def plugin_help(opt, val, parser, mode): + if parser is None: + prog = sys.argv[0] + print "Use %s --help-plugin " % prog + print "Available plugins:" + print + for name in plugins.list(): + print name + else: + print plugins.help(parser) + raise SystemExit + +def parse_options(): + parser = OptionParser(help=HELP, version="%prog "+VERSION) + parser.disable_interspersed_args() + parser.add_option("--debug", action="store_true") + parser.add_option("--help-plugins", action="callback", callback=plugin_help) + parser.add_option("--help-plugin", type="string", dest="__ignore", + action="callback", callback=plugin_help) + opts, args = parser.parse_args() + del opts.__ignore + if len(args) < 1: + parser.print_help(sys.stderr) + sys.exit(1) + opts.command = args[0] + opts.argv = args + return opts + +def dispatch_command(command, argv, debug=0): + sys.argv = argv + try: + command = command_aliases[command] + except KeyError: + pass + if debug: + config.set("global", "verbose", "yes") + try: + repsys_module = __import__("RepSys.commands."+command) + commands_module = getattr(repsys_module, "commands") + command_module = getattr(commands_module, command) + except (ImportError, AttributeError): + etype, exc, tb = sys.exc_info() + if tb.tb_next is None and not debug: + raise Error, "invalid command '%s'" % command + raise + command_module.main() + +if __name__ == "__main__": + try: + plugins.load() + except Error, e: + sys.stderr.write("plugin initialization error: %s\n" % e) + sys.exit(1) + config.set("global", "repsys-cmd", sys.argv[0]) + do_command(parse_options, dispatch_command) + +# vim:et:ts=4:sw=4 -- cgit v1.2.1 From 74d20c9c02bd90e557f94a2eca099a97f14cc0a5 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 4 Jan 2011 23:43:39 +0000 Subject: version 1.9.2 --- repsys | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'repsys') diff --git a/repsys b/repsys index 99847bf..a3113f1 100755 --- a/repsys +++ b/repsys @@ -4,7 +4,7 @@ from RepSys.command import * import getopt import sys -VERSION="1.9.1-binrepo" +VERSION="1.9.2-binrepo" HELP = """\ Usage: repsys COMMAND [COMMAND ARGUMENTS] -- cgit v1.2.1