aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/package_ipk.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-05 22:08:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-06 11:01:53 +0000
commit7f8c728c82a17621461be2114c1afab3713a808e (patch)
treeb16d7c8d1132d51f0d14b1be02b865c3f5cb7a7b /meta/classes/package_ipk.bbclass
parent4c3b3a57aa9ced231f5c0340920195c15a26f2b1 (diff)
downloadopenembedded-core-contrib-7f8c728c82a17621461be2114c1afab3713a808e.tar.gz
package_deb/package_ipk: Cleanup control file handling/races
If you Ctrl+C ppackage_write_{deb/ipk} control files can get left lying around and make it into another packaging format. This ensures we cleanup all known control files before starting packaging. We can simplify some of the globbing as a result. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_ipk.bbclass')
-rw-r--r--meta/classes/package_ipk.bbclass14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index a633cfcc76..d0db9454d1 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -234,6 +234,12 @@ python do_package_ipk () {
if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
+ def cleanupcontrol(root):
+ for p in ['CONTROL', 'DEBIAN']:
+ p = os.path.join(root, p)
+ if os.path.exists(p):
+ bb.utils.prunedir(p)
+
for pkg in packages.split():
localdata = bb.data.createCopy(d)
root = "%s/%s" % (pkgdest, pkg)
@@ -255,13 +261,9 @@ python do_package_ipk () {
pkgoutdir = "%s/%s" % (outdir, arch)
bb.utils.mkdirhier(pkgoutdir)
os.chdir(root)
+ cleanupcontrol(root)
from glob import glob
g = glob('*')
- try:
- del g[g.index('CONTROL')]
- del g[g.index('./CONTROL')]
- except ValueError:
- pass
if not g and localdata.getVar('ALLOW_EMPTY') != "1":
bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
bb.utils.unlockfile(lf)
@@ -407,7 +409,7 @@ python do_package_ipk () {
bb.utils.unlockfile(lf)
raise bb.build.FuncFailed("opkg-build execution failed")
- bb.utils.prunedir(controldir)
+ cleanupcontrol(root)
bb.utils.unlockfile(lf)
}