417 |
p.add_dep3() |
p.add_dep3() |
418 |
|
|
419 |
def cmd_package_new_version(options, parser): |
def cmd_package_new_version(options, parser): |
|
cwd = os.path.expanduser(PKGROOT) |
|
420 |
package = options.package |
package = options.package |
421 |
|
|
422 |
|
cwd = os.path.join(os.path.expanduser(PKGROOT), package) |
423 |
|
|
424 |
subprocess.call(['mgarepo', 'co', package], cwd=cwd) |
subprocess.call(['mgarepo', 'co', package], cwd=cwd) |
425 |
s = SpecFile(os.path.join(cwd, package, "SPECS", "%s.spec" % package)) |
s = SpecFile(os.path.join(cwd, "SPECS", "%s.spec" % package)) |
426 |
print "%s => %s" % (s.version, options.version) |
print "%s => %s" % (s.version, options.version) |
427 |
if not s.update(options.version): |
if not s.update(options.version): |
428 |
sys.exit(1) |
sys.exit(1) |
429 |
|
|
430 |
|
if options.submit: |
431 |
|
try: |
432 |
|
# checkin changes |
433 |
|
subprocess.check_call(['mgarepo', 'ci', '-m', 'new version'], cwd=cwd) |
434 |
|
# and submit |
435 |
|
subprocess.check_call(['mgarepo', 'submit'], cwd=cwd) |
436 |
|
except subprocess.CalledProcessError: |
437 |
|
sys.exit(1) |
438 |
|
|
439 |
|
|
440 |
def main(): |
def main(): |
441 |
description = """Mageia GNOME commands.""" |
description = """Mageia GNOME commands.""" |
471 |
subparser = subparsers.add_parser('increase', help='Increase version number') |
subparser = subparsers.add_parser('increase', help='Increase version number') |
472 |
subparser.add_argument("package", help="Package name") |
subparser.add_argument("package", help="Package name") |
473 |
subparser.add_argument("version", help="Version number") |
subparser.add_argument("version", help="Version number") |
474 |
|
subparser.add_argument("-s", "--submit", action="store_true", dest="submit", |
475 |
|
help="Commit changes and submit") |
476 |
subparser.set_defaults( |
subparser.set_defaults( |
477 |
func=cmd_package_new_version, path=False |
func=cmd_package_new_version, submit=False |
478 |
) |
) |
479 |
|
|
480 |
if len(sys.argv) == 1: |
if len(sys.argv) == 1: |