Skip to contentSkip to conversation

opencv: Fix broken deps for opencv meta package

PATCH In review Jacob Stiffler 2 participants 4 messages May 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opencv: Fix broken deps for opencv meta package

* The opencv meta package's RDEPENDS list is blindly populated with all non *-dev, *-dbg, and *-doc packages

* This includes the non-existent opencv-locale package which is added to the list by default in oe-core/meta/conf/bitbake.conf
* This issue was hidden as late as jethro as the distutils class was overwriting the PACKAGES list
* Therefore add opencv-locale to the opencv meta package blacklist, and filter out all packages which contain "locale" in the package name to be safe.

* Another issue with the meta package dependency generation logic is that it may add other empty, non-existent packages.
* The existence of the opencv-java package depends on the PACKAGECONFIG, though it is added as a meta package dependency in all cases.
* Therefore check the contents of PKGDEST to only add non-empty packages as RDEPENDS for the opencv meta package.

---
 meta-oe/recipes-support/opencv/opencv_3.1.bb | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
meta-oe/recipes-support/opencv/opencv_3.1.bb +14 -4
index c1f9802..f168550 100644
@@ -101,11 +101,22 @@ python populate_packages_prepend () {
     d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))
 
     metapkg =  pn
-    blacklist = [ metapkg ]
+    blacklist = [ metapkg, pn + '-locale' ]
     metapkg_rdepends = [ ]
+    pkgdest = d.getVar('PKGDEST', True)
     for pkg in packages[1:]:
-        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') :
-            metapkg_rdepends.append(pkg)
+        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.count('local') :
+            # See if the package is empty by looking at the contents of its PKGDEST subdirectory.
+            # If this subdirectory is empty, then the package is.
+            # Empty packages do not get added to the meta package's RDEPENDS
+            pkgdir = os.path.join(pkgdest, pkg)
+            if os.path.exists(pkgdir):
+                dir_contents = os.listdir(pkgdir) or []
+            else:
+                dir_contents = []
+            is_empty = len(dir_contents) == 0
+            if not is_empty:
+                metapkg_rdepends.append(pkg)
     bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d)
 
 }
@@ -145,4 +156,3 @@ do_install_append() {
     install -d ${D}${datadir}/OpenCV/samples/bin/
     cp -f bin/*-tutorial-* bin/*-example-* ${D}${datadir}/OpenCV/samples/bin/
 }
-
Signature · 1 line
2.7.4
#1 lore raw
Quoted 11 lines · Jacob Stiffler

* The opencv meta package's RDEPENDS list is blindly populated with all non *-dev, *-dbg, and *-doc packages

* This includes the non-existent opencv-locale package which is added to the list by default in oe-core/meta/conf/bitbake.conf
* This issue was hidden as late as jethro as the distutils class was overwriting the PACKAGES list
* Therefore add opencv-locale to the opencv meta package blacklist, and filter out all packages which contain "locale" in the package name to be safe.

Quoted 8 lines

* Another issue with the meta package dependency generation logic is that it may add other empty, non-existent packages.
* The existence of the opencv-java package depends on the PACKAGECONFIG, though it is added as a meta package dependency in all cases.
* Therefore check the contents of PKGDEST to only add non-empty packages as RDEPENDS for the opencv meta package.

do_split_packages() returns the list of packages that it created, so the output from the final call to do_split_packages (that creates lib%s) should be exactly what you need to create a metapackage.

(it currently returns duplicates if multiple files are packages, but this doesn't cause a problem for metapackage dependencies)

Ross

#2 lore raw
Quoted 3 lines · Ross

(it currently returns duplicates if multiple files are packages, but this doesn't cause a problem for metapackage dependencies)

Update: krogoth and earlier have this bug, oe-core master is already fixed.

Ross

#3 lore raw
In reply to Burton, Ross
Quoted 32 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Burton, Ross
Sent: Wednesday, May 04, 2016 3:35 PM
To: OpenEmbedded Devel List
Subject: Re: [oe] [PATCH] opencv: Fix broken deps for opencv meta package

Quoted 11 lines · Jacob Stiffler

* The opencv meta package's RDEPENDS list is blindly populated with all non *-dev, *-dbg, and *-doc packages

* This includes the non-existent opencv-locale package which is added to the list by default in oe-core/meta/conf/bitbake.conf
* This issue was hidden as late as jethro as the distutils class was overwriting the PACKAGES list
* Therefore add opencv-locale to the opencv meta package blacklist, and filter out all packages which contain "locale" in the package name to be safe.

Quoted 8 lines

* Another issue with the meta package dependency generation logic is that it may add other empty, non-existent packages.
* The existence of the opencv-java package depends on the PACKAGECONFIG, though it is added as a meta package dependency in all cases.
* Therefore check the contents of PKGDEST to only add non-empty packages as RDEPENDS for the opencv meta package.

Quoted 4 lines

do_split_packages() returns the list of packages that it created, so the output from the final call to do_split_packages (that creates lib%s) should be exactly what you need to create a metapackage.

The problem this patch is resolving does not involve do_split_packages.

The problem is that the PACKAGES list and the packages created are different since empty packages will not be created by default. For opencv, the PACKAGES list is initialized with non-existent packages such as opencv-locale. The logic which constructs the meta package dependencies will add the non-existent opencv-locale package. Adding non-existent packages to the RDEPENDS means that the meta package has broken dependencies.

Quoted 9 lines

(it currently returns duplicates if multiple files are packages, but this doesn't cause a problem for metapackage dependencies)

Ross
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel