diff options
Diffstat (limited to 'meta/classes/package_deb.bbclass')
-rw-r--r-- | meta/classes/package_deb.bbclass | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index 6a8e080138..d18c250ecc 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass | |||
@@ -202,6 +202,12 @@ python do_package_deb () { | |||
202 | 202 | ||
203 | pkgdest = d.getVar('PKGDEST', True) | 203 | pkgdest = d.getVar('PKGDEST', True) |
204 | 204 | ||
205 | def cleanupcontrol(root): | ||
206 | for p in ['CONTROL', 'DEBIAN']: | ||
207 | p = os.path.join(root, p) | ||
208 | if os.path.exists(p): | ||
209 | bb.utils.prunedir(p) | ||
210 | |||
205 | for pkg in packages.split(): | 211 | for pkg in packages.split(): |
206 | localdata = bb.data.createCopy(d) | 212 | localdata = bb.data.createCopy(d) |
207 | root = "%s/%s" % (pkgdest, pkg) | 213 | root = "%s/%s" % (pkgdest, pkg) |
@@ -224,13 +230,9 @@ python do_package_deb () { | |||
224 | bb.utils.mkdirhier(pkgoutdir) | 230 | bb.utils.mkdirhier(pkgoutdir) |
225 | 231 | ||
226 | os.chdir(root) | 232 | os.chdir(root) |
233 | cleanupcontrol(root) | ||
227 | from glob import glob | 234 | from glob import glob |
228 | g = glob('*') | 235 | g = glob('*') |
229 | try: | ||
230 | del g[g.index('DEBIAN')] | ||
231 | del g[g.index('./DEBIAN')] | ||
232 | except ValueError: | ||
233 | pass | ||
234 | if not g and localdata.getVar('ALLOW_EMPTY') != "1": | 236 | if not g and localdata.getVar('ALLOW_EMPTY') != "1": |
235 | bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True))) | 237 | bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True))) |
236 | bb.utils.unlockfile(lf) | 238 | bb.utils.unlockfile(lf) |
@@ -402,11 +404,10 @@ python do_package_deb () { | |||
402 | os.chdir(basedir) | 404 | os.chdir(basedir) |
403 | ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True) | 405 | ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True) |
404 | if ret != 0: | 406 | if ret != 0: |
405 | bb.utils.prunedir(controldir) | ||
406 | bb.utils.unlockfile(lf) | 407 | bb.utils.unlockfile(lf) |
407 | raise bb.build.FuncFailed("dpkg-deb execution failed") | 408 | raise bb.build.FuncFailed("dpkg-deb execution failed") |
408 | 409 | ||
409 | bb.utils.prunedir(controldir) | 410 | cleanupcontrol(root) |
410 | bb.utils.unlockfile(lf) | 411 | bb.utils.unlockfile(lf) |
411 | } | 412 | } |
412 | 413 | ||