From f959ff32127c48ce84f7d8d5f9bb93813ed3c190 Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Wed, 18 Sep 2013 23:36:11 +0200 Subject: sort subcommands and rename check-setup to check-prep --- mgagnome | 93 +++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 45 insertions(+), 48 deletions(-) (limited to 'mgagnome') diff --git a/mgagnome b/mgagnome index 41ed21a..d549797 100755 --- a/mgagnome +++ b/mgagnome @@ -413,11 +413,11 @@ class SpecFile(object): if failed_patch: print >>sys.stderr, "ERROR: Problem applying patch: %s" % failed_patch elif cmd: - print >>sys.stderr, "ERROR: Problem in %%setup phase command: %s" % cmd + print >>sys.stderr, "ERROR: Problem in %%prep phase command: %s" % cmd elif patches: - print >>sys.stderr, "ERROR: Problem applying patches and/or %setup phase" + print >>sys.stderr, "ERROR: Problem applying patches and/or %prep phase" else: - print >>sys.stderr, "ERROR: Problem in %setup phase" + print >>sys.stderr, "ERROR: Problem in %prep phase" return False finally: buildpath = os.path.join(self.cwd, '..', 'BUILD', '%s-%s' % (self.module, self.version)) @@ -966,7 +966,7 @@ def cmd_dep3(options, parser): p = Patch(options.patch) p.add_dep3() -def cmd_check_setup(options, parser): +def cmd_check_prep(options, parser): # Directories packages are located in root = os.path.expanduser(Downstream.PKGROOT) cwd = os.path.join(root, options.package) @@ -1138,32 +1138,15 @@ def main(): # SUBPARSERS subparsers = parser.add_subparsers(title='subcommands') - # install - subparser = subparsers.add_parser('co', help='checkout all GNOME modules') - subparser.set_defaults( - func=cmd_co - ) - - subparser = subparsers.add_parser('packages', help='list all GNOME packages') - subparser.add_argument("-m", "--m", action="store_true", dest="upstream", - help="Show upstream module") - subparser.add_argument( "--version", action="store_true", dest="show_version", - help="Show version numbers") - subparser.add_argument( "--diff", action="store_true", dest="diff", - help="Only show packages with different version") - subparser.add_argument( "--sort", type=argparse.FileType('r', 0), - dest="sort", metavar="FILE", - help="Sort packages according to order in given FILE") - + subparser = subparsers.add_parser('check-latest', help='check for latest version of packages') subparser.set_defaults( - func=cmd_ls, upstream=False, show_version=False, diff=False + func=cmd_check_latest ) - subparser = subparsers.add_parser('group-owner', help='list packages by group') - subparser.add_argument('group', metavar="GROUP", nargs='+') - + subparser = subparsers.add_parser('check-prep', help='check prep phase') + subparser.add_argument("package", help="Package name") subparser.set_defaults( - func=cmd_group_owner + func=cmd_check_prep ) subparser = subparsers.add_parser('check-version', help='check if spec version and downstream version match') @@ -1171,31 +1154,36 @@ def main(): func=cmd_check_version ) - subparser = subparsers.add_parser('check-latest', help='check for latest version of packages') + subparser = subparsers.add_parser('co', help='checkout all GNOME packages') subparser.set_defaults( - func=cmd_check_latest + func=cmd_co ) - subparser = subparsers.add_parser('patches', help='list all GNOME patches') - subparser.add_argument("-p", "--path", action="store_true", dest="path", - help="Show full path to patch") + subparser = subparsers.add_parser('dep3', help='add dep3 headers') + subparser.add_argument("patch", help="Patch") subparser.set_defaults( - func=cmd_patches, path=False + func=cmd_dep3, path=False ) - subparser = subparsers.add_parser('dep3', help='Add dep3 headers') - subparser.add_argument("patch", help="Patch") + subparser = subparsers.add_parser('gnome-release-email', help='submit packages based on GNOME ftp-release-list email') + subparser.add_argument("-m", "--mail", help="Email address to send the progress to") + subparser.add_argument("-w", "--wait", action="store_true", + help="Wait before trying to retrieve the new version") + subparser.add_argument("-s", "--submit", action="store_true", dest="submit", + help="Commit changes and submit") + subparser.add_argument("-f", "--force", action="store_true", + help="Force submission") subparser.set_defaults( - func=cmd_dep3, path=False + func=cmd_parse_ftp_release_list, force=False, wait=False ) - subparser = subparsers.add_parser('check-setup', help='check setup phase') - subparser.add_argument("package", help="Package name") + subparser = subparsers.add_parser('group-owner', help='list packages by group') + subparser.add_argument('group', metavar="GROUP", nargs='+') subparser.set_defaults( - func=cmd_check_setup + func=cmd_group_owner ) - subparser = subparsers.add_parser('increase', help='Increase version number') + subparser = subparsers.add_parser('increase', help='increase version number') subparser.add_argument("package", help="Package name") subparser.add_argument("version", help="Version number") subparser.add_argument("-f", "--force", action="store_true", dest="force", @@ -1215,16 +1203,25 @@ def main(): force=False ) - subparser = subparsers.add_parser('gnome-release-email', help='Submit packages based on GNOME ftp-release-list email') - subparser.add_argument("-m", "--mail", help="Email address to send the progress to") - subparser.add_argument("-w", "--wait", action="store_true", - help="Wait before trying to retrieve the new version") - subparser.add_argument("-s", "--submit", action="store_true", dest="submit", - help="Commit changes and submit") - subparser.add_argument("-f", "--force", action="store_true", - help="Force submission") + subparser = subparsers.add_parser('packages', help='list all GNOME packages') + subparser.add_argument("-m", "--m", action="store_true", dest="upstream", + help="Show upstream module") + subparser.add_argument( "--version", action="store_true", dest="show_version", + help="Show version numbers") + subparser.add_argument( "--diff", action="store_true", dest="diff", + help="Only show packages with different version") + subparser.add_argument( "--sort", type=argparse.FileType('r', 0), + dest="sort", metavar="FILE", + help="Sort packages according to order in given FILE") subparser.set_defaults( - func=cmd_parse_ftp_release_list, force=False, wait=False + func=cmd_ls, upstream=False, show_version=False, diff=False + ) + + subparser = subparsers.add_parser('patches', help='list all GNOME patches') + subparser.add_argument("-p", "--path", action="store_true", dest="path", + help="Show full path to patch") + subparser.set_defaults( + func=cmd_patches, path=False ) if len(sys.argv) == 1: -- cgit v1.2.1