summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-18 08:13:29 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-18 08:13:29 +0000
commit1e0b48d2114a402113629e7f2c86cc109091f33f (patch)
tree8d3c66fe04e8e0c5a9d663355740cb619394451e
parent744b5b12943ba4dbe27a694250c8a5d390b6e5bc (diff)
downloadportage-1e0b48d2114a402113629e7f2c86cc109091f33f.tar.gz
portage-1e0b48d2114a402113629e7f2c86cc109091f33f.tar.bz2
portage-1e0b48d2114a402113629e7f2c86cc109091f33f.zip
Bug #305393 - Handle new sdiff exit status for diffutils-2.9.
svn path=/main/trunk/; revision=15365
-rwxr-xr-xbin/dispatch-conf16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index fa8ca9200..776ce5dd8 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -42,6 +42,7 @@ FIND_EXTANT_CONFIGS = "find '%s' %s -name '._cfg????_%s' ! -name '.*~' ! -iname
DIFF_CONTENTS = "diff -Nu '%s' '%s'"
DIFF_CVS_INTERP = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '# .Header:.*'"
DIFF_WSCOMMENTS = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][:space:]*$'"
+diffutils_2_9 = False
# We need a secure scratch dir and python does silly verbose errors on the use of tempnam
oldmask = os.umask(0o077)
@@ -117,6 +118,17 @@ class dispatch:
"use-rcs=yes in config; fatal', file=sys.stderr)
return False
+ merge_cmd = self.options.get("merge", "").split()
+ global diffutils_2_9
+ if merge_cmd and merge_cmd[0] == 'sdiff':
+ vardb = portage.db['/']['vartree'].dbapi
+ diffutils = vardb.match('sys-apps/diffutils')
+ if diffutils:
+ diffutils = diffutils[0]
+ diffutils_split = portage.catpkgsplit(diffutils)[1:]
+ if portage.vercmp(diffutils_split,
+ portage.pkgsplit('diffutils-2.9')) >= 0:
+ diffutils_2_9 = True
# config file freezing support
frozen_files = set(self.options.get("frozen-files", "").split())
@@ -267,6 +279,10 @@ class dispatch:
merged = SCRATCH_DIR+"/"+os.path.basename(conf['current'])
print()
ret = os.system (self.options['merge'] % (merged, conf ['current'], newconf))
+ ret = os.WEXITSTATUS(ret)
+ if diffutils_2_9:
+ if ret < 2:
+ ret = 0
if ret:
print("Failure running 'merge' command")
continue