summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-13 13:35:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-13 17:41:10 +0100
commit1b8e4abd2d9c0901d38d89d0f944fe1ffd019379 (patch)
tree6496021c4cbb3026f3af4b149a9f5ff58e89fc4a /meta/classes
parent4246e7dd59800a1d6c6d02c00f4e86eeac020767 (diff)
downloadopenembedded-core-1b8e4abd2d9c0901d38d89d0f944fe1ffd019379.tar.gz
openembedded-core-1b8e4abd2d9c0901d38d89d0f944fe1ffd019379.tar.bz2
openembedded-core-1b8e4abd2d9c0901d38d89d0f944fe1ffd019379.zip
bitbake.conf/package: Collapse PKGDATA_DIR into a single machine specific directory
Currently we have a hierarchy of pkgdata directories and the code has to put together a search path and look through each in turn until it finds the data it needs. This has lead to a number of hardcoded paths and file globing which is unpredictable and undesirable. Worse, certain tricks that should be easy like a GL specific package architecture become problematic with the curretn search paths. With the modern sstate code, we can do better and construct a single pkgdata directory for each machine in just the same way as we do for the sysroot. This is already tried and well tested. With such a single directory, all the code that iterated through multiple pkgdata directories and simply be removed and give a significant simplification of the code. Even existing build directories adapt to the change well since the package contents doesn't change, just the location they're installed to and the stamp for them. The only complication is the we need a different shlibs directory for each multilib. These are only used by package.bbclass and the simple fix is to add MLPREFIX to the shlib directory name. This means the multilib packages will repackage and the sstate checksum will change but an existing build directory will adapt to the changes safely. It is close to release however I believe the benefits this patch give us are worth consideration for inclusion and give us more options for dealing with problems like the GL one. It also sets the ground work well for shlibs improvements in 1.6. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/allarch.bbclass4
-rw-r--r--meta/classes/buildhistory.bbclass2
-rw-r--r--meta/classes/cross-canadian.bbclass5
-rw-r--r--meta/classes/image.bbclass2
-rw-r--r--meta/classes/license.bbclass3
-rw-r--r--meta/classes/multilib.bbclass1
-rw-r--r--meta/classes/package.bbclass14
-rw-r--r--meta/classes/package_rpm.bbclass2
-rw-r--r--meta/classes/packageinfo.bbclass35
9 files changed, 25 insertions, 43 deletions
diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
index 8669470e60..5e13a5b8a8 100644
--- a/meta/classes/allarch.bbclass
+++ b/meta/classes/allarch.bbclass
@@ -2,6 +2,10 @@
# This class is used for architecture independent recipes/data files (usally scripts)
#
+# Expand STAGING_DIR_HOST since for cross-canadian/native/nativesdk, this will
+# point elsewhere after these changes.
+STAGING_DIR_HOST := "${STAGING_DIR_HOST}"
+
PACKAGE_ARCH = "all"
python () {
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 080f2c79b3..3da03c8485 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -340,7 +340,7 @@ buildhistory_get_installed() {
cat $pkgcache | while read pkg pkgfile pkgarch
do
for vendor in ${TARGET_VENDOR} ${MULTILIB_VENDORS} ; do
- size=`oe-pkgdata-util read-value ${TMPDIR}/pkgdata $vendor-${TARGET_OS} "PKGSIZE" ${pkg}_${pkgarch}`
+ size=`oe-pkgdata-util read-value ${PKGDATA_DIR} "PKGSIZE" ${pkg}_${pkgarch}`
if [ "$size" != "" ] ; then
echo "$size $pkg" >> $1/installed-package-sizes.tmp
fi
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index 87dd9948e7..c22be1a030 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -31,7 +31,6 @@ STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${
TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}"
-PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/"
HOST_ARCH = "${SDK_ARCH}"
@@ -89,10 +88,6 @@ FILES_${PN}-dbg += "${prefix}/.debug \
export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
-# Cross-canadian packages need to pull in nativesdk dynamic libs
-SHLIBSDIRS = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/ ${TMPDIR}/pkgdata/all-${HOST_VENDOR}-${HOST_OS}/shlibs/"
-SHLIBSDIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/shlibs/"
-
do_populate_sysroot[stamp-extra-info] = ""
USE_NLS = "${SDKUSE_NLS}"
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index f1e62f1454..889547a441 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -484,7 +484,7 @@ rootfs_install_complementary() {
# Use the magic script to do all the work for us :)
: > ${WORKDIR}/complementary_pkgs.txt
for vendor in '${TARGET_VENDOR}' ${MULTILIB_VENDORS} ; do
- oe-pkgdata-util glob ${TMPDIR}/pkgdata $vendor-${TARGET_OS} ${WORKDIR}/installed_pkgs.txt "$GLOBS" >> ${WORKDIR}/complementary_pkgs.txt
+ oe-pkgdata-util glob ${PKGDATA_DIR} ${WORKDIR}/installed_pkgs.txt "$GLOBS" >> ${WORKDIR}/complementary_pkgs.txt
done
# Install the packages, if any
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 621c1b2f55..0160313e2e 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -28,8 +28,7 @@ license_create_manifest() {
fi
touch ${LICENSE_MANIFEST}
for pkg in ${INSTALLED_PKGS}; do
- # not the best way to do this but licenses are not arch dependant iirc
- filename=`ls ${TMPDIR}/pkgdata/*/runtime-reverse/${pkg}| head -1`
+ filename=`ls ${PKGDATA_DIR}/runtime-reverse/${pkg}| head -1`
pkged_pn="$(sed -n 's/^PN: //p' ${filename})"
# check to see if the package name exists in the manifest. if so, bail.
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index dac160e17e..9503096245 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -47,7 +47,6 @@ python multilib_virtclass_handler () {
e.data.setVar("MLPREFIX", variant + "-")
e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
- e.data.setVar("SHLIBSDIR_virtclass-multilib-" + variant ,e.data.getVar("SHLIBSDIR", False) + "/" + variant)
e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
# Expand the WHITELISTs with multilib prefix
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 599df246f0..fbb68391b9 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1304,17 +1304,8 @@ python package_do_filedeps() {
d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg]))
}
-def getshlibsdirs(d):
- dirs = []
- triplets = (d.getVar("PKGTRIPLETS") or "").split()
- for t in triplets:
- dirs.append("${TMPDIR}/pkgdata/" + t + "/shlibs/")
- return " ".join(dirs)
-getshlibsdirs[vardepsexclude] = "PKGTRIPLETS"
-
-SHLIBSDIRS = "${@getshlibsdirs(d)}"
-SHLIBSDIR = "${TMPDIR}/pkgdata/${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/shlibs"
-SHLIBSWORKDIR = "${PKGDESTWORK}/shlibs"
+SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs"
+SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs"
python package_do_shlibs() {
import re, pipes
@@ -1953,6 +1944,7 @@ do_packagedata[sstate-name] = "packagedata"
do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
do_packagedata[sstate-lockfile-shared] = "${PACKAGELOCK}"
+do_packagedata[stamp-extra-info] = "${MACHINE}"
python do_packagedata_setscene () {
sstate_setscene(d)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 2a7e1642f8..fd861e980d 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -109,7 +109,7 @@ translate_smart_to_oe() {
fi
# Workaround for bug 3565
# Simply look to see if we know of a package with that name, if not try again!
- filename=`ls ${TMPDIR}/pkgdata/*/runtime-reverse/$new_pkg 2>/dev/null | head -n 1`
+ filename=`ls ${PKGDATA_DIR}/runtime-reverse/$new_pkg 2>/dev/null | head -n 1`
if [ -n "$filename" ] ; then
found=1
break
diff --git a/meta/classes/packageinfo.bbclass b/meta/classes/packageinfo.bbclass
index 42fcd04150..7d60ace1dc 100644
--- a/meta/classes/packageinfo.bbclass
+++ b/meta/classes/packageinfo.bbclass
@@ -1,27 +1,20 @@
python packageinfo_handler () {
import oe.packagedata
pkginfolist = []
- tmpdir = e.data.getVar('TMPDIR', True)
- target_vendor = e.data.getVar('TARGET_VENDOR', True)
- target_os = e.data.getVar('TARGET_OS', True)
- package_archs = e.data.getVar('PACKAGE_ARCHS', True)
- packaging = e.data.getVar('PACKAGE_CLASSES', True).split()[0].split('_')[1]
- deploy_dir = e.data.getVar('DEPLOY_DIR', True) + '/' + packaging
-
- for arch in package_archs.split():
- pkgdata_dir = tmpdir + '/pkgdata/' + arch + target_vendor + '-' + target_os + '/runtime/'
- if os.path.exists(pkgdata_dir):
- for root, dirs, files in os.walk(pkgdata_dir):
- for pkgname in files:
- if pkgname.endswith('.packaged'):
- pkgname = pkgname[:-9]
- pkgdatafile = root + pkgname
- try:
- sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
- sdata['PKG'] = pkgname
- pkginfolist.append(sdata)
- except Exception as e:
- bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
+
+ pkgdata_dir = e.data.getVar("PKGDATA_DIR", True) + '/runtime/'
+ if os.path.exists(pkgdata_dir):
+ for root, dirs, files in os.walk(pkgdata_dir):
+ for pkgname in files:
+ if pkgname.endswith('.packaged'):
+ pkgname = pkgname[:-9]
+ pkgdatafile = root + pkgname
+ try:
+ sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
+ sdata['PKG'] = pkgname
+ pkginfolist.append(sdata)
+ except Exception as e:
+ bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
}