summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_ipk.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-08 22:32:43 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-13 12:15:28 +0000
commitc54117458a19d05d404ec00907a8f3e9c73a416b (patch)
tree6cc5695742a1198668b022b35c8b2a456c4f3f4f /meta/classes/package_ipk.bbclass
parent80d55bbd6ea2ff93510f3b87ea97322b0b02eaa8 (diff)
downloadpoky-c54117458a19d05d404ec00907a8f3e9c73a416b.tar.gz
classes: Remove and sanitise import statements
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/package_ipk.bbclass')
-rw-r--r--meta/classes/package_ipk.bbclass11
1 files changed, 4 insertions, 7 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 68a8b5c40b..2621fa8e91 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -6,12 +6,10 @@ IPKGCONF_TARGET = "${WORKDIR}/opkg.conf"
6IPKGCONF_SDK = "${WORKDIR}/opkg-sdk.conf" 6IPKGCONF_SDK = "${WORKDIR}/opkg-sdk.conf"
7 7
8python package_ipk_fn () { 8python package_ipk_fn () {
9 from bb import data
10 bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) 9 bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d)
11} 10}
12 11
13python package_ipk_install () { 12python package_ipk_install () {
14 import os, sys
15 pkg = bb.data.getVar('PKG', d, 1) 13 pkg = bb.data.getVar('PKG', d, 1)
16 pkgfn = bb.data.getVar('PKGFN', d, 1) 14 pkgfn = bb.data.getVar('PKGFN', d, 1)
17 rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1) 15 rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1)
@@ -25,6 +23,7 @@ python package_ipk_install () {
25 bb.mkdirhier(rootfs) 23 bb.mkdirhier(rootfs)
26 os.chdir(rootfs) 24 os.chdir(rootfs)
27 except OSError: 25 except OSError:
26 import sys
28 (type, value, traceback) = sys.exc_info() 27 (type, value, traceback) = sys.exc_info()
29 print value 28 print value
30 raise bb.build.FuncFailed 29 raise bb.build.FuncFailed
@@ -126,14 +125,13 @@ package_generate_archlist () {
126} 125}
127 126
128python do_package_ipk () { 127python do_package_ipk () {
129 import sys, re, copy 128 import re, copy
130 129
131 workdir = bb.data.getVar('WORKDIR', d, 1) 130 workdir = bb.data.getVar('WORKDIR', d, 1)
132 if not workdir: 131 if not workdir:
133 bb.error("WORKDIR not defined, unable to package") 132 bb.error("WORKDIR not defined, unable to package")
134 return 133 return
135 134
136 import os # path manipulations
137 outdir = bb.data.getVar('DEPLOY_DIR_IPK', d, 1) 135 outdir = bb.data.getVar('DEPLOY_DIR_IPK', d, 1)
138 if not outdir: 136 if not outdir:
139 bb.error("DEPLOY_DIR_IPK not defined, unable to package") 137 bb.error("DEPLOY_DIR_IPK not defined, unable to package")
@@ -192,8 +190,7 @@ python do_package_ipk () {
192 except ValueError: 190 except ValueError:
193 pass 191 pass
194 if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1": 192 if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
195 from bb import note 193 bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
196 note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
197 bb.utils.unlockfile(lf) 194 bb.utils.unlockfile(lf)
198 continue 195 continue
199 196
@@ -234,6 +231,7 @@ python do_package_ipk () {
234 raise KeyError(f) 231 raise KeyError(f)
235 ctrlfile.write(c % tuple(pullData(fs, localdata))) 232 ctrlfile.write(c % tuple(pullData(fs, localdata)))
236 except KeyError: 233 except KeyError:
234 import sys
237 (type, value, traceback) = sys.exc_info() 235 (type, value, traceback) = sys.exc_info()
238 ctrlfile.close() 236 ctrlfile.close()
239 bb.utils.unlockfile(lf) 237 bb.utils.unlockfile(lf)
@@ -302,7 +300,6 @@ python do_package_ipk () {
302} 300}
303 301
304python () { 302python () {
305 import bb
306 if bb.data.getVar('PACKAGES', d, True) != '': 303 if bb.data.getVar('PACKAGES', d, True) != '':
307 deps = (bb.data.getVarFlag('do_package_write_ipk', 'depends', d) or "").split() 304 deps = (bb.data.getVarFlag('do_package_write_ipk', 'depends', d) or "").split()
308 deps.append('opkg-utils-native:do_populate_staging') 305 deps.append('opkg-utils-native:do_populate_staging')