From f319565ec13459e97c046a928e4a4d3bd2d83635 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Tue, 12 Jul 2011 21:17:59 +0000 Subject: add maintdb command --- MgaRepo/commands/maintdb.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 MgaRepo/commands/maintdb.py (limited to 'MgaRepo/commands/maintdb.py') 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 -- cgit v1.2.1