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 | |
parent | 0f516fe9a043276c670622895c4760ff6468f293 (diff) | |
download | poky-12f88767bc7686ddf3f33e9d731729e4ddc22075.tar.gz |
package_ipk: Clean up initial variables
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta')
-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 () { | |||
135 | python do_package_ipk () { | 135 | python do_package_ipk () { |
136 | import re, copy | 136 | import re, copy |
137 | 137 | ||
138 | workdir = bb.data.getVar('WORKDIR', d, 1) | 138 | workdir = bb.data.getVar('WORKDIR', d, True) |
139 | if not workdir: | 139 | outdir = bb.data.getVar('PKGWRITEDIRIPK', d, True) |
140 | bb.error("WORKDIR not defined, unable to package") | 140 | dvar = bb.data.getVar('D', d, True) |
141 | tmpdir = bb.data.getVar('TMPDIR', d, True) | ||
142 | pkgdest = bb.data.getVar('PKGDEST', d, True) | ||
143 | if not workdir or not outdir or not dvar or not tmpdir: | ||
144 | bb.error("Variables incorrectly set, unable to package") | ||
141 | return | 145 | return |
142 | 146 | ||
143 | outdir = bb.data.getVar('DEPLOY_DIR_IPK', d, 1) | 147 | if not os.path.exists(dvar): |
144 | if not outdir: | 148 | bb.debug(1, "Nothing installed, nothing to do") |
145 | bb.error("DEPLOY_DIR_IPK not defined, unable to package") | ||
146 | return | 149 | return |
147 | 150 | ||
148 | dvar = bb.data.getVar('D', d, 1) | 151 | packages = bb.data.getVar('PACKAGES', d, True) |
149 | if not dvar: | 152 | if not packages or packages == '': |
150 | bb.error("D not defined, unable to package") | 153 | bb.debug(1, "No packages; nothing to do") |
151 | return | ||
152 | bb.mkdirhier(dvar) | ||
153 | |||
154 | packages = bb.data.getVar('PACKAGES', d, 1) | ||
155 | if not packages: | ||
156 | bb.debug(1, "PACKAGES not defined, nothing to package") | ||
157 | return | 154 | return |
158 | 155 | ||
159 | tmpdir = bb.data.getVar('TMPDIR', d, 1) | 156 | # We're about to add new packages so the index needs to be checked |
160 | 157 | # so remove the appropriate stamp file. | |
161 | if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): | 158 | if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): |
162 | os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) | 159 | os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) |
163 | 160 | ||
164 | if packages == []: | ||
165 | bb.debug(1, "No packages; nothing to do") | ||
166 | return | ||
167 | |||
168 | for pkg in packages.split(): | 161 | for pkg in packages.split(): |
169 | localdata = bb.data.createCopy(d) | 162 | localdata = bb.data.createCopy(d) |
170 | pkgdest = bb.data.getVar('PKGDEST', d, 1) | ||
171 | root = "%s/%s" % (pkgdest, pkg) | 163 | root = "%s/%s" % (pkgdest, pkg) |
172 | 164 | ||
173 | lf = bb.utils.lockfile(root + ".lock") | 165 | lf = bb.utils.lockfile(root + ".lock") |