447 |
p.add_dep3() |
p.add_dep3() |
448 |
|
|
449 |
def cmd_package_new_version(options, parser): |
def cmd_package_new_version(options, parser): |
450 |
package = options.package |
if options.upstream: |
451 |
|
downstream, downstream_files = get_downstream_names() |
452 |
|
|
453 |
|
if options.package not in downstream: |
454 |
|
print >>sys.stderr, "ERROR: No packages for upstream name: %s" % options.package |
455 |
|
sys.exit(1) |
456 |
|
|
457 |
|
if len(downstream[options.package]) != 1: |
458 |
|
# XXX - Make it more intelligent |
459 |
|
print >>sys.stderr, "ERROR: Multiple packages for upstream name: %s" % options.package |
460 |
|
sys.exit(1) |
461 |
|
|
462 |
|
package = list(downstream[options.package])[0] |
463 |
|
else: |
464 |
|
package = options.package |
465 |
|
|
466 |
|
|
467 |
|
|
468 |
root = os.path.expanduser(PKGROOT) |
root = os.path.expanduser(PKGROOT) |
469 |
cwd = os.path.join(root, package) |
cwd = os.path.join(root, package) |
521 |
subparser = subparsers.add_parser('increase', help='Increase version number') |
subparser = subparsers.add_parser('increase', help='Increase version number') |
522 |
subparser.add_argument("package", help="Package name") |
subparser.add_argument("package", help="Package name") |
523 |
subparser.add_argument("version", help="Version number") |
subparser.add_argument("version", help="Version number") |
524 |
|
subparser.add_argument("-u", "--upstream", action="store_true", dest="upstream", |
525 |
|
help="Package name reflects the upstream name") |
526 |
subparser.add_argument("-s", "--submit", action="store_true", dest="submit", |
subparser.add_argument("-s", "--submit", action="store_true", dest="submit", |
527 |
help="Commit changes and submit") |
help="Commit changes and submit") |
528 |
subparser.set_defaults( |
subparser.set_defaults( |
529 |
func=cmd_package_new_version, submit=False |
func=cmd_package_new_version, submit=False, upstream=False |
530 |
) |
) |
531 |
|
|
532 |
if len(sys.argv) == 1: |
if len(sys.argv) == 1: |