diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-15 11:45:14 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-16 15:24:02 +0100 |
commit | 0573dceb7ba9488cb62e08f8e139a75e32ca33ea (patch) | |
tree | 3aba950e04950db681a09a3cd9c5be10493201c1 /meta/classes/sstate.bbclass | |
parent | 0c1b8bf5494e0dcd9322623c5573ccc411891381 (diff) | |
download | poky-0573dceb7ba9488cb62e08f8e139a75e32ca33ea.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]
(From OE-Core rev: 2268efd0cd3ddb40870c4c424d10444ba86d2849)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-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 216e133279..ac9d77d528 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
@@ -175,6 +175,8 @@ def sstate_install(ss, d): | |||
175 | if os.access(manifest, os.R_OK): | 175 | if os.access(manifest, os.R_OK): |
176 | bb.fatal("Package already staged (%s)?!" % manifest) | 176 | bb.fatal("Package already staged (%s)?!" % manifest) |
177 | 177 | ||
178 | d.setVar("SSTATE_INST_POSTRM", manifest + ".postrm") | ||
179 | |||
178 | locks = [] | 180 | locks = [] |
179 | for lock in ss['lockfiles-shared']: | 181 | for lock in ss['lockfiles-shared']: |
180 | locks.append(bb.utils.lockfile(lock, True)) | 182 | locks.append(bb.utils.lockfile(lock, True)) |
@@ -408,6 +410,13 @@ def sstate_clean_manifest(manifest, d): | |||
408 | except OSError: | 410 | except OSError: |
409 | pass | 411 | pass |
410 | 412 | ||
413 | postrm = manifest + ".postrm" | ||
414 | if os.path.exists(manifest + ".postrm"): | ||
415 | import subprocess | ||
416 | os.chmod(postrm, 0o755) | ||
417 | subprocess.call(postrm, shell=True) | ||
418 | oe.path.remove(postrm) | ||
419 | |||
411 | oe.path.remove(manifest) | 420 | oe.path.remove(manifest) |
412 | 421 | ||
413 | def sstate_clean(ss, d): | 422 | def sstate_clean(ss, d): |
@@ -1012,6 +1021,8 @@ python sstate_eventhandler2() { | |||
1012 | for r in toremove: | 1021 | for r in toremove: |
1013 | (stamp, manifest, workdir) = r.split() | 1022 | (stamp, manifest, workdir) = r.split() |
1014 | for m in glob.glob(manifest + ".*"): | 1023 | for m in glob.glob(manifest + ".*"): |
1024 | if m.endswith(".postrm"): | ||
1025 | continue | ||
1015 | sstate_clean_manifest(m, d) | 1026 | sstate_clean_manifest(m, d) |
1016 | bb.utils.remove(stamp + "*") | 1027 | bb.utils.remove(stamp + "*") |
1017 | if removeworkdir: | 1028 | if removeworkdir: |