305 |
with open(self.path, "rw") as f: |
with open(self.path, "rw") as f: |
306 |
data = f.read() |
data = f.read() |
307 |
|
|
308 |
|
if data.count("%subrel") != 0: |
309 |
|
print >>sys.stderr, "ERROR: %subrel found; don't know what to do!" |
310 |
|
return False |
311 |
|
|
312 |
if data.count("%mkrel") != 1: |
if data.count("%mkrel") != 1: |
313 |
print >>sys.stderr, "ERROR: Multiple %mkrel found; don't know what to do!" |
print >>sys.stderr, "ERROR: Multiple %mkrel found; don't know what to do!" |
314 |
return False |
return False |
346 |
except subprocess.CalledProcessError, e: |
except subprocess.CalledProcessError, e: |
347 |
# mgarepo sync returns 1 if the tarball cannot be downloaded |
# mgarepo sync returns 1 if the tarball cannot be downloaded |
348 |
if e.returncode != 1: |
if e.returncode != 1: |
349 |
|
subprocess.check_call(["svn", "revert", "-R", os.path.join(self.path, '..')]) |
350 |
return False |
return False |
351 |
else: |
else: |
352 |
|
# failed to download tarball |
353 |
|
subprocess.check_call(["svn", "revert", "-R", os.path.join(self.path, '..')]) |
354 |
return False |
return False |
355 |
|
|
356 |
|
|
575 |
|
|
576 |
if module not in TARBALLS: |
if module not in TARBALLS: |
577 |
TARBALLS[module] = {} |
TARBALLS[module] = {} |
578 |
TARBALLS[module][srpm] = version |
|
579 |
|
if srpm in TARBALLS[module]: |
580 |
|
# srpm seen before, check if version is newer |
581 |
|
if version_cmp(TARBALLS[module][srpm], version) == 1: |
582 |
|
TARBALLS[module][srpm] = version |
583 |
|
else: |
584 |
|
TARBALLS[module][srpm] = version |
585 |
|
|
586 |
if srpm not in FILES: |
if srpm not in FILES: |
587 |
FILES[srpm] = set() |
FILES[srpm] = set() |
697 |
streams = join_streams(show_version=True) |
streams = join_streams(show_version=True) |
698 |
|
|
699 |
for package, module, package_version, spec_version, downstream_files in streams: |
for package, module, package_version, spec_version, downstream_files in streams: |
700 |
|
upgrade=set() |
701 |
sys.stdout.write(package) |
sys.stdout.write(package) |
702 |
sys.stdout.write("\t%s\t%s" % (spec_version, package_version)) |
sys.stdout.write("\t%s\t%s" % (spec_version, package_version)) |
703 |
|
|
708 |
latest_version = get_latest_version(versions) |
latest_version = get_latest_version(versions) |
709 |
safe_version = get_latest_version(versions, safe_max_version) |
safe_version = get_latest_version(versions, safe_max_version) |
710 |
|
|
711 |
if version_cmp(latest_version, spec_version) < 0: latest_version = 'N/A' |
cmp_latest = version_cmp(latest_version, spec_version) |
712 |
if version_cmp(safe_version, spec_version) < 0: safe_version = 'N/A' |
if cmp_latest < 0: |
713 |
|
latest_version = 'N/A' |
714 |
|
upgrade.add('l') |
715 |
|
elif cmp_latest > 0: |
716 |
|
upgrade.add('L') |
717 |
|
|
718 |
|
cmp_safe = version_cmp(safe_version, spec_version) |
719 |
|
if cmp_safe < 0: |
720 |
|
safe_version = 'N/A' |
721 |
|
upgrade.add('s') |
722 |
|
elif cmp_safe > 0: |
723 |
|
upgrade.add('S') |
724 |
|
|
725 |
sys.stdout.write("\t%s" % latest_version) |
sys.stdout.write("\t%s" % latest_version) |
726 |
sys.stdout.write("\t%s" % safe_version) |
sys.stdout.write("\t%s" % safe_version) |
727 |
|
sys.stdout.write("\t%s" % "".join(sorted(upgrade))) |
728 |
|
|
729 |
print |
print |
730 |
|
|
731 |
def cmd_patches(options, parser): |
def cmd_patches(options, parser): |
952 |
help="Package name reflects the upstream name") |
help="Package name reflects the upstream name") |
953 |
subparser.add_argument("-s", "--submit", action="store_true", dest="submit", |
subparser.add_argument("-s", "--submit", action="store_true", dest="submit", |
954 |
help="Commit changes and submit") |
help="Commit changes and submit") |
955 |
|
subparser.add_argument( "--no-submit", action="store_false", dest="submit", |
956 |
|
help="Do not commit changes and submit") |
957 |
subparser.add_argument("-a", "--algorithm", choices=hashlib.algorithms, dest="algo", |
subparser.add_argument("-a", "--algorithm", choices=hashlib.algorithms, dest="algo", |
958 |
help="Hash algorithm") |
help="Hash algorithm") |
959 |
subparser.add_argument("--hash", dest="hexdigest", |
subparser.add_argument("--hash", dest="hexdigest", |
960 |
help="Hexdigest of the hash") |
help="Hexdigest of the hash") |
961 |
subparser.set_defaults( |
subparser.set_defaults( |
962 |
func=cmd_package_new_version, submit=True, upstream=False, hexdigest=None, algo="sha256", |
func=cmd_package_new_version, submit=argparse.SUPPRESS, upstream=False, hexdigest=None, algo="sha256", |
963 |
force=False |
force=False |
964 |
) |
) |
965 |
|
|
983 |
if options.limit_upstream: |
if options.limit_upstream: |
984 |
Upstream.limit = set(options.limit_upstream.read().strip("\n").splitlines()) |
Upstream.limit = set(options.limit_upstream.read().strip("\n").splitlines()) |
985 |
|
|
986 |
|
if not hasattr(options, 'submit'): |
987 |
|
options.submit = not options.distro |
988 |
|
|
989 |
if options.distro: |
if options.distro: |
990 |
Downstream.PKGROOT = os.path.join('~/pkgs', options.distro) |
Downstream.PKGROOT = os.path.join('~/pkgs', options.distro) |
991 |
Downstream.MEDIA = "Core Release %s Source" % options.distro |
Downstream.MEDIA = "Core Release {0} Source,Core {0} Updates Source,Core {0} Updates Testing Source".format(options.distro) |
992 |
Downstream.DISTRO = options.distro |
Downstream.DISTRO = options.distro |
993 |
|
|
994 |
try: |
try: |