aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-07-12 21:17:59 +0000
committerNicolas Vigier <boklm@mageia.org>2011-07-12 21:17:59 +0000
commitf319565ec13459e97c046a928e4a4d3bd2d83635 (patch)
treee2acc893a21e2a1238d0877a6a21addde7b86800 /MgaRepo
parent2c111e379bfd6709407b157710045425e68b56a3 (diff)
downloadmgarepo-f319565ec13459e97c046a928e4a4d3bd2d83635.tar
mgarepo-f319565ec13459e97c046a928e4a4d3bd2d83635.tar.gz
mgarepo-f319565ec13459e97c046a928e4a4d3bd2d83635.tar.bz2
mgarepo-f319565ec13459e97c046a928e4a4d3bd2d83635.tar.xz
mgarepo-f319565ec13459e97c046a928e4a4d3bd2d83635.zip
add maintdb command
Diffstat (limited to 'MgaRepo')
-rw-r--r--MgaRepo/commands/maintdb.py44
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