]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_ipk.bbclass: Fix SRC_URI whitespace handling
authorMark Hatle <mark.hatle@windriver.com>
Mon, 6 Oct 2014 14:05:08 +0000 (09:05 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 6 Oct 2014 15:03:03 +0000 (16:03 +0100)
The SRC_URI may contain whitespace, but be otherwise empty.  This can happen
in the case:

MYSRC = ""
MYSRC_arm = "file://myarm.patch"
SRC_URI += "${MYSRC}"

Unless we strip blank spaces, to determine if it is empty, we can end up
generating a "Source: " line which in invalid.  This leads to the error:

  invalid Source: field is speified in the generated CONTROL file

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package_ipk.bbclass

index 9586e06b2e0d07840d2f92766fbdfbffc6a82899..44fd3eb29c8a92354e3bd3c7ba14ebc212435578 100644 (file)
@@ -207,7 +207,7 @@ python do_package_ipk () {
             ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
         if rconflicts:
             ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
-        src_uri = localdata.getVar("SRC_URI", True) or "None"
+        src_uri = localdata.getVar("SRC_URI", True).strip() or "None"
         if src_uri:
             src_uri = re.sub("\s+", " ", src_uri)
             ctrlfile.write("Source: %s\n" % " ".join(src_uri.split()))