pkgdest = d.getVar('PKGDEST', True)
+ 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)
bb.utils.mkdirhier(pkgoutdir)
os.chdir(root)
+ cleanupcontrol(root)
from glob import glob
g = glob('*')
- try:
- del g[g.index('DEBIAN')]
- del g[g.index('./DEBIAN')]
- 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)
os.chdir(basedir)
ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
if ret != 0:
- bb.utils.prunedir(controldir)
bb.utils.unlockfile(lf)
raise bb.build.FuncFailed("dpkg-deb execution failed")
- bb.utils.prunedir(controldir)
+ cleanupcontrol(root)
bb.utils.unlockfile(lf)
}
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)
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)
bb.utils.unlockfile(lf)
raise bb.build.FuncFailed("opkg-build execution failed")
- bb.utils.prunedir(controldir)
+ cleanupcontrol(root)
bb.utils.unlockfile(lf)
}