diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-15 11:45:14 +0100 |
---|---|---|
committer | Andreas Oberritter <obi@opendreambox.org> | 2017-06-26 22:57:08 +0200 |
commit | 9fad5ac26b8f96e9b4a32404a78feabeefce443f (patch) | |
tree | d6ecc8a272cd2360ac768ded071ae42d0bbdd13d /meta | |
parent | e937fa54407270300d8ed27ec22d09b59905ca01 (diff) | |
download | openembedded-core-contrib-9fad5ac26b8f96e9b4a32404a78feabeefce443f.tar.gz |
sstate: Add postrm command support
There are some issues in sstate which can't be handled by file removal
alone. Currently there is no way to execute a command against sstate and
doing so is potentially problematic for things like dependencies. This
patch adds a mechanism where any "postrm" script is executed if its present
allowing some openjade/sgml issues to be resolved.
[YOCTO #8273]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2268efd0cd3ddb40870c4c424d10444ba86d2849)
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/sstate.bbclass | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 9d4ba71f47..3a5c8f4a6b 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -173,6 +173,8 @@ def sstate_install(ss, d): if os.access(manifest, os.R_OK): bb.fatal("Package already staged (%s)?!" % manifest) + d.setVar("SSTATE_INST_POSTRM", manifest + ".postrm") + locks = [] for lock in ss['lockfiles-shared']: locks.append(bb.utils.lockfile(lock, True)) @@ -405,6 +407,13 @@ def sstate_clean_manifest(manifest, d): except OSError: pass + postrm = manifest + ".postrm" + if os.path.exists(manifest + ".postrm"): + import subprocess + os.chmod(postrm, 0o755) + subprocess.call(postrm, shell=True) + oe.path.remove(postrm) + oe.path.remove(manifest) def sstate_clean(ss, d): @@ -985,6 +994,8 @@ python sstate_eventhandler2() { for r in toremove: (stamp, manifest, workdir) = r.split() for m in glob.glob(manifest + ".*"): + if m.endswith(".postrm"): + continue sstate_clean_manifest(m, d) bb.utils.remove(stamp + "*") if removeworkdir: |