[OE-core] [PATCH] dpkg-deb: strip virtual/ package prefix in control files

Joe MacDonald joe_macdonald at mentor.com
Wed Jul 6 13:45:17 UTC 2016


If a recipe provides a 'virtual/foo', dpkg-deb will fail as '/' characters
are not allowed in any of the Depends, Recommends, Suggests, etc. fields.
The intent of these in the Debian package system and the few cases where
they are used in Yocto layers seems like throwing away the 'virtual/'
prefix preserves the intent, while not requiring it to be removed for
package systems that allow it (eg. opkg and rpm).

Signed-off-by: Joe MacDonald <joe_macdonald at mentor.com>
---
 meta/classes/package_deb.bbclass | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 8f9b09a..1e8afa1 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -253,17 +253,17 @@ python do_package_deb () {
         rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
         debian_cmp_remap(rconflicts)
         if rdepends:
-            ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
+            ctrlfile.write("Depends: %s\n" % re.sub(r'virtual/', '', bb.utils.join_deps(rdepends)))
         if rsuggests:
-            ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests))
+            ctrlfile.write("Suggests: %s\n" % re.sub(r'virtual/', '', bb.utils.join_deps(rsuggests)))
         if rrecommends:
-            ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends))
+            ctrlfile.write("Recommends: %s\n" % re.sub(r'virtual/', '', bb.utils.join_deps(rrecommends)))
         if rprovides:
-            ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides))
+            ctrlfile.write("Provides: %s\n" % re.sub(r'virtual/', '', bb.utils.join_deps(rprovides)))
         if rreplaces:
-            ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
+            ctrlfile.write("Replaces: %s\n" % re.sub(r'virtual/', '', bb.utils.join_deps(rreplaces)))
         if rconflicts:
-            ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
+            ctrlfile.write("Conflicts: %s\n" % re.sub(r'virtual/', '', bb.utils.join_deps(rconflicts)))
         ctrlfile.close()
 
         for script in ["preinst", "postinst", "prerm", "postrm"]:
-- 
1.9.1




More information about the Openembedded-core mailing list