diff options
author | Olav Vitters <olav@vitters.nl> | 2017-02-06 20:02:43 +0100 |
---|---|---|
committer | Olav Vitters <olav@vitters.nl> | 2017-02-06 20:02:43 +0100 |
commit | 5d030258b71c4c47d10259bf1e9daaad76076812 (patch) | |
tree | 207fb48237ea2d69608683d2e5cdf2575c356309 | |
parent | 82725ef6d5b1cc5127b33b522211fc35d30893ee (diff) | |
download | mgagnome-5d030258b71c4c47d10259bf1e9daaad76076812.tar mgagnome-5d030258b71c4c47d10259bf1e9daaad76076812.tar.gz mgagnome-5d030258b71c4c47d10259bf1e9daaad76076812.tar.bz2 mgagnome-5d030258b71c4c47d10259bf1e9daaad76076812.tar.xz mgagnome-5d030258b71c4c47d10259bf1e9daaad76076812.zip |
automatically undo changes incase ftp-release-list triggered updates fail to apply
-rwxr-xr-x | mgagnome | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -647,7 +647,9 @@ class SpecFile(object): # try again patches = self.patches continue - sys.exit(1) + + print("ERROR: Problem removing merged patch: %s" % failed_patch, file=sys.stderr) + return False if cmd and len(cmd_output) > LOGLINES: print('+ %s' % cmd, file=sys.stdout) @@ -1495,13 +1497,22 @@ def cmd_package_new_version(options, parser): try: Downstream.co(package, cwd=root) except subprocess.CalledProcessError: + subprocess.call(['svn', 'revert', '-R', cwd], cwd=cwd) sys.exit(1) # SpecFile class handles the actual version+release change # XXX - module should reflect upstream name, this gives it the package name s = SpecFile(os.path.join(cwd, "SPECS", "%s.spec" % package), module=package) print("%s => %s" % (s.version, options.version)) + + # XXX - Duplicate check as should not revert changes if specfile has already been changed + if not s.ensure_no_local_changes(options.force): + sys.exit(1) + if not s.update(options.version, force=options.force): + # XXX - hack to automatically revert changes when auto upgrading from ftp release list + if options.hexdigest is not None: + subprocess.call(['svn', 'revert', '-R', cwd], cwd=cwd, stdout=subprocess.DEVNULL) sys.exit(1) # Check hash, if given |