[sysadmin-bin] Allow modules to be specified for show-info
- From: Olav Vitters <ovitters src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Allow modules to be specified for show-info
- Date: Tue, 29 Mar 2011 13:57:24 +0000 (UTC)
commit eb467a5f6563e4789d43c71424759a0237132a11
Author: Olav Vitters <olav vitters nl>
Date: Tue Mar 29 15:56:53 2011 +0200
Allow modules to be specified for show-info
Fixes bug 646063
ftpadmin | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/ftpadmin b/ftpadmin
index e1ca333..50d24e9 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -1347,8 +1347,9 @@ https://bugzilla.gnome.org/enter_bug.cgi?product=sysadmin"""
def cmd_show_info(options, parser):
import datetime
- modules = [os.path.basename(path) for path in glob.glob(os.path.join(BasicInfo.FTPROOT, options.section, '*')) if os.path.isdir(path)]
- for module in modules:
+ if not options.module:
+ options.module = [os.path.basename(path) for path in glob.glob(os.path.join(BasicInfo.FTPROOT, options.section, '*')) if os.path.isdir(path)]
+ for module in options.module:
moduleinfo = ModuleInfo(module, options.section)
version = moduleinfo.versions[-1] if len(moduleinfo.versions) else ""
changed = ""
@@ -1520,8 +1521,8 @@ def main():
)
# show-info
subparser = subparsers.add_parser('show-info', help='show module information')
- subparser.add_argument("-s", "--section", choices=SECTIONS,
- help="Section to install the file to")
+ subparser.add_argument("-s", "--section", choices=SECTIONS)
+ subparser.add_argument('module', nargs='*', help='Module(s) to show info for')
subparser.set_defaults(func=cmd_show_info, section=DEFAULT_SECTION)
# sudo
subparser = subparsers.add_parser('sudo', help='install tarballs uploaded using rsync')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]