aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2012-08-29 23:27:44 +0200
committerAndreas Oberritter <obi@opendreambox.org>2015-02-23 17:15:48 +0100
commit3a38f587f2a896aa7330e152f4744aec07bc27fc (patch)
tree4c457ce378692afb0cfc29e0404042607efe0b66
parent5f8b1fef3f86363cae2245cbb0e7cadd5c706335 (diff)
downloadopenembedded-core-contrib-3a38f587f2a896aa7330e152f4744aec07bc27fc.tar.gz
[opendreambox] sstate.bbclass: don't remove shared pkgdata if PACKAGE_ARCH changed to MACHINE_ARCH
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
-rw-r--r--meta/classes/sstate.bbclass45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 2ef2f14e7b..522d0c0cbd 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -300,13 +300,58 @@ def sstate_clean_cachefiles(d):
sstate_clean_cachefile(ss, d)
def sstate_clean_manifest(manifest, d):
+ from glob import glob
import oe.path
+ manifest_ending = '.package'
+ check_package_arch = manifest.endswith(manifest_ending)
+ if not check_package_arch:
+ deploy_pos = manifest.find('.deploy-')
+ check_package_arch = deploy_pos != -1
+ else:
+ deploy_pos = 0
+ if check_package_arch:
+ package_arch = d.getVar('PACKAGE_ARCH', True)
+ machine = d.getVar('MACHINE', True)
+ package_arch_old = ''
+ dir_scanned = False
+ pkg_set = set()
+ pn = d.getVar('PN', True)
+ sstate_manifests = d.getVar('SSTATE_MANIFESTS', True)
+ if deploy_pos:
+ pkg_type = manifest[deploy_pos+8:]
+ manifest_ending = '.deploy-' + pkg_type
+ pkgdata_root = d.getVar('DEPLOY_DIR', True) + '/' + pkg_type + '/'
+ pkgdata_split_char = '/'
+ else:
+ pkgdata_dir = d.getVar('PKGDATA_DIR', True)
+ pkgdata_root = '/'.join(pkgdata_dir.split('/')[:-1]) + '/'
+ pkgdata_split_char = '-'
+
mfile = open(manifest)
entries = mfile.readlines()
mfile.close()
for entry in entries:
+ if check_package_arch:
+ if not package_arch_old and entry.startswith(pkgdata_root):
+ package_arch_old = entry[len(pkgdata_root):].split(pkgdata_split_char)[0]
+ if package_arch_old:
+ if package_arch_old != package_arch:
+ if not dir_scanned:
+ for f in glob('%s/manifest-*-%s%s' % (sstate_manifests, pn, manifest_ending)):
+ if f == manifest:
+ continue
+ tfile = open(f)
+ pkg_set = pkg_set | set(tfile.readlines())
+ tfile.close()
+ dir_scanned = True
+ if entry in pkg_set:
+ bb.debug(2, "Keeping manifest: %s (used by another machine)" % entry.strip())
+ continue
+ else:
+ check_package_arch = False
+
entry = entry.strip()
bb.debug(2, "Removing manifest: %s" % entry)
# We can race against another package populating directories as we're removing them