--- mga-gnome/trunk/mga-gnome 2012/02/27 09:32:36 3086 +++ mga-gnome/trunk/mga-gnome 2012/02/27 09:43:14 3087 @@ -447,6 +447,7 @@ p.add_dep3() def cmd_package_new_version(options, parser): + # Determine the package name if options.upstream: downstream, downstream_files = get_downstream_names() @@ -456,31 +457,34 @@ if len(downstream[options.package]) != 1: # XXX - Make it more intelligent - print >>sys.stderr, "ERROR: Multiple packages for upstream name: %s" % options.package + print >>sys.stderr, "ERROR: Multiple packages found for %s: %s" % (options.package, ", ".join(downstream[options.package])) sys.exit(1) package = list(downstream[options.package])[0] else: package = options.package - - + # Directories packages are located in root = os.path.expanduser(PKGROOT) cwd = os.path.join(root, package) + # Checkout package to ensure the checkout reflects the latest changes try: subprocess.check_call(['mgarepo', 'co', package], cwd=root) except subprocess.CalledProcessError: sys.exit(1) + + # SpecFile class handles the actual version+release change s = SpecFile(os.path.join(cwd, "SPECS", "%s.spec" % package)) print "%s => %s" % (s.version, options.version) if not s.update(options.version): sys.exit(1) + # We can even checkin and submit :-) if options.submit: try: # checkin changes - subprocess.check_call(['mgarepo', 'ci', '-m', 'new version'], cwd=cwd) + subprocess.check_call(['mgarepo', 'ci', '-m', 'new version %s' % options.version], cwd=cwd) # and submit subprocess.check_call(['mgarepo', 'submit'], cwd=cwd) except subprocess.CalledProcessError: