[oe-commits] [openembedded-core] 84/122: lib/oe/recipeutils: fix line splitting in patch_recipe_*

git at git.openembedded.org git at git.openembedded.org
Mon Dec 4 17:26:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch rocko
in repository openembedded-core.

commit dbf68220e451a43830fe680c86b34b9bd127cad3
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Wed Nov 1 13:49:44 2017 +1300

    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.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Armin Kuster <akuster at mvista.com>
---
 meta/lib/oe/recipeutils.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 2f818bc..cab8e40 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):
             for wrapline in wrapped[:-1]:
                 addlines.append('%s \\%s' % (wrapline, newline))
             addlines.append('%s%s' % (wrapped[-1], newline))
+
+        # Split on newlines - this isn't strictly necessary if you are only
+        # going to write the output to disk, but if you want to compare it
+        # (as patch_recipe_file() will do if patch=True) then it's important.
+        addlines = [line for l in addlines for line in l.splitlines(True)]
         if rewindcomments:
             # Ensure we insert the lines before any leading comments
             # (that we'd want to ensure remain leading the next value)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list