package_deb: Dependencies with a ( or ) in them are invalid in debs
authorMark Hatle <mark.hatle@windriver.com>
Fri, 30 Nov 2012 02:53:29 +0000 (20:53 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Dec 2012 12:31:07 +0000 (12:31 +0000)
Replace ( or ) with __.  This allows RPM style dependencies to be satisfied
in deb style packages.

(From OE-Core rev: 12acb6bb00ba665571fcfbdb0ef4668ca0a98d5b)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package_deb.bbclass

index d273cb0..eed9b8a 100644 (file)
@@ -335,12 +335,22 @@ python do_package_deb () {
         mapping_rename_hook(localdata)
 
         def debian_cmp_remap(var):
+            # dpkg does not allow for '(' or ')' in a dependency name
+            # replace these instances with '__' and '__'
+            #
             # In debian '>' and '<' do not mean what it appears they mean
             #   '<' = less or equal
             #   '>' = greater or equal
             # adjust these to the '<<' and '>>' equivalents
             #
             for dep in var:
+                if '(' in dep:
+                    newdep = dep.replace('(', '__')
+                    newdep = newdep.replace(')', '__')
+                    if newdep != dep:
+                        var[newdep] = var[dep]
+                        del var[dep]
+            for dep in var:
                 for i, v in enumerate(var[dep]):
                     if (v or "").startswith("< "):
                         var[dep][i] = var[dep][i].replace("< ", "<< ")