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.

(From OE-Core rev: 68150bac7444f089f19c789e9f6602d59f605d7a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2018-02-27 17:22:32 +00:00
parent 6a07697a6d
commit 3eff72cc1f
3 changed files with 41 additions and 61 deletions

View File

@ -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']

View File

@ -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:

View File

@ -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