1 |
Author: zmedico |
2 |
Date: 2010-02-18 08:13:29 +0000 (Thu, 18 Feb 2010) |
3 |
New Revision: 15365 |
4 |
|
5 |
Modified: |
6 |
main/trunk/bin/dispatch-conf |
7 |
Log: |
8 |
Bug #305393 - Handle new sdiff exit status for diffutils-2.9. |
9 |
|
10 |
|
11 |
Modified: main/trunk/bin/dispatch-conf |
12 |
=================================================================== |
13 |
--- main/trunk/bin/dispatch-conf 2010-02-18 07:07:41 UTC (rev 15364) |
14 |
+++ main/trunk/bin/dispatch-conf 2010-02-18 08:13:29 UTC (rev 15365) |
15 |
@@ -42,6 +42,7 @@ |
16 |
DIFF_CONTENTS = "diff -Nu '%s' '%s'" |
17 |
DIFF_CVS_INTERP = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '# .Header:.*'" |
18 |
DIFF_WSCOMMENTS = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][:space:]*$'" |
19 |
+diffutils_2_9 = False |
20 |
|
21 |
# We need a secure scratch dir and python does silly verbose errors on the use of tempnam |
22 |
oldmask = os.umask(0o077) |
23 |
@@ -117,6 +118,17 @@ |
24 |
"use-rcs=yes in config; fatal', file=sys.stderr) |
25 |
return False |
26 |
|
27 |
+ merge_cmd = self.options.get("merge", "").split() |
28 |
+ global diffutils_2_9 |
29 |
+ if merge_cmd and merge_cmd[0] == 'sdiff': |
30 |
+ vardb = portage.db['/']['vartree'].dbapi |
31 |
+ diffutils = vardb.match('sys-apps/diffutils') |
32 |
+ if diffutils: |
33 |
+ diffutils = diffutils[0] |
34 |
+ diffutils_split = portage.catpkgsplit(diffutils)[1:] |
35 |
+ if portage.vercmp(diffutils_split, |
36 |
+ portage.pkgsplit('diffutils-2.9')) >= 0: |
37 |
+ diffutils_2_9 = True |
38 |
|
39 |
# config file freezing support |
40 |
frozen_files = set(self.options.get("frozen-files", "").split()) |
41 |
@@ -267,6 +279,10 @@ |
42 |
merged = SCRATCH_DIR+"/"+os.path.basename(conf['current']) |
43 |
print() |
44 |
ret = os.system (self.options['merge'] % (merged, conf ['current'], newconf)) |
45 |
+ ret = os.WEXITSTATUS(ret) |
46 |
+ if diffutils_2_9: |
47 |
+ if ret < 2: |
48 |
+ ret = 0 |
49 |
if ret: |
50 |
print("Failure running 'merge' command") |
51 |
continue |