From 3c632697bd604933d3284acdc79eb3178ddd77ef Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 27 Sep 2006 13:45:38 +0000 Subject: merge 1.6.2b changes --- RepSys/commands/submit.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 6e9eb0f..380391a 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -39,6 +39,7 @@ def parse_options(): parser.add_option("-t", dest="target", default="Cooker") parser.add_option("-l", dest="list", action="store_true") parser.add_option("-r", dest="revision", type="string", nargs=1) + parser.add_option("--define", action="append") opts, args = parser.parse_args() if not args: name, rev = get_submit_info(".") @@ -63,7 +64,7 @@ def parse_options(): raise Error, "provide -l or a revision number" return opts -def submit(pkgdirurl, revision, target, list=0): +def submit(pkgdirurl, revision, target, list=0, define=[]): #if not NINZ: # raise Error, "you must have NINZ installed to use this command" type, rest = urllib.splittype(pkgdirurl) @@ -113,10 +114,13 @@ def submit(pkgdirurl, revision, target, list=0): createsrpm = get_helper("create-srpm") command = "ssh %s %s '%s' -r %s -t %s" % ( host, createsrpm, pkgdirurl, revision, target) + if define: + command += " " + " ".join([ "--define " + x for x in define ]) status, output = execcmd(command) if status == 0: print "Package submitted!" else: + sys.stderr.write(output) sys.exit(status) -- cgit v1.2.1 From 8a6a78b1e7de47da015c666dd44b29fa86a105a7 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Tue, 16 Jan 2007 18:50:46 +0000 Subject: Added the option "host" to the submit section. It allows to submit to one host the package placed in another subversion host. The option "-s" in the command-line also can do it. --- RepSys/commands/submit.py | 87 +++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 55 deletions(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 380391a..5c95526 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -18,12 +18,18 @@ import xmlrpclib HELP = """\ Usage: repsys submit [OPTIONS] [URL [REVISION]] +Submits the package from URL to the submit host. + Options: -t TARGET Submit given package URL to given target -l Just list available targets -r REV Provides a revision number (when not providing as an argument) + -s The host in which the package URL will be submitted + (defaults to the host in the URL) -h Show this message + --define Defines one variable to be used by the submit scripts + in the submit host Examples: repsys submit @@ -39,6 +45,8 @@ def parse_options(): parser.add_option("-t", dest="target", default="Cooker") parser.add_option("-l", dest="list", action="store_true") parser.add_option("-r", dest="revision", type="string", nargs=1) + parser.add_option("-s", dest="submithost", type="string", nargs=1, + default=None) parser.add_option("--define", action="append") opts, args = parser.parse_args() if not args: @@ -64,64 +72,33 @@ def parse_options(): raise Error, "provide -l or a revision number" return opts -def submit(pkgdirurl, revision, target, list=0, define=[]): +def submit(pkgdirurl, revision, target, list=0, define=[], submithost=None): #if not NINZ: # raise Error, "you must have NINZ installed to use this command" - type, rest = urllib.splittype(pkgdirurl) - host, path = urllib.splithost(rest) - user, host = urllib.splituser(host) - host, port = urllib.splitport(host) - if type != "https" and type != "svn+ssh": - raise Error, "you must use https:// or svn+ssh:// urls" - if user: - user, passwd = urllib.splitpasswd(user) - if passwd: - raise Error, "do not use a password in your command line" - if type == "https": - user, passwd = get_auth(username=user) - #soap = NINZ.client.Binding(host=host, - # url="https://%s/scripts/cnc/soap" % host, - # ssl=1, - # auth=(NINZ.client.AUTH.httpbasic, - # user, passwd)) - if port: - port = ":"+port - else: - port = "" - iface = xmlrpclib.ServerProxy("https://%s:%s@%s%s/scripts/cnc/xmlrpc" - % (user, passwd, host, port)) - try: - if list: - targets = iface.submit_targets() - if not targets: - raise Error, "no targets available" - sys.stdout.writelines(['"%s"\n' % x for x in targets]) - else: - iface.submit_package(pkgdirurl, revision, target) - print "Package submitted!" - #except NINZ.client.SoapError, e: - except xmlrpclib.ProtocolError, e: - raise Error, "remote error: "+str(e.errmsg) - except xmlrpclib.Fault, e: - raise Error, "remote error: "+str(e.faultString) - except xmlrpclib.Error, e: - raise Error, "remote error: "+str(e) + if submithost is None: + submithost = config.get("submit", "host") + if submithost is None: + # extract the submit host from the svn host + type, rest = urllib.splittype(pkgdirurl) + host, path = urllib.splithost(rest) + user, host = urllib.splituser(host) + submithost, port = urllib.splitport(host) + del type, user, port, path, rest + # runs a create-srpm in the server through ssh, which will make a + # copy of the rpm in the export directory + if list: + raise Error, "unable to list targets from svn+ssh:// URLs" + createsrpm = get_helper("create-srpm") + command = "ssh %s %s '%s' -r %s -t %s" % ( + submithost, createsrpm, pkgdirurl, revision, target) + if define: + command += " " + " ".join([ "--define " + x for x in define ]) + status, output = execcmd(command) + if status == 0: + print "Package submitted!" else: - # runs a create-srpm in the server through ssh, which will make a - # copy of the rpm in the export directory - if list: - raise Error, "unable to list targets from svn+ssh:// URLs" - createsrpm = get_helper("create-srpm") - command = "ssh %s %s '%s' -r %s -t %s" % ( - host, createsrpm, pkgdirurl, revision, target) - if define: - command += " " + " ".join([ "--define " + x for x in define ]) - status, output = execcmd(command) - if status == 0: - print "Package submitted!" - else: - sys.stderr.write(output) - sys.exit(status) + sys.stderr.write(output) + sys.exit(status) def main(): -- cgit v1.2.1 From 0fe6300c34bb791ccfb1050b04fbb9afd162b322 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Tue, 13 Nov 2007 05:11:28 +0000 Subject: Make package and revision optional options for submit, again This mode has been broken for a long time due to a change in subversion output. The confirmation of the revision being used was removed, as already used by mdvsys. Instead, notify the user and allow him to interrupt the process. --- RepSys/commands/submit.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 5c95526..25d5831 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -20,6 +20,9 @@ Usage: repsys submit [OPTIONS] [URL [REVISION]] Submits the package from URL to the submit host. +If no URL and revision are specified, the latest changed revision in +the package working copy of the current directory will be used. + Options: -t TARGET Submit given package URL to given target -l Just list available targets @@ -51,15 +54,8 @@ def parse_options(): opts, args = parser.parse_args() if not args: name, rev = get_submit_info(".") - try: - yn = raw_input("Submit '%s', revision %d (y/N)? " % (name, rev)) - except KeyboardInterrupt: - yn = "n" - if yn.lower() in ("y", "yes"): - args = name, str(rev) - else: - print "Cancelled." - sys.exit(1) + args = name, str(rev) + print "submitting %s at revision %s..." % args elif len(args) > 2: raise Error, "invalid arguments" opts.pkgdirurl = default_parent(args[0]) -- cgit v1.2.1 From 936d5717d1b4afc17b04afbe02ad7aff8770722d Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Tue, 5 Feb 2008 20:51:43 +0000 Subject: Small changes in help messages: - Added URL of the repository system Quickstart - Make the help message of ci clearer - Removed reference to --help-plugins - Added a simple description for repsys in main help - Added short description of interesting subcommands in main help - Updated CHANGES - Reformeatted the 'switch' message to make it easier to read - Improved the help message of 'submit', added reference to the status page - Better help message for rpmlog - Added help message for patchspec - Better help message for markrelease - Added a help message for getsrpm - Added help message for getspec - Better help message for 'create' + changed example URL - Added a clearer help message for co - Added some text explaining 'changed' - Better authoremail help - Clearer message about uncommenting config option - Removed all configuration options that are not needed by one external - Putsrpm is not working, remove from help message - Added another usage example for submit --- RepSys/commands/submit.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 25d5831..bd6e01c 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -20,6 +20,14 @@ Usage: repsys submit [OPTIONS] [URL [REVISION]] Submits the package from URL to the submit host. +The submit host will try to build the package, and upon successful +completion will 'tag' the package and upload it to the official +repositories. + +The status of the submit can visualized at: + +http://kenobi.mandriva.com/bs/output.php + If no URL and revision are specified, the latest changed revision in the package working copy of the current directory will be used. @@ -40,6 +48,7 @@ Examples: repsys submit https://repos/svn/mdv/cooker/foo 14800 repsys submit -r 14800 https://repos/svn/mdv/cooker/foo repsys submit -l https://repos + repsys submit --define section=main/testing -t 2008.0 """ def parse_options(): -- cgit v1.2.1 From 57c80e59a9f3b38c4c1dc00fd3e8001b5e2b4283 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Tue, 5 Feb 2008 20:56:25 +0000 Subject: Allow listing targets through SSH submit host It required to add a option --list on create-srpm and change repsys submit to use this option. --- RepSys/commands/submit.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index bd6e01c..f1726dc 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -55,7 +55,7 @@ def parse_options(): parser = OptionParser(help=HELP) parser.defaults["revision"] = "" parser.add_option("-t", dest="target", default="Cooker") - parser.add_option("-l", dest="list", action="store_true") + parser.add_option("-l", action="callback", callback=list_targets) parser.add_option("-r", dest="revision", type="string", nargs=1) parser.add_option("-s", dest="submithost", type="string", nargs=1, default=None) @@ -77,6 +77,16 @@ def parse_options(): raise Error, "provide -l or a revision number" return opts +def list_targets(option, opt, val, parser): + host = config.get("submit", "host") + if host is None: + raise Error, "no submit host defined in repsys.conf" + createsrpm = get_helper("create-srpm") + #TODO make it configurable + command = "ssh %s %s --list" % (host, createsrpm) + execcmd(command, show=True) + sys.exit(0) + def submit(pkgdirurl, revision, target, list=0, define=[], submithost=None): #if not NINZ: # raise Error, "you must have NINZ installed to use this command" -- cgit v1.2.1 From d8ba6ea3b5d5dc7a80050cf4955e7588609a1d21 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:23:33 +0000 Subject: Pulled a couple of get_submit_info fixes --- RepSys/commands/submit.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index f1726dc..f2f1cdb 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -62,9 +62,11 @@ def parse_options(): parser.add_option("--define", action="append") opts, args = parser.parse_args() if not args: - name, rev = get_submit_info(".") - args = name, str(rev) - print "submitting %s at revision %s..." % args + name, url, rev = get_submit_info(".") + args = url, str(rev) + #FIXME bad place for output + print "Submitting %s at revision %s" % (name, rev) + print "URL: " + url elif len(args) > 2: raise Error, "invalid arguments" opts.pkgdirurl = default_parent(args[0]) -- cgit v1.2.1 From 3e8f299463066309321f5356831e6fd45e371660 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:23:41 +0000 Subject: Allow submitting packages at once It adds a new syntax for repsys submit, in which each package version can be specified using the NAME@REV format. It also required to change create-srpm to accept the new format. It should still be compatible with older clients. --- RepSys/commands/submit.py | 74 +++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index f2f1cdb..2869ff4 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -1,22 +1,18 @@ #!/usr/bin/python from RepSys import Error, config from RepSys.command import * -from RepSys.rpmutil import get_spec, get_submit_info +from RepSys.rpmutil import get_spec, get_submit_info, svn_url_rev from RepSys.util import get_auth, execcmd, get_helper import urllib import getopt import sys import re - -#try: -# import NINZ.client -#except ImportError: -# NINZ = None +import subprocess import xmlrpclib HELP = """\ -Usage: repsys submit [OPTIONS] [URL [REVISION]] +Usage: repsys submit [OPTIONS] [URL[@REVISION] ...] Submits the package from URL to the submit host. @@ -28,8 +24,8 @@ The status of the submit can visualized at: http://kenobi.mandriva.com/bs/output.php -If no URL and revision are specified, the latest changed revision in -the package working copy of the current directory will be used. +If no URL and revision are specified, the latest changed revision in the +package working copy of the current directory will be used. Options: -t TARGET Submit given package URL to given target @@ -44,39 +40,46 @@ Options: Examples: repsys submit - repsys submit foo 14800 - repsys submit https://repos/svn/mdv/cooker/foo 14800 - repsys submit -r 14800 https://repos/svn/mdv/cooker/foo + repsys submit foo + repsys submit foo@14800 bar baz@11001 + repsys submit https://repos/svn/mdv/cooker/foo repsys submit -l https://repos - repsys submit --define section=main/testing -t 2008.0 + repsys submit --define section=main/testing -t 2008.1 """ def parse_options(): parser = OptionParser(help=HELP) - parser.defaults["revision"] = "" + parser.defaults["revision"] = None parser.add_option("-t", dest="target", default="Cooker") parser.add_option("-l", action="callback", callback=list_targets) parser.add_option("-r", dest="revision", type="string", nargs=1) parser.add_option("-s", dest="submithost", type="string", nargs=1, default=None) - parser.add_option("--define", action="append") + parser.add_option("--define", action="append", default=[]) opts, args = parser.parse_args() if not args: name, url, rev = get_submit_info(".") - args = url, str(rev) - #FIXME bad place for output + args = ["%s@%s" % (url, str(rev))] print "Submitting %s at revision %s" % (name, rev) - print "URL: " + url - elif len(args) > 2: - raise Error, "invalid arguments" - opts.pkgdirurl = default_parent(args[0]) + print "URL: %s" % url + if opts.revision is not None: + # backwards compatibility with the old -r usage + if len(args) == 1: + args[0] = args[0] + "@" + opts.revision + else: + raise Error, "can't use -r REV with more than one package name" + del opts.revision if len(args) == 2: - opts.revision = re.compile(r".*?(\d+).*").sub(r"\1", args[1]) - elif len(args) == 1 and opts.revision: - # accepts -r 3123 http://foo/bar - pass - elif not opts.list: - raise Error, "provide -l or a revision number" + # prevent from using the old syntax + try: + rev = int(args[1]) + except ValueError: + # ok, it is a package name, let it pass + pass + else: + raise Error, "the format is deprecated, "\ + "use @ instead" + opts.urls = [default_parent(nameurl) for nameurl in args] return opts def list_targets(option, opt, val, parser): @@ -89,9 +92,7 @@ def list_targets(option, opt, val, parser): execcmd(command, show=True) sys.exit(0) -def submit(pkgdirurl, revision, target, list=0, define=[], submithost=None): - #if not NINZ: - # raise Error, "you must have NINZ installed to use this command" +def submit(urls, target, define=[], submithost=None): if submithost is None: submithost = config.get("submit", "host") if submithost is None: @@ -103,13 +104,13 @@ def submit(pkgdirurl, revision, target, list=0, define=[], submithost=None): del type, user, port, path, rest # runs a create-srpm in the server through ssh, which will make a # copy of the rpm in the export directory - if list: - raise Error, "unable to list targets from svn+ssh:// URLs" createsrpm = get_helper("create-srpm") - command = "ssh %s %s '%s' -r %s -t %s" % ( - submithost, createsrpm, pkgdirurl, revision, target) - if define: - command += " " + " ".join([ "--define " + x for x in define ]) + args = ["ssh", submithost, createsrpm, "-t", target] + for entry in define: + args.append("--define") + args.append(entry) + args.extend(urls) + command = subprocess.list2cmdline(args) status, output = execcmd(command) if status == 0: print "Package submitted!" @@ -117,7 +118,6 @@ def submit(pkgdirurl, revision, target, list=0, define=[], submithost=None): sys.stderr.write(output) sys.exit(status) - def main(): do_command(parse_options, submit) -- cgit v1.2.1 From 5c7f585c08c8ffb944095ae031fbf82a54ba13bc Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:24:21 +0000 Subject: Allow specifying distro branches without using complete URLs Added the configuration option "repository", which will have the URL to the root of the repository. The change also allowed using mirrors in all the read-only commands. --- RepSys/commands/submit.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 2869ff4..334a424 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -1,7 +1,8 @@ #!/usr/bin/python from RepSys import Error, config from RepSys.command import * -from RepSys.rpmutil import get_spec, get_submit_info, svn_url_rev +from RepSys.layout import package_url, distro_branch +from RepSys.rpmutil import get_spec, get_submit_info from RepSys.util import get_auth, execcmd, get_helper import urllib import getopt @@ -41,16 +42,19 @@ Options: Examples: repsys submit repsys submit foo + repsys submit 2009.1/foo repsys submit foo@14800 bar baz@11001 repsys submit https://repos/svn/mdv/cooker/foo repsys submit -l https://repos repsys submit --define section=main/testing -t 2008.1 """ +DEFAULT_TARGET = "Cooker" + def parse_options(): parser = OptionParser(help=HELP) parser.defaults["revision"] = None - parser.add_option("-t", dest="target", default="Cooker") + parser.add_option("-t", dest="target", default=None) parser.add_option("-l", action="callback", callback=list_targets) parser.add_option("-r", dest="revision", type="string", nargs=1) parser.add_option("-s", dest="submithost", type="string", nargs=1, @@ -79,7 +83,11 @@ def parse_options(): else: raise Error, "the format is deprecated, "\ "use @ instead" - opts.urls = [default_parent(nameurl) for nameurl in args] + opts.urls = [package_url(nameurl, mirrored=False) for nameurl in args] + if opts.target is None: + target = distro_branch(opts.urls[0]) or DEFAULT_TARGET + print "Implicit target: %s" % target + opts.target = target return opts def list_targets(option, opt, val, parser): -- cgit v1.2.1 From 36e54d749e487a4105744e72d3346e777200ed4c Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:24:35 +0000 Subject: Initially working "submit-groups" code It is possible to specify a group of packages and a revision to be submitted. --- RepSys/commands/submit.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 334a424..79129f1 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -1,7 +1,6 @@ #!/usr/bin/python -from RepSys import Error, config +from RepSys import Error, config, layout from RepSys.command import * -from RepSys.layout import package_url, distro_branch from RepSys.rpmutil import get_spec, get_submit_info from RepSys.util import get_auth, execcmd, get_helper import urllib @@ -21,6 +20,9 @@ The submit host will try to build the package, and upon successful completion will 'tag' the package and upload it to the official repositories. +The package name can refer to an alias to a group of packages defined in +the section submit-groups of the configuration file. + The status of the submit can visualized at: http://kenobi.mandriva.com/bs/output.php @@ -46,6 +48,7 @@ Examples: repsys submit foo@14800 bar baz@11001 repsys submit https://repos/svn/mdv/cooker/foo repsys submit -l https://repos + repsys submit -t 2008.1 my-python-packages@11011 repsys submit --define section=main/testing -t 2008.1 """ @@ -83,13 +86,30 @@ def parse_options(): else: raise Error, "the format is deprecated, "\ "use @ instead" - opts.urls = [package_url(nameurl, mirrored=False) for nameurl in args] + # expand group aliases + expanded = [] + for nameurl in args: + expanded.extend(expand_group(nameurl)) + if expanded != args: + print "Submitting: %s" % " ".join(expanded) + args = expanded + opts.urls = [layout.package_url(nameurl, mirrored=False) for nameurl in args] if opts.target is None: - target = distro_branch(opts.urls[0]) or DEFAULT_TARGET + target = layout.distro_branch(opts.urls[0]) or DEFAULT_TARGET print "Implicit target: %s" % target opts.target = target return opts +def expand_group(group): + name, rev = layout.split_url_revision(group) + found = config.get("submit-groups", name) + packages = [group] + if found: + packages = found.split() + if rev: + packages = [("%s@%s" % package) for package in packages] + return packages + def list_targets(option, opt, val, parser): host = config.get("submit", "host") if host is None: -- cgit v1.2.1 From 5335dc3383f43a037c548158b3cd6bc385eb5770 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:24:41 +0000 Subject: Allow using the format / for submit groups It will expand / for each package name of the group (using the same of course.) We must allow it as the option -d (which would be used for --distro) would be confused with --define, so we'd better use the standard format that is available for all other commands. --- RepSys/commands/submit.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 79129f1..c4a0c05 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -102,12 +102,19 @@ def parse_options(): def expand_group(group): name, rev = layout.split_url_revision(group) + distro = None + if "/" in name: + distro, name = name.rsplit("/", 1) found = config.get("submit-groups", name) packages = [group] if found: packages = found.split() if rev: - packages = [("%s@%s" % package) for package in packages] + packages = [("%s@%s" % (package, rev)) + for package in packages] + if distro: + packages = ["%s/%s" % (distro, package) + for package in packages] return packages def list_targets(option, opt, val, parser): -- cgit v1.2.1 From 57d98ad144636d796103d1624fd9a130ad8fc33c Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:24:48 +0000 Subject: Ok, we have added a --distro option in order to allow the user specifying the distro name without worrying about the format. Just for completeness. --- RepSys/commands/submit.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index c4a0c05..44a4284 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -38,6 +38,7 @@ Options: -s The host in which the package URL will be submitted (defaults to the host in the URL) -h Show this message + --distro The distribution branch where the packages come from --define Defines one variable to be used by the submit scripts in the submit host @@ -62,6 +63,8 @@ def parse_options(): parser.add_option("-r", dest="revision", type="string", nargs=1) parser.add_option("-s", dest="submithost", type="string", nargs=1, default=None) + parser.add_option("--distro", dest="distro", type="string", + default=None) parser.add_option("--define", action="append", default=[]) opts, args = parser.parse_args() if not args: @@ -93,7 +96,9 @@ def parse_options(): if expanded != args: print "Submitting: %s" % " ".join(expanded) args = expanded - opts.urls = [layout.package_url(nameurl, mirrored=False) for nameurl in args] + opts.urls = [layout.package_url(nameurl, distro=opts.distro, mirrored=False) + for nameurl in args] + del opts.distro if opts.target is None: target = layout.distro_branch(opts.urls[0]) or DEFAULT_TARGET print "Implicit target: %s" % target -- cgit v1.2.1 From 84042a07cc5903105a4689f82ccf802964d5b714 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:24:54 +0000 Subject: In the usage example don't use -t because the user may think it is referring to the source distro --- RepSys/commands/submit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 44a4284..e6b1cc4 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -49,7 +49,7 @@ Examples: repsys submit foo@14800 bar baz@11001 repsys submit https://repos/svn/mdv/cooker/foo repsys submit -l https://repos - repsys submit -t 2008.1 my-python-packages@11011 + repsys submit 2008.1/my-python-packages@11011 repsys submit --define section=main/testing -t 2008.1 """ -- cgit v1.2.1 From 17440c0872591bb090f72b3ea31ca43c799351ba Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:25:02 +0000 Subject: Don't say 'implicit target' when the user uses --distro, it is being explicit --- RepSys/commands/submit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index e6b1cc4..e3b2b85 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -98,11 +98,11 @@ def parse_options(): args = expanded opts.urls = [layout.package_url(nameurl, distro=opts.distro, mirrored=False) for nameurl in args] - del opts.distro - if opts.target is None: + if opts.target is None and distro is None: target = layout.distro_branch(opts.urls[0]) or DEFAULT_TARGET print "Implicit target: %s" % target opts.target = target + del opts.distro return opts def expand_group(group): -- cgit v1.2.1 From 5d9cf5d6c8da267be11d3a39d297c2e9b2b9cf8a Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:25:39 +0000 Subject: Remove the reference to 'python' in the usage example, as chances are high people will not understant it anyway and it would just make it hard to make out what it means --- RepSys/commands/submit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index e3b2b85..36a8ef6 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -49,7 +49,7 @@ Examples: repsys submit foo@14800 bar baz@11001 repsys submit https://repos/svn/mdv/cooker/foo repsys submit -l https://repos - repsys submit 2008.1/my-python-packages@11011 + repsys submit 2008.1/my-packages@11011 repsys submit --define section=main/testing -t 2008.1 """ -- cgit v1.2.1 From 73bef7b3b7a6c1d7c2c2d1b0dfad52e7d7bfa9ab Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 17 Jul 2008 12:25:46 +0000 Subject: Oops, typo --- RepSys/commands/submit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 36a8ef6..aefe1ff 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -98,7 +98,7 @@ def parse_options(): args = expanded opts.urls = [layout.package_url(nameurl, distro=opts.distro, mirrored=False) for nameurl in args] - if opts.target is None and distro is None: + if opts.target is None and opts.distro is None: target = layout.distro_branch(opts.urls[0]) or DEFAULT_TARGET print "Implicit target: %s" % target opts.target = target -- cgit v1.2.1 From 2118671715facec324814a3e834cabaf97fc3f34 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Mon, 10 Nov 2008 16:01:37 +0000 Subject: Make submit compatible with older repsys versions on the server-side Don't use the new pkg@rev format when the user tries to submit only one package. --- RepSys/commands/submit.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'RepSys/commands/submit.py') diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index aefe1ff..88ff596 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -149,7 +149,14 @@ def submit(urls, target, define=[], submithost=None): for entry in define: args.append("--define") args.append(entry) - args.extend(urls) + if len(urls) == 1: + # be compatible with server-side repsys versions older than 1.6.90 + url, rev = layout.split_url_revision(urls[0]) + args.append(url) + args.append("-r") + args.append(str(rev)) + else: + args.extend(urls) command = subprocess.list2cmdline(args) status, output = execcmd(command) if status == 0: -- cgit v1.2.1