Patchwork [1/3] classes/rootfs_deb: use more reliable check for package existence

login
register
mail settings
Submitter Paul Eggleton
Date July 11, 2012, 1:04 p.m.
Message ID <2180f501590f39f8c84c553f158635c2526f099d.1342011575.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/31755/
State New
Headers show

Comments

Paul Eggleton - July 11, 2012, 1:04 p.m.
It turns out "apt-cache showpkg" does return some information when a
package does not exist but another package recommends it, which can
occur for empty *-dev packages; so use "apt-cache policy" with a

Patch

different line count instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/rootfs_deb.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 4ea71da..67871a9 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -111,7 +111,7 @@  list_package_recommends() {
 }
 
 rootfs_check_package_exists() {
-	if [ `apt-cache showpkg $1 | wc -l` -gt 2 ]; then
+	if [ `apt-cache policy $1 | wc -l` -gt 4 ]; then
 		echo $1
 	fi
 }