Lines 42-47
Link Here
|
42 |
DIFF_CONTENTS = "diff -Nu '%s' '%s'" |
42 |
DIFF_CONTENTS = "diff -Nu '%s' '%s'" |
43 |
DIFF_CVS_INTERP = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '# .Header:.*'" |
43 |
DIFF_CVS_INTERP = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '# .Header:.*'" |
44 |
DIFF_WSCOMMENTS = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][:space:]*$'" |
44 |
DIFF_WSCOMMENTS = "diff -Nu '%s' '%s' | grep '^[+-][^+-]' | grep -v '^[-+]#' | grep -v '^[-+][:space:]*$'" |
|
|
45 |
diffutils_2_9 = False |
45 |
|
46 |
|
46 |
# We need a secure scratch dir and python does silly verbose errors on the use of tempnam |
47 |
# We need a secure scratch dir and python does silly verbose errors on the use of tempnam |
47 |
oldmask = os.umask(0o077) |
48 |
oldmask = os.umask(0o077) |
Lines 117-122
Link Here
|
117 |
"use-rcs=yes in config; fatal', file=sys.stderr) |
118 |
"use-rcs=yes in config; fatal', file=sys.stderr) |
118 |
return False |
119 |
return False |
119 |
|
120 |
|
|
|
121 |
merge_cmd = self.options.get("merge", "").split() |
122 |
global diffutils_2_9 |
123 |
if merge_cmd and merge_cmd[0] == 'sdiff': |
124 |
vardb = portage.db['/']['vartree'].dbapi |
125 |
diffutils = vardb.match('sys-apps/diffutils') |
126 |
if diffutils: |
127 |
diffutils = diffutils[0] |
128 |
diffutils_ver = '-'.join(portage.catpkgsplit(diffutils)[2:]) |
129 |
if portage.vercmp(diffutils_ver, '2.9') >= 0: |
130 |
diffutils_2_9 = True |
120 |
|
131 |
|
121 |
# config file freezing support |
132 |
# config file freezing support |
122 |
frozen_files = set(self.options.get("frozen-files", "").split()) |
133 |
frozen_files = set(self.options.get("frozen-files", "").split()) |
Lines 267-272
Link Here
|
267 |
merged = SCRATCH_DIR+"/"+os.path.basename(conf['current']) |
278 |
merged = SCRATCH_DIR+"/"+os.path.basename(conf['current']) |
268 |
print() |
279 |
print() |
269 |
ret = os.system (self.options['merge'] % (merged, conf ['current'], newconf)) |
280 |
ret = os.system (self.options['merge'] % (merged, conf ['current'], newconf)) |
|
|
281 |
ret = os.WEXITSTATUS(ret) |
282 |
if diffutils_2_9: |
283 |
if ret < 2: |
284 |
ret = 0 |
270 |
if ret: |
285 |
if ret: |
271 |
print("Failure running 'merge' command") |
286 |
print("Failure running 'merge' command") |
272 |
continue |
287 |
continue |