From 3b019733d8f71d2de3f803347517206faf47cb2a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 6 Sep 2010 23:12:37 -0700 Subject: java-library.bbclass: do_stage is not needed anymore Signed-off-by: Khem Raj Signed-off-by: Robert Schuster --- classes/java-library.bbclass | 4 ---- 1 file changed, 4 deletions(-) (limited to 'classes') diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass index 904b4f16be..5ce0537dd5 100644 --- a/classes/java-library.bbclass +++ b/classes/java-library.bbclass @@ -65,7 +65,3 @@ do_install() { java_stage() { oe_jarinstall -s ${JARFILENAME} ${ALTJARFILENAMES} } - -do_stage() { - java_stage -} -- cgit 1.2.3-korg From 8cfa7531a02e1c8380508b3dbed653427bf04c36 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 9 Sep 2010 11:03:57 -0700 Subject: Per the TSC decision, make packaged-staging default For now, just ensures its inherited. In the future, we can merge / simplify staging.bbclass with packaged-staging.bbclass as appropriate. Signed-off-by: Chris Larson --- classes/base.bbclass | 1 + conf/distro/angstrom-2008.1.conf | 3 --- conf/distro/angstrom-2010.x.conf | 3 --- conf/distro/include/slugos.inc | 2 +- conf/distro/kaeilos-2010.conf | 3 --- conf/distro/kaeilos.conf | 3 --- conf/distro/minimal.conf | 6 ------ conf/distro/shr.conf | 6 ------ 8 files changed, 2 insertions(+), 25 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 299e875191..1ffbe01706 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -2,6 +2,7 @@ BB_DEFAULT_TASK ?= "build" inherit patch inherit staging +inherit packaged-staging inherit packagedata inherit mirrors diff --git a/conf/distro/angstrom-2008.1.conf b/conf/distro/angstrom-2008.1.conf index 8f66ae929b..ec4f21e864 100644 --- a/conf/distro/angstrom-2008.1.conf +++ b/conf/distro/angstrom-2008.1.conf @@ -20,9 +20,6 @@ DISTRO_PR = ".6" OLDEST_KERNEL ?= "2.6.16" -#build staging from packages -INHERIT += "packaged-staging" - require conf/distro/include/sane-srcdates.inc require conf/distro/include/sane-srcrevs.inc require conf/distro/include/angstrom-2008-preferred-versions.inc diff --git a/conf/distro/angstrom-2010.x.conf b/conf/distro/angstrom-2010.x.conf index 8260647517..b8724503e8 100644 --- a/conf/distro/angstrom-2010.x.conf +++ b/conf/distro/angstrom-2010.x.conf @@ -25,9 +25,6 @@ DISTRO_PR = ".7" OLDEST_KERNEL ?= "2.6.16" -#build staging from packages -INHERIT += "packaged-staging" - require conf/distro/include/sane-srcdates.inc require conf/distro/include/sane-srcrevs.inc require conf/distro/include/angstrom-2010-preferred-versions.inc diff --git a/conf/distro/include/slugos.inc b/conf/distro/include/slugos.inc index 430e85904d..4c509c6aef 100644 --- a/conf/distro/include/slugos.inc +++ b/conf/distro/include/slugos.inc @@ -53,7 +53,7 @@ USE_NLS_glib-2.0 = "yes" USE_NLS_glib-2.0-native = "yes" USE_NLS_gcc-cross = "no" -INHERIT += "package_ipk debian testlab packaged-staging siteinfo" +INHERIT += "package_ipk debian testlab siteinfo" # FULL_OPTIMIZATION # Optimization settings. Os works fine and is significantly better than O2. diff --git a/conf/distro/kaeilos-2010.conf b/conf/distro/kaeilos-2010.conf index 4828dce873..0101705dc7 100644 --- a/conf/distro/kaeilos-2010.conf +++ b/conf/distro/kaeilos-2010.conf @@ -18,9 +18,6 @@ DISTRO_PR = ".1" OLDEST_KERNEL ?= "2.6.28" -#build staging from packages -INHERIT += "packaged-staging" - require conf/distro/include/sane-srcdates.inc require conf/distro/include/sane-srcrevs.inc require conf/distro/include/kaeilos-2009-preferred-versions.inc diff --git a/conf/distro/kaeilos.conf b/conf/distro/kaeilos.conf index 78a69f110f..1287ea1dac 100644 --- a/conf/distro/kaeilos.conf +++ b/conf/distro/kaeilos.conf @@ -20,9 +20,6 @@ DISTRO_PR = ".5" OLDEST_KERNEL ?= "2.6.16" -#build staging from packages -INHERIT += "packaged-staging" - require conf/distro/include/sane-srcdates.inc require conf/distro/include/sane-srcrevs.inc require conf/distro/include/kaeilos-2009-preferred-versions.inc diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf index 2f3a8217a8..376ffdee02 100644 --- a/conf/distro/minimal.conf +++ b/conf/distro/minimal.conf @@ -45,12 +45,6 @@ DISTRO_FEATURES += ' ${@["", "thumb-interwork"][bb.data.getVar('THUMB_INTERWORK' # libfoo -> libfoo0-2 (etc) INHERIT += "debian" -############################################################################# -# STAGING AREA -############################################################################# -# Controlled by packaging system -INHERIT += "packaged-staging" - ############################################################################# # PACKAGING & FEEDS ############################################################################# diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf index 1191d8c88c..9dd1c3e30d 100644 --- a/conf/distro/shr.conf +++ b/conf/distro/shr.conf @@ -121,12 +121,6 @@ DISTRO_FEATURES += " tk " # libfoo -> libfoo0-2 (etc) INHERIT += "debian" -############################################################################# -# STAGING AREA -############################################################################# -# Controlled by packaging system -INHERIT += "packaged-staging" - ############################################################################# # PACKAGING & FEEDS ############################################################################# -- cgit 1.2.3-korg From 8cbafd29ff0ddc4f26af2d0d891f0eaa2bb19779 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 9 Sep 2010 11:46:18 -0700 Subject: insane.bbclass: run qa_staging before do_package_stage, rather than do_build Signed-off-by: Chris Larson --- classes/insane.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/insane.bbclass b/classes/insane.bbclass index b8743d1918..4696c25c1e 100644 --- a/classes/insane.bbclass +++ b/classes/insane.bbclass @@ -448,7 +448,7 @@ python do_package_qa () { # The Staging Func, to check all staging -addtask qa_staging after do_populate_sysroot before do_build +addtask qa_staging after do_populate_sysroot before do_package_stage python do_qa_staging() { bb.debug(2, "QA checking staging") -- cgit 1.2.3-korg From c11ebb74995012f3370a780123483d9c9a973719 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 9 Sep 2010 12:32:44 -0700 Subject: packaged-staging: use oe_run rather than os.system This ensures that the output of the stage manager is swallowed, rather than shown unnecessarily to the user. Signed-off-by: Chris Larson --- classes/packaged-staging.bbclass | 73 +++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 35 deletions(-) (limited to 'classes') diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index 85f08ee143..d251102f13 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -112,25 +112,26 @@ def pstage_set_pkgmanager(d): def pstage_cleanpackage(pkgname, d): - path = bb.data.getVar("PATH", d, 1) - pstage_set_pkgmanager(d) - list_cmd = bb.data.getVar("PSTAGE_LIST_CMD", d, True) - - bb.debug(2, "Checking if staging package installed") - lf = bb.utils.lockfile(bb.data.expand("${SYSROOT_LOCK}", d)) - ret = os.system("PATH=\"%s\" %s | grep %s" % (path, list_cmd, pkgname)) - if ret == 0: - bb.debug(1, "Uninstalling package from staging...") - removecmd = bb.data.getVar("PSTAGE_REMOVE_CMD", d, 1) - ret = os.system("PATH=\"%s\" %s %s" % (path, removecmd, pkgname)) - if ret != 0: - bb.note("Failure removing staging package") - else: - bb.debug(1, "Manually removing any installed files from staging...") - pstage_manualclean("sysroots", "STAGING_DIR", d) - pstage_manualclean("deploy", "DEPLOY_DIR", d) - - bb.utils.unlockfile(lf) + pstage_set_pkgmanager(d) + list_cmd = bb.data.getVar("PSTAGE_LIST_CMD", d, True) + + bb.debug(2, "Checking if staging package installed") + lf = bb.utils.lockfile(bb.data.expand("${SYSROOT_LOCK}", d)) + try: + oe_run(d, "%s | grep %s" % (list_cmd, pkgname)) + except RuntimeError: + bb.debug(1, "Manually removing any installed files from staging...") + pstage_manualclean("sysroots", "STAGING_DIR", d) + pstage_manualclean("deploy", "DEPLOY_DIR", d) + else: + bb.debug(1, "Uninstalling package from staging...") + removecmd = bb.data.getVar("PSTAGE_REMOVE_CMD", d, 1) + try: + oe_run(d, "%s %s" % (removecmd, pkgname)) + except RuntimeError: + bb.note("Failure removing staging package") + + bb.utils.unlockfile(lf) do_clean_prepend() { """ @@ -208,7 +209,6 @@ python packagestage_scenefunc () { staging_fetch(stagepkg, d) if os.path.exists(stagepkg): - path = bb.data.getVar("PATH", d, 1) pstage_set_pkgmanager(d) file = bb.data.getVar("FILE", d, True) bb.debug(2, "Packaged staging active for %s\n" % file) @@ -218,8 +218,9 @@ python packagestage_scenefunc () { # bb.mkdirhier(bb.data.expand("${WORKDIR}/tstage/${libdir_native}/opkg/info/ ", d)) cmd = bb.data.expand("${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -force-depends -o ${WORKDIR}/tstage install", d) - ret = os.system("PATH=\"%s\" %s %s" % (path, cmd, stagepkg)) - if ret != 0: + try: + oe_run(d, "%s %s" % (cmd, stagepkg)) + except RuntimeError: bb.fatal("Couldn't install the staging package to a temp directory") # @@ -234,14 +235,15 @@ python packagestage_scenefunc () { # Copy the stamp files into the main stamps directoy # cmd = bb.data.expand("cp -dpR ${WORKDIR}/tstage/stamps/* ${TMPDIR}/stamps/", d) - ret = os.system(cmd) - if ret != 0: + try: + ret = oe_run(d, cmd) + except RuntimeError: bb.utils.unlockfile(lf) bb.fatal("Couldn't copy the staging package stamp files") # # Iterate over the stamps seeing if they're valid. If we find any that - # are invalid or the task wasn't in the taskgraph, assume caution and + # are invalid or the task wasn't in the taskgraph, assume caution and # do a rebuild. # # FIXME - some tasks are safe to ignore in the task graph. e.g. package_write_* @@ -268,10 +270,12 @@ python packagestage_scenefunc () { if stageok: bb.note("Staging package found, using it for %s." % file) installcmd = bb.data.getVar("PSTAGE_INSTALL_CMD", d, 1) - ret = os.system("PATH=\"%s\" %s %s" % (path, installcmd, stagepkg)) - bb.utils.unlockfile(lf) - if ret != 0: + try: + ret = oe_run(d, "%s %s" % (installcmd, stagepkg)) + except RuntimeError: bb.note("Failure installing prestage package") + finally: + bb.utils.unlockfile(lf) bb.build.exec_func("staging_package_libtoolhack", d) @@ -350,7 +354,7 @@ staging_packager () { echo "Priority: Optional" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control echo "Maintainer: ${MAINTAINER}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control echo "Architecture: ${PSTAGE_PKGARCH}" >> ${PSTAGE_TMPDIR_STAGE}/CONTROL/control - + # Protect against empty SRC_URI srcuri="${SRC_URI}" if [ "$srcuri" == "" ]; then @@ -366,7 +370,7 @@ staging_packager () { sed -i -e s:${STAGING_DIR}:FIXMESTAGINGDIR:g $i echo $i | sed -e 's:${PSTAGE_TMPDIR_STAGE}/::' >> ${PSTAGE_TMPDIR_STAGE}/sysroots/fixmepath done - + ${PSTAGE_BUILD_CMD} ${PSTAGE_TMPDIR_STAGE} ${PSTAGE_DIR}/${PSTAGE_PKGPATH} } @@ -401,7 +405,7 @@ python staging_package_libtoolhack () { fixmefd.close() oe.path.remove(fixmefn) for file in fixmefiles: - os.system("sed -i -e s:FIXMESTAGINGDIR:%s:g %s" % (staging, tmpdir + '/' + file)) + oe_run(d, "sed -i -e s:FIXMESTAGINGDIR:%s:g %s" % (staging, tmpdir + '/' + file)) except IOError: pass } @@ -443,7 +447,6 @@ python do_package_stage () { if os.path.exists(srcfile): destpath = ipkpath + "/" + arch + "/" bb.mkdirhier(destpath) - print destpath bb.copyfile(srcfile, destpath + srcname) if bb.data.inherits_class('package_deb', d): @@ -453,7 +456,7 @@ python do_package_stage () { srcname = bb.data.expand(pkgname + "_${PV}-" + pr + "${DISTRO_PR}" + "_${DPKG_ARCH}.deb", d) srcfile = bb.data.expand("${DEPLOY_DIR_DEB}/" + arch + "/" + srcname, d) if os.path.exists(srcfile): - destpath = debpath + "/" + arch + "/" + destpath = debpath + "/" + arch + "/" bb.mkdirhier(destpath) bb.copyfile(srcfile, destpath + srcname) @@ -464,7 +467,7 @@ python do_package_stage () { srcname = bb.data.expand(pkgname + "-${RPMPV}-" + pr + "${DISTRO_PR}" + ".${TARGET_ARCH}.rpm", d) srcfile = bb.data.expand("${DEPLOY_DIR_RPM}/" + arch + "/" + srcname, d) if os.path.exists(srcfile): - destpath = rpmpath + "/" + arch + "/" + destpath = rpmpath + "/" + arch + "/" bb.mkdirhier(destpath) bb.copyfile(srcfile, destpath + srcname) @@ -477,7 +480,7 @@ python do_package_stage () { bb.mkdirhier(destdir) # We need to include the package_stage stamp in the staging package so create one bb.build.make_stamp("do_package_stage", d) - os.system("cp -dpR %s.do_* %s/" % (stampfn, destdir)) + oe_run(d, "cp -dpR %s.do_* %s/" % (stampfn, destdir)) pstage_set_pkgmanager(d) bb.build.exec_func("staging_helper", d) -- cgit 1.2.3-korg From beef54248765d11c8e299949545533fa9b7ad654 Mon Sep 17 00:00:00 2001 From: Chase Maupin Date: Tue, 7 Sep 2010 07:05:44 +0000 Subject: sourceipk: make extra files inclusion optional * Make the inclusion of the README and recipe files optional for source ipks. For some packages the sources owner may not want these additional files added to their sources. Signed-off-by: Chase Maupin Signed-off-by: Denys Dmytriyenko --- classes/sourceipk.bbclass | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/sourceipk.bbclass b/classes/sourceipk.bbclass index 4957e4af4c..182785ba66 100644 --- a/classes/sourceipk.bbclass +++ b/classes/sourceipk.bbclass @@ -14,6 +14,9 @@ # - SRCIPK_PACKAGE_ARCH = This variable allows specific recipies to # specify an architecture for the sourcetree # package is "all" is not appropriate +# - SRCIPK_INC_EXTRAFILES = When set to 1 this variable indicates that +# the source ipk should contain extra files +# such as the README file and recipe. # # The default installation directory for the sources is: # /usr/src/${PN}-src @@ -47,6 +50,9 @@ SRCIPK_INSTALL_DIR ?= "/usr/src/${PN}-src" # Default PACKAGE_ARCH for sources is "all" SRCIPK_PACKAGE_ARCH ?= "all" +# Default SRCIPK_INCLUDE_EXTRAFILES is to include the extra files +SRCIPK_INCLUDE_EXTRAFILES ?= "1" + # Create a README file that describes the contents of the source ipk sourceipk_create_readme() { readme="$1/README.${PN}-src" @@ -91,7 +97,6 @@ sourceipk_do_create_srcipk() { srcuri="OpenEmbedded" fi echo "Source: $srcuri" >> $control_file - #Write the control tarball tar -C $tmp_dir/CONTROL --owner=0 --group=0 -czf $srcipk_dir/control.tar.gz . @@ -101,8 +106,12 @@ sourceipk_do_create_srcipk() { # Copy sources for packaging mkdir -p $tmp_dir/${SRCIPK_INSTALL_DIR} cp -rLf ${S}/* $tmp_dir/${SRCIPK_INSTALL_DIR}/ - sourceipk_create_readme $tmp_dir/${SRCIPK_INSTALL_DIR}/ - cp ${FILE} $tmp_dir/${SRCIPK_INSTALL_DIR}/ + + if [ ${SRCIPK_INCLUDE_EXTRAFILES} != "0" ] + then + sourceipk_create_readme $tmp_dir/${SRCIPK_INSTALL_DIR}/ + cp ${FILE} $tmp_dir/${SRCIPK_INSTALL_DIR}/ + fi #Write the data tarball tar -C $tmp_dir --owner=0 --group=0 -czf $srcipk_dir/data.tar.gz . -- cgit 1.2.3-korg From 88cb5184884d045ac4703910a6c5af86c1cf20f4 Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 10 Sep 2010 12:38:21 -0700 Subject: Fix unpack issue with bitbake 1.10 Signed-off-by: Chris Larson --- classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 1ffbe01706..9fc4bf00b2 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -177,7 +177,7 @@ def oe_unpack(d, local, urldata): if not urldata.host: urlpath = urldata.path else: - urlpath = oe.path.join(urldata.host, urldata.path) + urlpath = "%s%s" % (urldata.host, urldata.path) if not os.path.isabs(urlpath): subdirs.append(os.path.dirname(urlpath)) -- cgit 1.2.3-korg From 8607ea2929684714dbbc28f53023de92cf7c1bdf Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 10 Sep 2010 13:44:34 -0700 Subject: packaged-staging: add missing debug level Signed-off-by: Chris Larson --- classes/packaged-staging.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index d251102f13..377b8de3b1 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -94,7 +94,7 @@ def pstage_manualclean(srcname, destvarname, d): dest = bb.data.getVar(destvarname, d, True) for walkroot, dirs, files in os.walk(src): - bb.debug("rm %s" % walkroot) + bb.debug(2, "rm %s" % walkroot) for file in files: # Avoid breaking the held lock if (file == "staging.lock"): -- cgit 1.2.3-korg From 755654d14e8fddc54ed739461bd529291c1e1230 Mon Sep 17 00:00:00 2001 From: Frans Meulenbroeks Date: Thu, 2 Sep 2010 08:52:02 +0000 Subject: base.bbclass: fix soc-family test for now pushed this patch as it fixes the breakage. If it is decided not to have SOC_FAMILY we can always revert or overwrite see http://lists.linuxtogo.org/pipermail/openembedded-devel/2010-September/023680.html Signed-off-by: Frans Meulenbroeks Acked-by: Chase Maupin and got a looks good from Phil. --- classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 9fc4bf00b2..b19eb32751 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -338,7 +338,7 @@ python () { this_machine = bb.data.getVar('MACHINE', d, 1) if this_machine and not re.match(need_machine, this_machine): this_soc_family = bb.data.getVar('SOC_FAMILY', d, 1) - if this_soc_family and not re.match(need_machine, this_soc_family): + if (this_soc_family and not re.match(need_machine, this_soc_family)) or not this_soc_family: raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine) need_target = bb.data.getVar('COMPATIBLE_TARGET_SYS', d, 1) -- cgit 1.2.3-korg From 382a912f9bc71c535a3174fb39e56cff5dd760ab Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Wed, 8 Sep 2010 11:32:10 -0700 Subject: packaged-staging: When taking ipks use PKGV not PV This fixes a problem where ncurses 5.7 (and readline) wasn't having ipks stored. package_ipk.bbclass uses PKGV not PV which means packaged-staging should too. Signed-off-by: Tom Rini --- classes/packaged-staging.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index 377b8de3b1..58d336a954 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -442,7 +442,7 @@ python do_package_stage () { if not packaged(pkg, d): continue if bb.data.inherits_class('package_ipk', d): - srcname = bb.data.expand(pkgname + "_${PV}-" + pr + "${DISTRO_PR}" + "_" + arch + ".ipk", d) + srcname = bb.data.expand(pkgname + "_${PKGV}-" + pr + "${DISTRO_PR}" + "_" + arch + ".ipk", d) srcfile = bb.data.expand("${DEPLOY_DIR_IPK}/" + arch + "/" + srcname, d) if os.path.exists(srcfile): destpath = ipkpath + "/" + arch + "/" -- cgit 1.2.3-korg From f87759ae52f2a66be98d3f4104265ec36f62f071 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 9 Sep 2010 09:06:56 -0700 Subject: packaged-staging: Fix libtool-cross staging libtool-cross must not inherit cross, so wasn't getting the right mangling and saving done. In addition, we want a slightly broader grep to be used in these cases. Signed-off-by: Tom Rini --- classes/packaged-staging.bbclass | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'classes') diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index 58d336a954..8292853ffb 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -30,16 +30,8 @@ BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}" python __anonymous() { pstage_allowed = True - - # We need PSTAGE_PKGARCH to contain information about the target. - if bb.data.inherits_class('cross', d): - bb.data.setVar('PSTAGE_PKGARCH', "${HOST_SYS}-${PACKAGE_ARCH}-${TARGET_OS}", d) - - # These classes encode staging paths data files so we must mangle them - # for reuse. - if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('sdk', d): - scan_cmd = "grep -Irl ${STAGING_DIR} ${PSTAGE_TMPDIR_STAGE}" - bb.data.setVar('PSTAGE_SCAN_CMD', scan_cmd, d) + pstage_host_mangle = False + pstage_is_cross = False # PSTAGE_NATIVEDEPENDS lists the packages we need before we can use # packaged staging. There will always be some packages we depend on. @@ -59,6 +51,27 @@ python __anonymous() { if localdata.getVar('PSTAGING_DISABLED', True) == "1": pstage_allowed = False + # libtool-cross does not inherit cross. + if localdata.getVar('PN', True).startswith("libtool-cross"): + pstage_host_mangle = True + pstage_is_cross = True + + # We need PSTAGE_PKGARCH to contain information about the target. + if bb.data.inherits_class('cross', d): + pstage_host_mangle = True + + if pstage_host_mangle: + bb.data.setVar('PSTAGE_PKGARCH', "${HOST_SYS}-${PACKAGE_ARCH}-${TARGET_OS}", d) + + # These classes encode staging paths data files so we must mangle them + # for reuse. + if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('sdk', d): + pstage_is_cross = True + + if pstage_is_cross: + scan_cmd = "grep -Irl ${TMPDIR} ${PSTAGE_TMPDIR_STAGE}" + bb.data.setVar('PSTAGE_SCAN_CMD', scan_cmd, d) + # Add task dependencies if we're active, otherwise mark packaged staging # as inactive. if pstage_allowed: -- cgit 1.2.3-korg