diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-04 11:34:00 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-04 11:43:12 +0100 |
commit | 12f88767bc7686ddf3f33e9d731729e4ddc22075 (patch) | |
tree | ae44dda2214443b9aa6440de6cfb754127ffec25 /meta/classes | |
parent | 0f516fe9a043276c670622895c4760ff6468f293 (diff) | |
download | openembedded-core-12f88767bc7686ddf3f33e9d731729e4ddc22075.tar.gz openembedded-core-12f88767bc7686ddf3f33e9d731729e4ddc22075.tar.bz2 openembedded-core-12f88767bc7686ddf3f33e9d731729e4ddc22075.zip |
package_ipk: Clean up initial variables
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package_ipk.bbclass | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index bb71c9dd9a..ad00086fb6 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -135,39 +135,31 @@ package_generate_archlist () { python do_package_ipk () { import re, copy - workdir = bb.data.getVar('WORKDIR', d, 1) - if not workdir: - bb.error("WORKDIR not defined, unable to package") + workdir = bb.data.getVar('WORKDIR', d, True) + outdir = bb.data.getVar('PKGWRITEDIRIPK', d, True) + dvar = bb.data.getVar('D', d, True) + tmpdir = bb.data.getVar('TMPDIR', d, True) + pkgdest = bb.data.getVar('PKGDEST', d, True) + if not workdir or not outdir or not dvar or not tmpdir: + bb.error("Variables incorrectly set, unable to package") return - outdir = bb.data.getVar('DEPLOY_DIR_IPK', d, 1) - if not outdir: - bb.error("DEPLOY_DIR_IPK not defined, unable to package") + if not os.path.exists(dvar): + bb.debug(1, "Nothing installed, nothing to do") return - dvar = bb.data.getVar('D', d, 1) - if not dvar: - bb.error("D not defined, unable to package") - return - bb.mkdirhier(dvar) - - packages = bb.data.getVar('PACKAGES', d, 1) - if not packages: - bb.debug(1, "PACKAGES not defined, nothing to package") + packages = bb.data.getVar('PACKAGES', d, True) + if not packages or packages == '': + bb.debug(1, "No packages; nothing to do") return - tmpdir = bb.data.getVar('TMPDIR', d, 1) - + # We're about to add new packages so the index needs to be checked + # so remove the appropriate stamp file. 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")) - if packages == []: - bb.debug(1, "No packages; nothing to do") - return - for pkg in packages.split(): localdata = bb.data.createCopy(d) - pkgdest = bb.data.getVar('PKGDEST', d, 1) root = "%s/%s" % (pkgdest, pkg) lf = bb.utils.lockfile(root + ".lock") |