[oe] [Bug 4549] A number of xorg dev packages are uninstallable

Tom Rini trini at kernel.crashing.org
Tue Sep 16 00:21:27 UTC 2008


On Mon, Sep 15, 2008 at 10:04:30AM +0100, Phil Blundell wrote:
> On Sun, 2008-09-14 at 16:59 -0700, Tom Rini wrote:
> > So, there's three ways to fix this:
> > - Fix these recipes to have RDEPENDS_${PN}-dev = ""
> > - Fix these recipes to build empty main packages.
> > - Fix package.bbclass to do the 1st option, automatically (not put the
> >   dependency in to start with).
> > 
> > How do we get going ahead with one of these?  I could take a stab at the
> > 3rd option, with some hints.
> 
> For #3, I would start by looking at populate_packages().  This is where
> the files get moved into the individual packages, and is the first point
> at which you get to find out whether any given package is going to be
> empty or not.  As luck would have it this method also contains some
> existing code to bash RDEPENDS around, which you should be able to
> extend and adapt for your own purposes.
[snip]

OK.  I'm not a big python guy, but the following has been tested with
both xproto (no main) and zeroconf (has a main) and the control file
looked correct in both cases.  I've also rebuilt glibc and poked a few
packages.

Signed-off-by: Tom Rini <trini at embeddedalley.com>

#
# old_revision [4ac14ced8bc6330634ea2b24a201a4f6a556ef24]
#
# patch "classes/package.bbclass"
#  from [6f3deeb912b24b09204110bd00e94e30f64d3936]
#    to [8919fc454501458d13509de4a3a62fad8c68ceac]
#
============================================================
--- classes/package.bbclass	6f3deeb912b24b09204110bd00e94e30f64d3936
+++ classes/package.bbclass	8919fc454501458d13509de4a3a62fad8c68ceac
@@ -351,6 +351,8 @@ python populate_packages () {
 	os.system('rm -rf %s' % pkgdest)
 
 	seen = []
+	main_is_empty = 1
+	main_pkg = bb.data.expand("${PN}" , d)
 
 	for pkg in package_list:
 		localdata = bb.data.createCopy(d)
@@ -395,6 +397,8 @@ python populate_packages () {
 			ret = bb.copyfile(file, fpath)
 			if ret is False or ret == 0:
 				raise bb.build.FuncFailed("File population failed")
+			if pkg == main_pkg and main_is_empty:
+				main_is_empty = 0
 		del localdata
 	os.chdir(workdir)
 
@@ -440,6 +444,11 @@ python populate_packages () {
 
 	for pkg in package_list:
 		rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "")
+
+		if main_is_empty:
+			for rdep in rdepends:
+				if rdep.find(main_pkg + " ") != -1:
+					rdepends.remove(rdep)
 		for l in dangling_links[pkg]:
 			found = False
 			bb.debug(1, "%s contains dangling link %s" % (pkg, l))

-- 
Tom Rini




More information about the Openembedded-devel mailing list