aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2019-01-19 17:48:36 -0800
committerDavid Reyna <David.Reyna@windriver.com>2019-01-19 17:48:36 -0800
commitbcd8a2da140eb2ac2c189f27950d7f4d8d30e69b (patch)
tree0877718344adce5946619b4625b0328db0b1cc75
parent54384c586752584ddc5d85693e60e87594c8ce6f (diff)
downloadsrtool-bcd8a2da140eb2ac2c189f27950d7f4d8d30e69b.tar.gz
srtool-bcd8a2da140eb2ac2c189f27950d7f4d8d30e69b.tar.bz2
srtool-bcd8a2da140eb2ac2c189f27950d7f4d8d30e69b.zip
srtool_patcher: fix in-line change handling in public area
Only capture the custom sections in the in-line patch file, so that changes to the public areas are kept to the original file. This allows the user to push those public differences or remove them, and not affect the application of the custom patch file. Signed-off-by: David Reyna <David.Reyna@windriver.com>
-rwxr-xr-xbin/common/srtool_patcher.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/bin/common/srtool_patcher.py b/bin/common/srtool_patcher.py
index 17032750..86c74fb0 100755
--- a/bin/common/srtool_patcher.py
+++ b/bin/common/srtool_patcher.py
@@ -166,15 +166,9 @@ def extract_custom_patch(custom_file,clean_file,patch_file,label,patcher_dir,opt
if state != "LOOKING":
print("ERROR: START not STOPPED (%s)" % state)
- if INPLACE_TAG in options:
- cmd = "git diff %s > %s" % (custom_file,patch_file)
- print(cmd)
- os.system(cmd)
- print("In-place File: %s" % (clean_file))
- else:
- os.system("diff -u %s %s > %s" % (clean_file,custom_file,patch_file))
- print("Custom File: %s" % (custom_file))
- print("Clean File: %s" % (clean_file))
+ os.system("diff -u %s %s > %s" % (clean_file,custom_file,patch_file))
+ print("Custom File: %s" % (custom_file))
+ print("Clean File: %s" % (clean_file))
print("Patch File: %s" % (patch_file))
return(ret,clean_file,patch_file)
@@ -282,7 +276,7 @@ def clean_inplace(custom_file,original_file,patch_file,label,patcher_dir,options
print(cmd)
os.system(cmd)
- print("* Extract patch file (via 'git diff')")
+ print("* Extract patch file")
clean_file = custom_file + '.clean'
patch_file = custom_file + '.patch'
ret,clean_file,patch_file = extract_custom_patch(original_file,clean_file,patch_file,label,'',options)