mirror of
https://git.yoctoproject.org/poky
synced 2026-09-24 13:36:22 +02:00
package_ipk/deb: Tweak functions for better cleanup and layout
This uses more modern formatting to handle the lockfiles and control file cleanup with try/finally, taking advantage of the previous extra indentation. (From OE-Core rev: 9cd7c2631b0840a57b9ed6c201bcb4fc80094f71) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -88,6 +88,7 @@ def deb_write_pkg(pkg, d):
|
||||
root = "%s/%s" % (pkgdest, pkg)
|
||||
|
||||
lf = bb.utils.lockfile(root + ".lock")
|
||||
try:
|
||||
|
||||
localdata.setVar('ROOT', '')
|
||||
localdata.setVar('ROOT_%s' % pkg, root)
|
||||
@@ -109,7 +110,6 @@ def deb_write_pkg(pkg, d):
|
||||
g = glob('*')
|
||||
if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
|
||||
bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
|
||||
bb.utils.unlockfile(lf)
|
||||
return
|
||||
|
||||
controldir = os.path.join(root, 'DEBIAN')
|
||||
@@ -283,6 +283,7 @@ def deb_write_pkg(pkg, d):
|
||||
os.chdir(basedir)
|
||||
subprocess.check_output("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH"), root, pkgoutdir), shell=True)
|
||||
|
||||
finally:
|
||||
cleanupcontrol(root)
|
||||
bb.utils.unlockfile(lf)
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ def ipk_write_pkg(pkg, d):
|
||||
root = "%s/%s" % (pkgdest, pkg)
|
||||
|
||||
lf = bb.utils.lockfile(root + ".lock")
|
||||
|
||||
try:
|
||||
localdata.setVar('ROOT', '')
|
||||
localdata.setVar('ROOT_%s' % pkg, root)
|
||||
pkgname = localdata.getVar('PKG_%s' % pkg)
|
||||
@@ -107,7 +107,6 @@ def ipk_write_pkg(pkg, d):
|
||||
g = glob('*')
|
||||
if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
|
||||
bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
|
||||
bb.utils.unlockfile(lf)
|
||||
return
|
||||
|
||||
controldir = os.path.join(root, 'CONTROL')
|
||||
@@ -245,6 +244,7 @@ def ipk_write_pkg(pkg, d):
|
||||
ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH'))
|
||||
sign_ipk(d, ipk_to_sign)
|
||||
|
||||
finally:
|
||||
cleanupcontrol(root)
|
||||
bb.utils.unlockfile(lf)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user