summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-11-01 13:49:44 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-04 17:23:58 +0000
commit216a839e1b5c655772d723bf37bd49a3ca277519 (patch)
tree1e3535ae4bb7982c2bddfd31a2151e28cd302d78 /meta
parentbd884dd998e0b6490237dc4c41db9e00d30bad34 (diff)
downloadpoky-216a839e1b5c655772d723bf37bd49a3ca277519.tar.gz
lib/oe/recipeutils: fix line splitting in patch_recipe_*
If a value was split over multiple lines (e.g. as SRC_URI usually is) then we were inserting the value as one item in the lines list with newlines between each line. There's nothing wrong with this if you're writing the list out to a file, but if you want to generate a patch (as patch_recipe_file() will do if the patch parameter is set to True) then the diff output looks a bit odd. Split the value before adding it to the lines list to resolve this. (From OE-Core rev: dbf68220e451a43830fe680c86b34b9bd127cad3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/recipeutils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 2f818bcbaa..cab8e40152 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -188,6 +188,11 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True):
188 for wrapline in wrapped[:-1]: 188 for wrapline in wrapped[:-1]:
189 addlines.append('%s \\%s' % (wrapline, newline)) 189 addlines.append('%s \\%s' % (wrapline, newline))
190 addlines.append('%s%s' % (wrapped[-1], newline)) 190 addlines.append('%s%s' % (wrapped[-1], newline))
191
192 # Split on newlines - this isn't strictly necessary if you are only
193 # going to write the output to disk, but if you want to compare it
194 # (as patch_recipe_file() will do if patch=True) then it's important.
195 addlines = [line for l in addlines for line in l.splitlines(True)]
191 if rewindcomments: 196 if rewindcomments:
192 # Ensure we insert the lines before any leading comments 197 # Ensure we insert the lines before any leading comments
193 # (that we'd want to ensure remain leading the next value) 198 # (that we'd want to ensure remain leading the next value)