aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-27 17:22:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-27 22:54:24 +0000
commit68150bac7444f089f19c789e9f6602d59f605d7a (patch)
tree033c95bb277e452923441c7235a6dcf9775a354d
parent85e72e129362db896b0d368077033e4a2e373cf9 (diff)
downloadopenembedded-core-contrib-68150bac7444f089f19c789e9f6602d59f605d7a.tar.gz
openembedded-core-contrib-68150bac7444f089f19c789e9f6602d59f605d7a.tar.bz2
openembedded-core-contrib-68150bac7444f089f19c789e9f6602d59f605d7a.zip
sstatesig/staging/package_manager: Create common sstate manifest code
Create a common function for locating task manifest files rather than several implementations with missing pieces. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/staging.bbclass36
-rw-r--r--meta/lib/oe/package_manager.py31
-rw-r--r--meta/lib/oe/sstatesig.py35
3 files changed, 41 insertions, 61 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 1b9e84d97e..3fcbc9f15d 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -470,40 +470,14 @@ python extend_recipe_sysroot() {
os.symlink(c + "." + taskhash, depdir + "/" + c)
- d2 = d
- destsysroot = recipesysroot
- variant = ''
- if setscenedeps[dep][2].startswith("virtual:multilib"):
- variant = setscenedeps[dep][2].split(":")[2]
- if variant != current_variant:
- if variant not in multilibs:
- multilibs[variant] = get_multilib_datastore(variant, d)
- d2 = multilibs[variant]
- destsysroot = d2.getVar("RECIPE_SYSROOT")
+ manifest, d2 = oe.sstatesig.find_sstate_manifest(c, setscenedeps[dep][2], "populate_sysroot", d, multilibs)
+ destsysroot = d2.getVar("RECIPE_SYSROOT")
native = False
- if c.endswith("-native"):
- manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c)
+ if c.endswith("-native") or "-cross-" in c or "-crosssdk" in c:
native = True
- elif c.startswith("nativesdk-"):
- manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
- elif "-cross-" in c:
- manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}_${TARGET_ARCH}-%s.populate_sysroot" % c)
- native = True
- elif "-crosssdk" in c:
- manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
- native = True
- else:
- pkgarchs = ['${MACHINE_ARCH}']
- pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
- pkgarchs.append('allarch')
- for pkgarch in pkgarchs:
- manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-%s-%s.populate_sysroot" % (pkgarch, c))
- if os.path.exists(manifest):
- break
- if not os.path.exists(manifest):
- bb.warn("Manifest %s not found?" % manifest)
- else:
+
+ if manifest:
newmanifest = collections.OrderedDict()
if native:
fm = fixme['native']
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index f59eaf7b85..8c567be0f4 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -507,37 +507,8 @@ def create_packages_dir(d, rpm_repo_dir, deploydir, taskname, filterbydependenci
for dep in rpmdeps:
c = taskdepdata[dep][0]
-
- d2 = d
- variant = ''
- if taskdepdata[dep][2].startswith("virtual:multilib"):
- variant = taskdepdata[dep][2].split(":")[2]
- if variant not in multilibs:
- multilibs[variant] = oe.utils.get_multilib_datastore(variant, d)
- d2 = multilibs[variant]
-
- if c.endswith("-native"):
- pkgarchs = ["${BUILD_ARCH}"]
- elif c.startswith("nativesdk-"):
- pkgarchs = ["${SDK_ARCH}_${SDK_OS}", "allarch"]
- elif "-cross-canadian" in c:
- pkgarchs = ["${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}"]
- elif "-cross-" in c:
- pkgarchs = ["${BUILD_ARCH}_${TARGET_ARCH}"]
- elif "-crosssdk" in c:
- pkgarchs = ["${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}"]
- else:
- pkgarchs = ['${MACHINE_ARCH}']
- pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
- pkgarchs.append('allarch')
- pkgarchs.append('${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}')
-
- for pkgarch in pkgarchs:
- manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-%s-%s.%s" % (pkgarch, c, taskname))
- if os.path.exists(manifest):
- break
+ manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs)
if not os.path.exists(manifest):
- bb.warn("Manifest %s not found in %s (variant '%s')?" % (manifest, d2.expand(" ".join(pkgarchs)), variant))
continue
with open(manifest, "r") as f:
for l in f:
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 3a8778eae0..49afed6105 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -1,4 +1,5 @@
import bb.siggen
+import oe
def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCache):
# Return True if we should keep the dependency, False to drop it
@@ -368,3 +369,37 @@ def sstate_get_manifest_filename(task, d):
if extrainf:
d2.setVar("SSTATE_MANMACH", extrainf)
return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2)
+
+def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
+ d2 = d
+ variant = ''
+ if taskdata2.startswith("virtual:multilib"):
+ variant = taskdata2.split(":")[2]
+ if variant not in multilibcache:
+ multilibcache[variant] = oe.utils.get_multilib_datastore(variant, d)
+ d2 = multilibcache[variant]
+
+ if taskdata.endswith("-native"):
+ pkgarchs = ["${BUILD_ARCH}"]
+ elif taskdata.startswith("nativesdk-"):
+ pkgarchs = ["${SDK_ARCH}_${SDK_OS}", "allarch"]
+ elif "-cross-canadian" in taskdata:
+ pkgarchs = ["${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}"]
+ elif "-cross-" in taskdata:
+ pkgarchs = ["${BUILD_ARCH}_${TARGET_ARCH}"]
+ elif "-crosssdk" in taskdata:
+ pkgarchs = ["${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}"]
+ else:
+ pkgarchs = ['${MACHINE_ARCH}']
+ pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
+ pkgarchs.append('allarch')
+ pkgarchs.append('${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}')
+
+ for pkgarch in pkgarchs:
+ manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-%s-%s.%s" % (pkgarch, taskdata, taskname))
+ if os.path.exists(manifest):
+ return manifest, d2
+ bb.warn("Manifest %s not found in %s (variant '%s')?" % (manifest, d2.expand(" ".join(pkgarchs)), variant))
+ return None, d2
+
+