46 |
# version freeze |
# version freeze |
47 |
import datetime |
import datetime |
48 |
|
|
49 |
|
# packages --sort |
50 |
|
import itertools |
51 |
|
|
52 |
MEDIA="Core Release Source" |
MEDIA="Core Release Source" |
53 |
URL="http://download.gnome.org/sources/" |
URL="http://download.gnome.org/sources/" |
54 |
PKGROOT='~/pkgs' |
PKGROOT='~/pkgs' |
55 |
SLEEP_INITIAL=300 |
SLEEP_INITIAL=180 |
56 |
|
SLEEP_REPEAT=30 |
57 |
|
SLEEP_TIMES=20 |
58 |
|
|
59 |
re_majmin = re.compile(r'^([0-9]+\.[0-9]+).*') |
re_majmin = re.compile(r'^([0-9]+\.[0-9]+).*') |
60 |
re_version = re.compile(r'([-.]|\d+|[^-.\d]+)') |
re_version = re.compile(r'([-.]|\d+|[^-.\d]+)') |
262 |
else spec.sources() |
else spec.sources() |
263 |
return dict((os.path.basename(name), name) for name, no, flags in srclist) |
return dict((os.path.basename(name), name) for name, no, flags in srclist) |
264 |
|
|
265 |
def update(self, version): |
def update(self, version, force=False): |
266 |
"""Update specfile (increase version)""" |
"""Update specfile (increase version)""" |
267 |
cur_version = self.version |
cur_version = self.version |
268 |
|
|
274 |
|
|
275 |
if judgement < 5: |
if judgement < 5: |
276 |
print "WARNING: %s!" % (msg) |
print "WARNING: %s!" % (msg) |
277 |
return False |
if not force: return False |
278 |
|
|
279 |
# XXX - os.path.join is hackish |
# XXX - os.path.join is hackish |
280 |
if subprocess.check_output(["svn", "diff", os.path.join(self.path, '..')]) != '': |
svn_diff_output = subprocess.check_output(["svn", "diff", os.path.join(self.path, '..')]) |
281 |
|
if svn_diff_output != '': |
282 |
|
print svn_diff_output |
283 |
print >>sys.stderr, "ERROR: Package has uncommitted changes!" |
print >>sys.stderr, "ERROR: Package has uncommitted changes!" |
284 |
return False |
if not force: |
285 |
|
return False |
286 |
|
|
287 |
|
# Forcing package submission: revert changes |
288 |
|
try: |
289 |
|
print >>sys.stderr, "WARNING: Force used; reverting svn changes" |
290 |
|
subprocess.check_call(["svn", "revert", "-R", os.path.join(self.path, '..')]) |
291 |
|
except subprocess.CalledProcessError: |
292 |
|
return False |
293 |
|
|
294 |
with open(self.path, "rw") as f: |
with open(self.path, "rw") as f: |
295 |
data = f.read() |
data = f.read() |
317 |
print "ERROR: Increased version to %s, but RPM doesn't agree!?!" % version |
print "ERROR: Increased version to %s, but RPM doesn't agree!?!" % version |
318 |
return False |
return False |
319 |
|
|
320 |
|
|
321 |
|
# Try to download the new tarball various times and wait between attempts |
322 |
|
tries = 0 |
323 |
|
while tries < SLEEP_TIMES: |
324 |
|
tries += 1 |
325 |
|
if tries > 1: time.sleep(SLEEP_REPEAT) |
326 |
|
try: |
327 |
|
# Download new tarball |
328 |
|
subprocess.check_call(['mgarepo', 'sync', '-d'], cwd=self.cwd) |
329 |
|
# success, so exit loop |
330 |
|
break |
331 |
|
except subprocess.CalledProcessError, e: |
332 |
|
# mgarepo sync returns 1 if the tarball cannot be downloaded |
333 |
|
if e.returncode != 1: |
334 |
|
return False |
335 |
|
else: |
336 |
|
return False |
337 |
|
|
338 |
|
|
339 |
try: |
try: |
|
# Download new tarball |
|
|
subprocess.check_call(['mgarepo', 'sync', '-d'], cwd=self.cwd) |
|
340 |
# Check patches still apply |
# Check patches still apply |
341 |
subprocess.check_call(['bm', '-p', '--nodeps'], cwd=self.cwd) |
subprocess.check_call(['bm', '-p', '--nodeps'], cwd=self.cwd) |
342 |
except subprocess.CalledProcessError: |
except subprocess.CalledProcessError: |
343 |
|
logfile = os.path.join(os.path.dirname(self.path), 'log.%s' % os.path.splitext(os.path.basename(self.path))[0]) |
344 |
|
if os.path.exists(logfile): |
345 |
|
subprocess.call(['tail', '-n', '15', logfile]) |
346 |
return False |
return False |
347 |
|
|
348 |
return True |
return True |
487 |
|
|
488 |
return self._svn_author |
return self._svn_author |
489 |
|
|
|
def get_upstream_names(): |
|
|
urlopen = urllib2.build_opener() |
|
490 |
|
|
491 |
good_dir = re.compile('^[-A-Za-z0-9_+.]+/$') |
class Upstream(object): |
492 |
|
|
493 |
# Get the files |
limit = None |
|
usock = urlopen.open(URL) |
|
|
parser = urllister() |
|
|
parser.feed(usock.read()) |
|
|
usock.close() |
|
|
parser.close() |
|
|
files = parser.urls |
|
494 |
|
|
495 |
tarballs = set([filename.replace('/', '') for filename in files if good_dir.search(filename)]) |
def __init__(self): |
496 |
|
urlopen = urllib2.build_opener() |
497 |
|
|
498 |
return tarballs |
good_dir = re.compile('^[-A-Za-z0-9_+.]+/$') |
499 |
|
|
500 |
def get_downstream_names(): |
# Get the files |
501 |
re_file = re.compile(r'^(?P<module>.*?)[_-](?:(?P<oldversion>([0-9]+[\.])*[0-9]+)-)?(?P<version>([0-9]+[\.\-])*[0-9]+)\.(?P<format>(?:tar\.|diff\.)?[a-z][a-z0-9]*)$') |
usock = urlopen.open(URL) |
502 |
|
parser = urllister() |
503 |
|
parser.feed(usock.read()) |
504 |
|
usock.close() |
505 |
|
parser.close() |
506 |
|
files = parser.urls |
507 |
|
|
508 |
contents = subprocess.check_output(['urpmf', '--qf', '%name|%version|%files', '.', "--media", MEDIA], close_fds=True).strip("\n").splitlines() |
tarballs = set([filename.replace('/', '') for filename in files if good_dir.search(filename)]) |
509 |
|
if self.limit is not None: |
510 |
|
tarballs.intersection_update(self.limit) |
511 |
|
|
512 |
FILES = {} |
self.names = tarballs |
|
TARBALLS = {} |
|
513 |
|
|
514 |
for line in contents: |
class Downstream(object): |
515 |
try: |
re_file = re.compile(r'^(?P<module>.*?)[_-](?:(?P<oldversion>([0-9]+[\.])*[0-9]+)-)?(?P<version>([0-9]+[\.\-])*[0-9]+)\.(?P<format>(?:tar\.|diff\.)?[a-z][a-z0-9]*)$') |
|
srpm, version, filename = line.split("|") |
|
|
except ValueError: |
|
|
print >>sys.stderr, line |
|
|
continue |
|
516 |
|
|
517 |
if '.tar' in filename: |
def __init__(self): |
518 |
r = re_file.match(filename) |
contents = subprocess.check_output(['urpmf', '--qf', '%name|%version|%files', '.', "--media", MEDIA], close_fds=True).strip("\n").splitlines() |
|
if r: |
|
|
fileinfo = r.groupdict() |
|
|
module = fileinfo['module'] |
|
|
|
|
|
if module not in TARBALLS: |
|
|
TARBALLS[module] = {} |
|
|
TARBALLS[module][srpm] = version |
|
|
|
|
|
if srpm not in FILES: |
|
|
FILES[srpm] = set() |
|
|
FILES[srpm].add(filename) |
|
519 |
|
|
520 |
return TARBALLS, FILES |
FILES = {} |
521 |
|
TARBALLS = {} |
522 |
|
|
523 |
def get_downstream_from_upstream(upstream, version): |
for line in contents: |
524 |
# Determine the package name |
try: |
525 |
downstream, downstream_files = get_downstream_names() |
srpm, version, filename = line.split("|") |
526 |
|
except ValueError: |
527 |
|
print >>sys.stderr, line |
528 |
|
continue |
529 |
|
|
530 |
if upstream not in downstream: |
if '.tar' in filename: |
531 |
raise ValueError("No packages for upstream name: %s" % upstream) |
r = self.re_file.match(filename) |
532 |
|
if r: |
533 |
|
fileinfo = r.groupdict() |
534 |
|
module = fileinfo['module'] |
535 |
|
|
536 |
|
if module not in TARBALLS: |
537 |
|
TARBALLS[module] = {} |
538 |
|
TARBALLS[module][srpm] = version |
539 |
|
|
540 |
|
if srpm not in FILES: |
541 |
|
FILES[srpm] = set() |
542 |
|
FILES[srpm].add(filename) |
543 |
|
|
544 |
|
self.tarballs = TARBALLS |
545 |
|
self.files = FILES |
546 |
|
|
547 |
|
def get_downstream_from_upstream(self, upstream, version): |
548 |
|
if upstream not in self.tarballs: |
549 |
|
raise ValueError("No packages for upstream name: %s" % upstream) |
550 |
|
|
551 |
|
if len(self.tarballs[upstream]) == 1: |
552 |
|
return self.tarballs[upstream].keys() |
553 |
|
|
554 |
|
# Directories packages are located in |
555 |
|
root = os.path.expanduser(PKGROOT) |
556 |
|
|
557 |
|
packages = {} |
558 |
|
for package in self.tarballs[upstream].keys(): |
559 |
|
cwd = os.path.join(root, package) |
560 |
|
|
561 |
|
# Checkout package to ensure the checkout reflects the latest changes |
562 |
|
try: |
563 |
|
subprocess.check_call(['mgarepo', 'co', package], cwd=root) |
564 |
|
except subprocess.CalledProcessError: |
565 |
|
raise ValueError("Multiple packages found and cannot checkout %s" % package) |
566 |
|
|
567 |
|
# Determine version from spec file |
568 |
|
try: |
569 |
|
packages[package] = SpecFile(os.path.join(cwd, "SPECS", "%s.spec" % package)).version |
570 |
|
except subprocess.CalledProcessError: |
571 |
|
raise ValueError("Multiple packages found and cannot determine version of %s" % package) |
572 |
|
|
573 |
if len(downstream[upstream]) != 1: |
# Return all packages reflecting the current version |
574 |
# XXX - Make it more intelligent |
matches = [package for package in packages if packages[package] == version] |
575 |
raise ValueError("Multiple packages found for %s: %s" % (upstream, ", ".join(downstream[upstream].keys()))) |
if len(matches): |
576 |
|
return matches |
577 |
|
|
578 |
|
# Return all packages reflecting the version before the current version |
579 |
|
latest_version = get_latest_version(packages.values(), max_version=version) |
580 |
|
matches = [package for package in packages if packages[package] == latest_version] |
581 |
|
if len(matches): |
582 |
|
return matches |
583 |
|
|
584 |
return downstream[upstream].keys() |
# Give up |
585 |
|
raise ValueError("Multiple packages found and cannot determine package for version %s" % version) |
586 |
|
|
587 |
def write_file(path, data): |
def write_file(path, data): |
588 |
with tempfile.NamedTemporaryFile(dir=os.path.dirname(path), delete=False) as fdst: |
with tempfile.NamedTemporaryFile(dir=os.path.dirname(path), delete=False) as fdst: |
600 |
def join_streams(show_version=False, only_diff_version=False): |
def join_streams(show_version=False, only_diff_version=False): |
601 |
root = os.path.expanduser(PKGROOT) |
root = os.path.expanduser(PKGROOT) |
602 |
|
|
603 |
upstream = get_upstream_names() |
upstream = Upstream().names |
604 |
downstream, downstream_files = get_downstream_names() |
downstream = Downstream() |
605 |
|
|
606 |
matches = upstream & set(downstream.keys()) |
matches = upstream & set(downstream.tarballs.keys()) |
607 |
for module in matches: |
for module in matches: |
608 |
for package in downstream[module].keys(): |
for package in downstream.tarballs[module].keys(): |
609 |
package_version = downstream[module][package] |
package_version = downstream.tarballs[module][package] |
610 |
spec_version = None |
spec_version = None |
611 |
if show_version or only_diff_version: |
if show_version or only_diff_version: |
612 |
cwd = os.path.join(root, package) |
cwd = os.path.join(root, package) |
618 |
if only_diff_version and package_version == spec_version: |
if only_diff_version and package_version == spec_version: |
619 |
continue |
continue |
620 |
|
|
621 |
yield (package, module, package_version, spec_version, downstream_files[package]) |
yield (package, module, package_version, spec_version, downstream.files[package]) |
622 |
|
|
623 |
def cmd_ls(options, parser): |
def cmd_ls(options, parser): |
624 |
for package, module, package_version, spec_version, downstream_files in sorted(join_streams(show_version=options.show_version, only_diff_version=options.diff)): |
streams = join_streams(show_version=options.show_version, only_diff_version=options.diff) |
625 |
print package,"\t", |
if options.sort: |
626 |
if options.upstream: print module, "\t", |
SORT=dict(zip(options.sort.read().splitlines(), itertools.count())) |
627 |
if options.show_version: print spec_version, "\t", package_version, "\t", |
|
628 |
|
streams = sorted(streams, key=lambda a: (SORT.get(a[1], 9999), a[0])) |
629 |
|
else: |
630 |
|
streams = sorted(streams) |
631 |
|
|
632 |
|
for package, module, package_version, spec_version, downstream_files in streams: |
633 |
|
sys.stdout.write(package) |
634 |
|
if options.upstream: sys.stdout.write("\t%s" % module) |
635 |
|
if options.show_version: sys.stdout.write("\t%s\t%s" % (spec_version, package_version)) |
636 |
print |
print |
637 |
|
|
638 |
def cmd_patches(options, parser): |
def cmd_patches(options, parser): |
659 |
# Determine the package name |
# Determine the package name |
660 |
if options.upstream: |
if options.upstream: |
661 |
try: |
try: |
662 |
package = get_downstream_from_upstream(options.package, options.version)[0] |
package = Downstream().get_downstream_from_upstream(options.package, options.version)[0] |
663 |
except ValueError, e: |
except ValueError, e: |
664 |
print >>sys.stderr, "ERROR: %s" % e |
print >>sys.stderr, "ERROR: %s" % e |
665 |
sys.exit(1) |
sys.exit(1) |
679 |
# SpecFile class handles the actual version+release change |
# SpecFile class handles the actual version+release change |
680 |
s = SpecFile(os.path.join(cwd, "SPECS", "%s.spec" % package)) |
s = SpecFile(os.path.join(cwd, "SPECS", "%s.spec" % package)) |
681 |
print "%s => %s" % (s.version, options.version) |
print "%s => %s" % (s.version, options.version) |
682 |
if not s.update(options.version): |
if not s.update(options.version, force=options.force): |
683 |
sys.exit(1) |
sys.exit(1) |
684 |
|
|
685 |
# Check hash, if given |
# Check hash, if given |
690 |
sys.stderr(1) |
sys.stderr(1) |
691 |
|
|
692 |
for filename in sources: |
for filename in sources: |
693 |
if not is_valid_hash(os.path.join(cwd, "SOURCES", filename), options.algo, options.hexdigest): |
path = os.path.join(cwd, "SOURCES", filename) |
694 |
|
if not is_valid_hash(path, options.algo, options.hexdigest): |
695 |
print >>sys.stderr, "ERROR: Hash file failed check for %s!" % path |
print >>sys.stderr, "ERROR: Hash file failed check for %s!" % path |
696 |
print >>sys.stderr, "ERROR: Reverting changes!" |
print >>sys.stderr, "ERROR: Reverting changes!" |
697 |
subprocess.call(['svn', 'revert', '-R', cwd], cwd=cwd) |
subprocess.call(['svn', 'revert', '-R', cwd], cwd=cwd) |
703 |
# checkin changes |
# checkin changes |
704 |
subprocess.check_call(['mgarepo', 'ci', '-m', 'new version %s' % options.version], cwd=cwd) |
subprocess.check_call(['mgarepo', 'ci', '-m', 'new version %s' % options.version], cwd=cwd) |
705 |
# and submit |
# and submit |
706 |
subprocess.check_call(['mgarepo', 'submit'], cwd=cwd) |
# XXX HACK NOT TO AUTO SUBMIT ATM |
707 |
|
if options.hexdigest is None: |
708 |
|
subprocess.check_call(['mgarepo', 'submit'], cwd=cwd) |
709 |
except subprocess.CalledProcessError: |
except subprocess.CalledProcessError: |
710 |
sys.exit(1) |
sys.exit(1) |
711 |
|
|
712 |
def cmd_parse_ftp_release_list(options, parser): |
def cmd_parse_ftp_release_list(options, parser): |
713 |
# XXX - not working yet |
def _send_reply_mail(contents, orig_msg, to, packages=[], error=False): |
|
def _send_reply_mail(contents, orig_msg, to, error=False): |
|
714 |
"""Send an reply email""" |
"""Send an reply email""" |
715 |
contents.seek(0) |
contents.seek(0) |
716 |
msg = MIMEText(contents.read(), _charset='utf-8') |
msg = MIMEText(contents.read(), _charset='utf-8') |
717 |
|
|
718 |
if error: |
if error: |
719 |
# XXX - ugly |
# XXX - ugly |
720 |
contents.seek(0) |
contents.seek(0) |
721 |
lastline = contents.read().splitlines()[-1] |
lastline = contents.read().rstrip().splitlines()[-1] |
722 |
# Remove things like "ERROR: " and so on from the last line |
# Remove things like "ERROR: " and so on from the last line |
723 |
lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline) |
lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline) |
724 |
|
# Remove things like " - " (youri output from mgarepo submit) |
725 |
|
lastline = re.sub(r'^\s+-\s+', '', lastline) |
726 |
subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)" |
subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)" |
727 |
else: |
else: |
728 |
subjecterror = "" |
subjecterror = "" |
729 |
msg['Subject'] = "Re: %s%s" % (orig_msg['Subject'], subjecterror) |
|
730 |
|
if packages: |
731 |
|
subject = "%s %s%s" % (", ".join(packages), orig_msg['X-Module-Version'], subjecterror) |
732 |
|
else: |
733 |
|
subject = "Re: %s%s" % (orig_msg['Subject'], subjecterror) |
734 |
|
|
735 |
|
msg['Subject'] = subject |
736 |
msg['To'] = to |
msg['To'] = to |
737 |
msg["In-Reply-To"] = orig_msg["Message-ID"] |
msg["In-Reply-To"] = orig_msg["Message-ID"] |
738 |
msg["References"] = orig_msg["Message-ID"] |
msg["References"] = orig_msg["Message-ID"] |
766 |
sys.exit(1) |
sys.exit(1) |
767 |
|
|
768 |
try: |
try: |
769 |
packages = get_downstream_from_upstream(module, version) |
packages = Downstream().get_downstream_from_upstream(module, version) |
770 |
except ValueError, e: |
except ValueError, e: |
771 |
print >>stderr, "ERROR: %s" % e |
print >>stderr, "ERROR: %s" % e |
772 |
if options.mail: _send_reply_mail(stdout, msg, options.mail, error=True) |
if options.mail: _send_reply_mail(stdout, msg, options.mail, error=True) |
776 |
# maildrop aborts and will try to deliver after 5min |
# maildrop aborts and will try to deliver after 5min |
777 |
# fork to avoid this |
# fork to avoid this |
778 |
if os.fork() != 0: sys.exit(0) |
if os.fork() != 0: sys.exit(0) |
779 |
time.sleep(SLEEP_INITIAL) |
# wait SLEEP_INITIAL after the message was sent |
780 |
|
secs = SLEEP_INITIAL |
781 |
|
t = email.utils.parsedate_tz(msg['Date']) |
782 |
|
if t is not None: |
783 |
|
msg_time = email.utils.mktime_tz(t) |
784 |
|
secs = SLEEP_INITIAL - (time.time() - msg_time) |
785 |
|
|
786 |
|
if secs > 0: time.sleep(secs) |
787 |
|
|
788 |
error = False |
error = False |
789 |
for package in packages: |
for package in packages: |
790 |
if subprocess.call(['mga-gnome', 'increase', '--submit', '--hash', hexdigest, package, version], stdout=stdout, stderr=stderr): |
cmd = ['mga-gnome', 'increase', '--submit', '--hash', hexdigest] |
791 |
|
if options.force: |
792 |
|
cmd.append('--force') |
793 |
|
cmd.extend((package, version)) |
794 |
|
if subprocess.call(cmd, stdout=stdout, stderr=stderr): |
795 |
error = True |
error = True |
796 |
|
|
797 |
if options.mail: _send_reply_mail(stdout, msg, options.mail, error=error) |
if options.mail: _send_reply_mail(stdout, msg, options.mail, packages=packages, error=error) |
798 |
|
|
799 |
def main(): |
def main(): |
800 |
description = """Mageia GNOME commands.""" |
description = """Mageia GNOME commands.""" |
801 |
epilog="""Report bugs to Olav Vitters""" |
epilog="""Report bugs to Olav Vitters""" |
802 |
parser = argparse.ArgumentParser(description=description,epilog=epilog) |
parser = argparse.ArgumentParser(description=description,epilog=epilog) |
803 |
|
parser.add_argument("-l", "--limit", type=argparse.FileType('r', 0), |
804 |
|
dest="limit_upstream", metavar="FILE", |
805 |
|
help="File containing upstream names") |
806 |
|
|
807 |
# SUBPARSERS |
# SUBPARSERS |
808 |
subparsers = parser.add_subparsers(title='subcommands') |
subparsers = parser.add_subparsers(title='subcommands') |
819 |
help="Show version numbers") |
help="Show version numbers") |
820 |
subparser.add_argument( "--diff", action="store_true", dest="diff", |
subparser.add_argument( "--diff", action="store_true", dest="diff", |
821 |
help="Only show packages with different version") |
help="Only show packages with different version") |
822 |
|
subparser.add_argument( "--sort", type=argparse.FileType('r', 0), |
823 |
|
dest="sort", metavar="FILE", |
824 |
|
help="Sort packages according to order in given FILE") |
825 |
|
|
826 |
subparser.set_defaults( |
subparser.set_defaults( |
827 |
func=cmd_ls, upstream=False, show_version=False, diff=False |
func=cmd_ls, upstream=False, show_version=False, diff=False |
828 |
) |
) |
843 |
subparser = subparsers.add_parser('increase', help='Increase version number') |
subparser = subparsers.add_parser('increase', help='Increase version number') |
844 |
subparser.add_argument("package", help="Package name") |
subparser.add_argument("package", help="Package name") |
845 |
subparser.add_argument("version", help="Version number") |
subparser.add_argument("version", help="Version number") |
846 |
|
subparser.add_argument("-f", "--force", action="store_true", dest="force", |
847 |
|
help="Override warnings, just do it") |
848 |
subparser.add_argument("-u", "--upstream", action="store_true", dest="upstream", |
subparser.add_argument("-u", "--upstream", action="store_true", dest="upstream", |
849 |
help="Package name reflects the upstream name") |
help="Package name reflects the upstream name") |
850 |
subparser.add_argument("-s", "--submit", action="store_true", dest="submit", |
subparser.add_argument("-s", "--submit", action="store_true", dest="submit", |
854 |
subparser.add_argument("--hash", dest="hexdigest", |
subparser.add_argument("--hash", dest="hexdigest", |
855 |
help="Hexdigest of the hash") |
help="Hexdigest of the hash") |
856 |
subparser.set_defaults( |
subparser.set_defaults( |
857 |
func=cmd_package_new_version, submit=False, upstream=False, hexdigest=None, algo="sha256" |
func=cmd_package_new_version, submit=False, upstream=False, hexdigest=None, algo="sha256", |
858 |
|
force=False |
859 |
) |
) |
860 |
|
|
861 |
subparser = subparsers.add_parser('gnome-release-email', help='Submit packages based on GNOME ftp-release-list email') |
subparser = subparsers.add_parser('gnome-release-email', help='Submit packages based on GNOME ftp-release-list email') |
862 |
subparser.add_argument("-m", "--mail", help="Email address to send the progress to") |
subparser.add_argument("-m", "--mail", help="Email address to send the progress to") |
863 |
subparser.add_argument("-w", "--wait", action="store_true", |
subparser.add_argument("-w", "--wait", action="store_true", |
864 |
help="Wait before trying to retrieve the new version") |
help="Wait before trying to retrieve the new version") |
865 |
|
subparser.add_argument("-f", "--force", action="store_true", |
866 |
|
help="Force submission") |
867 |
subparser.set_defaults( |
subparser.set_defaults( |
868 |
func=cmd_parse_ftp_release_list |
func=cmd_parse_ftp_release_list, force=False, wait=False |
869 |
) |
) |
870 |
|
|
871 |
if len(sys.argv) == 1: |
if len(sys.argv) == 1: |
873 |
sys.exit(2) |
sys.exit(2) |
874 |
|
|
875 |
options = parser.parse_args() |
options = parser.parse_args() |
876 |
|
if options.limit_upstream: |
877 |
|
Upstream.limit = set(options.limit_upstream.read().strip("\n").splitlines()) |
878 |
|
|
879 |
try: |
try: |
880 |
options.func(options, parser) |
options.func(options, parser) |
890 |
sys.exit(0) |
sys.exit(0) |
891 |
|
|
892 |
if __name__ == "__main__": |
if __name__ == "__main__": |
893 |
|
os.environ['PYTHONUNBUFFERED'] = '1' |
894 |
main() |
main() |