diff options
Diffstat (limited to 'MgaRepo/commands')
-rw-r--r-- | MgaRepo/commands/maintdb.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/MgaRepo/commands/maintdb.py b/MgaRepo/commands/maintdb.py new file mode 100644 index 0000000..4d64dac --- /dev/null +++ b/MgaRepo/commands/maintdb.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +from MgaRepo import Error, config +from MgaRepo.command import * +from MgaRepo.util import execcmd, get_helper +import sys + + +HELP = """\ +Usage: + Take maintainership of one package : + mgarepo maintdb set [package] [login] + + Remove yourself from maintainer of a package : + mgarepo maintdb set [package] nobody + + See who is maintainer of a package : + mgarepo maintdb get [package] + + See the list of all packages with their maintainer : + mgarepo maintdb get + +""" + +def parse_options(): + parser = OptionParser(help=HELP) + opts, args = parser.parse_args() + if len(args): + opts.maintdb_args = args + else: + raise Error, "you need to provide arguments" + return opts + +def maintdb(maintdb_args): + host = config.get("submit", "host") + maintdb_helper = get_helper("maintdb") + cmd_args = ' '.join(maintdb_args) + command = "ssh %s %s %s" % (host, maintdb_helper, cmd_args) + execcmd(command, show=True) + sys.exit(0) + +def main(): + do_command(parse_options, maintdb) + +# vim:et:ts=4:sw=4 |