diff options
Diffstat (limited to 'meta/classes/packagefeed-stability.bbclass')
| -rw-r--r-- | meta/classes/packagefeed-stability.bbclass | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/meta/classes/packagefeed-stability.bbclass b/meta/classes/packagefeed-stability.bbclass index df4c2babb6..c0e9be549d 100644 --- a/meta/classes/packagefeed-stability.bbclass +++ b/meta/classes/packagefeed-stability.bbclass @@ -31,7 +31,7 @@ python() { # This assumes that the package_write task is called package_write_<pkgtype> # and that the directory in which packages should be written is # pointed to by the variable DEPLOY_DIR_<PKGTYPE> - for pkgclass in (d.getVar('PACKAGE_CLASSES', True) or '').split(): + for pkgclass in (d.getVar('PACKAGE_CLASSES') or '').split(): if pkgclass.startswith('package_'): pkgtype = pkgclass.split('_', 1)[1] pkgwritefunc = 'do_package_write_%s' % pkgtype @@ -51,13 +51,16 @@ python() { d.appendVarFlag('do_build', 'recrdeptask', ' ' + pkgcomparefunc) - if d.getVarFlag(pkgwritefunc, 'noexec', True) or not d.getVarFlag(pkgwritefunc, 'task', True): + if d.getVarFlag(pkgwritefunc, 'noexec') or not d.getVarFlag(pkgwritefunc, 'task'): # Packaging is disabled for this recipe, we shouldn't do anything continue if deploydirvarref in sstate_outputdirs: + deplor_dir_pkgtype = d.expand(deploydirvarref + '-prediff') # Set intermediate output directory - d.setVarFlag(pkgwritefunc, 'sstate-outputdirs', sstate_outputdirs.replace(deploydirvarref, deploydirvarref + '-prediff')) + d.setVarFlag(pkgwritefunc, 'sstate-outputdirs', sstate_outputdirs.replace(deploydirvarref, deplor_dir_pkgtype)) + # Update SSTATE_DUPWHITELIST to avoid shared location conflicted error + d.appendVar('SSTATE_DUPWHITELIST', ' %s' % deplor_dir_pkgtype) d.setVar(pkgcomparefunc, d.getVar('do_package_compare', False)) d.setVarFlags(pkgcomparefunc, d.getVarFlags('do_package_compare', False)) @@ -68,7 +71,7 @@ python() { # This isn't the real task function - it's a template that we use in the # anonymous python code above fakeroot python do_package_compare () { - currenttask = d.getVar('BB_CURRENTTASK', True) + currenttask = d.getVar('BB_CURRENTTASK') pkgtype = currenttask.rsplit('_', 1)[1] package_compare_impl(pkgtype, d) } @@ -80,12 +83,12 @@ def package_compare_impl(pkgtype, d): import subprocess import oe.sstatesig - pn = d.getVar('PN', True) - deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper(), True) + pn = d.getVar('PN') + deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper()) prepath = deploydir + '-prediff/' # Find out PKGR values are - pkgdatadir = d.getVar('PKGDATA_DIR', True) + pkgdatadir = d.getVar('PKGDATA_DIR') packages = [] try: with open(os.path.join(pkgdatadir, pn), 'r') as f: @@ -135,6 +138,7 @@ def package_compare_impl(pkgtype, d): files = [] docopy = False manifest, _ = oe.sstatesig.sstate_get_manifest_filename(pkgwritetask, d) + mlprefix = d.getVar('MLPREFIX') # Copy recipe's all packages if one of the packages are different to make # they have the same PR. with open(manifest, 'r') as f: @@ -150,6 +154,8 @@ def package_compare_impl(pkgtype, d): pkgbasename = os.path.basename(destpath) pkgname = None for rpkg, pkg in rpkglist: + if mlprefix and pkgtype == 'rpm' and rpkg.startswith(mlprefix): + rpkg = rpkg[len(mlprefix):] if pkgbasename.startswith(rpkg): pkgr = pkgrvalues[pkg] destpathspec = destpath.replace(pkgr, '*') @@ -205,6 +211,12 @@ def package_compare_impl(pkgtype, d): for pkgname, pkgbasename, srcpath, destpath in files: destdir = os.path.dirname(destpath) bb.utils.mkdirhier(destdir) + # Remove allarch rpm pkg if it is already existed (for + # multilib), they're identical in theory, but sstate.bbclass + # copies it again, so keep align with that. + if os.path.exists(destpath) and pkgtype == 'rpm' \ + and d.getVar('PACKAGE_ARCH') == 'all': + os.unlink(destpath) if (os.stat(srcpath).st_dev == os.stat(destdir).st_dev): # Use a hard link to save space os.link(srcpath, destpath) @@ -212,14 +224,15 @@ def package_compare_impl(pkgtype, d): shutil.copyfile(srcpath, destpath) f.write('%s\n' % destpath) else: - bb.plain('Not copying packages for %s' % pn) + bb.plain('Not copying packages for recipe %s' % pn) -do_cleanall_append() { +do_cleansstate[postfuncs] += "pfs_cleanpkgs" +python pfs_cleanpkgs () { import errno - for pkgclass in (d.getVar('PACKAGE_CLASSES', True) or '').split(): + for pkgclass in (d.getVar('PACKAGE_CLASSES') or '').split(): if pkgclass.startswith('package_'): pkgtype = pkgclass.split('_', 1)[1] - deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper(), True) + deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper()) prepath = deploydir + '-prediff' pcmanifest = os.path.join(prepath, d.expand('pkg-compare-manifest-${MULTIMACH_TARGET_SYS}-${PN}')) try: |
