diff options
author | Koen Kooi <koen@openembedded.org> | 2007-12-23 10:50:30 +0000 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2007-12-23 10:50:30 +0000 |
commit | e49ed8da00b7a5d874fd92a806c6b036a726069c (patch) | |
tree | 4c2986b1f377b0363e6637cc792e8e553c2b39a4 /classes/package_ipk.bbclass | |
parent | 95580064683ef83263017dce9b610c74306348bb (diff) | |
parent | a5ab4c1e92a80b977b53072b349e05ab0f097dd1 (diff) |
merge of '6765ce1f621a9ef917ba1521afc7b81013e14dc2'
and 'fcc520f13c2e5df6e6b7d52dcbfb32cb1750c941'
Diffstat (limited to 'classes/package_ipk.bbclass')
-rw-r--r-- | classes/package_ipk.bbclass | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index a12899e2a1..087bbcbfb4 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -32,7 +32,7 @@ python package_ipk_install () { # Generate ipk.conf if it or the stamp doesnt exist conffile = os.path.join(stagingdir,"ipkg.conf") - if not os.access(conffile, os.R_OK): + if not os.access(conffile, os.R_OK): ipkg_archs = bb.data.getVar('PACKAGE_ARCHS',d) if ipkg_archs is None: bb.error("PACKAGE_ARCHS missing") @@ -114,7 +114,7 @@ package_generate_ipkg_conf () { } python do_package_ipk () { - import sys, re, fcntl, copy + import sys, re, copy, fcntl workdir = bb.data.getVar('WORKDIR', d, 1) if not workdir: @@ -127,10 +127,6 @@ python do_package_ipk () { bb.error("DEPLOY_DIR_IPK not defined, unable to package") return - arch = bb.data.getVar('PACKAGE_ARCH', d, 1) - outdir = "%s/%s" % (outdir, arch) - bb.mkdirhier(outdir) - dvar = bb.data.getVar('D', d, 1) if not dvar: bb.error("D not defined, unable to package") @@ -160,9 +156,11 @@ python do_package_ipk () { fcntl.flock(lf.fileno(), fcntl.LOCK_UN) lf.close + for pkg in packages.split(): localdata = bb.data.createCopy(d) - root = "%s/install/%s" % (workdir, pkg) + pkgdest = bb.data.getVar('PKGDEST', d, 1) + root = "%s/%s" % (pkgdest, pkg) lf = lockfile(root + ".lock") @@ -181,7 +179,8 @@ python do_package_ipk () { bb.data.update_data(localdata) basedir = os.path.join(os.path.dirname(root)) - pkgoutdir = outdir + arch = bb.data.getVar('PACKAGE_ARCH', localdata, 1) + pkgoutdir = "%s/%s" % (outdir, arch) bb.mkdirhier(pkgoutdir) os.chdir(root) from glob import glob @@ -202,6 +201,7 @@ python do_package_ipk () { try: ctrlfile = file(os.path.join(controldir, 'control'), 'w') except OSError: + unlockfile(lf) raise bb.build.FuncFailed("unable to open control file for writing.") fields = [] @@ -235,6 +235,7 @@ python do_package_ipk () { except KeyError: (type, value, traceback) = sys.exc_info() ctrlfile.close() + unlockfile(lf) raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value) # more fields @@ -271,6 +272,7 @@ python do_package_ipk () { try: scriptfile = file(os.path.join(controldir, script), 'w') except OSError: + unlockfile(lf) raise bb.build.FuncFailed("unable to open %s script file for writing." % script) scriptfile.write(scriptvar) scriptfile.close() @@ -281,6 +283,7 @@ python do_package_ipk () { try: conffiles = file(os.path.join(controldir, 'conffiles'), 'w') except OSError: + unlockfile(lf) raise bb.build.FuncFailed("unable to open conffiles for writing.") for f in conffiles_str.split(): conffiles.write('%s\n' % f) @@ -290,6 +293,7 @@ python do_package_ipk () { ret = os.system("PATH=\"%s\" %s %s %s" % (bb.data.getVar("PATH", localdata, 1), bb.data.getVar("IPKGBUILDCMD",d,1), pkg, pkgoutdir)) if ret != 0: + unlockfile(lf) raise bb.build.FuncFailed("ipkg-build execution failed") for script in ["preinst", "postinst", "prerm", "postrm", "control" ]: @@ -308,7 +312,10 @@ python do_package_ipk () { python () { import bb if bb.data.getVar('PACKAGES', d, True) != '': - bb.data.setVarFlag('do_package_write_ipk', 'depends', 'ipkg-utils-native:do_populate_staging fakeroot-native:do_populate_staging', d) + deps = (bb.data.getVarFlag('do_package_write_ipk', 'depends', d) or "").split() + deps.append('ipkg-utils-native:do_populate_staging') + deps.append('fakeroot-native:do_populate_staging') + bb.data.setVarFlag('do_package_write_ipk', 'depends', " ".join(deps), d) } python do_package_write_ipk () { @@ -316,4 +323,5 @@ python do_package_write_ipk () { bb.build.exec_func("do_package_ipk", d) } do_package_write_ipk[dirs] = "${D}" +do_package_write_ipk[depends] = "ipkg-utils-native:do_populate_staging" addtask package_write_ipk before do_package_write after do_package |