Skip to contentSkip to conversation

package_ipk.bbclass: Fix SRC_URI whitespace handling

PATCH New Mark Hatle 1 participant 1 message Oct 6, 2014

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 package_ipk.bbclass: Fix SRC_URI whitespace handling

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

---
 meta/classes/package_ipk.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/package_ipk.bbclass +1 -1
index 9586e06..44fd3eb 100644
@@ -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()))
Signature · 1 line
1.9.3