summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_deb.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_deb.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_deb.bbclass')
-rw-r--r--meta/classes/package_deb.bbclass11
1 files changed, 4 insertions, 7 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index d90939fdb6..5c002465b8 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -15,13 +15,11 @@ DPKG_ARCH_i686 ?= "i386"
15DPKG_ARCH_pentium ?= "i386" 15DPKG_ARCH_pentium ?= "i386"
16 16
17python package_deb_fn () { 17python package_deb_fn () {
18 from bb import data
19 bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d) 18 bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d)
20} 19}
21 20
22addtask package_deb_install 21addtask package_deb_install
23python do_package_deb_install () { 22python do_package_deb_install () {
24 import os, sys
25 pkg = bb.data.getVar('PKG', d, 1) 23 pkg = bb.data.getVar('PKG', d, 1)
26 pkgfn = bb.data.getVar('PKGFN', d, 1) 24 pkgfn = bb.data.getVar('PKGFN', d, 1)
27 rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1) 25 rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1)
@@ -37,6 +35,7 @@ python do_package_deb_install () {
37 os.makedirs(rootfs) 35 os.makedirs(rootfs)
38 os.chdir(rootfs) 36 os.chdir(rootfs)
39 except OSError: 37 except OSError:
38 import sys
40 raise bb.build.FuncFailed(str(sys.exc_value)) 39 raise bb.build.FuncFailed(str(sys.exc_value))
41 40
42 # update packages file 41 # update packages file
@@ -67,14 +66,13 @@ python do_package_deb_install () {
67} 66}
68 67
69python do_package_deb () { 68python do_package_deb () {
70 import sys, re, copy 69 import re, copy
71 70
72 workdir = bb.data.getVar('WORKDIR', d, 1) 71 workdir = bb.data.getVar('WORKDIR', d, 1)
73 if not workdir: 72 if not workdir:
74 bb.error("WORKDIR not defined, unable to package") 73 bb.error("WORKDIR not defined, unable to package")
75 return 74 return
76 75
77 import os # path manipulations
78 outdir = bb.data.getVar('DEPLOY_DIR_DEB', d, 1) 76 outdir = bb.data.getVar('DEPLOY_DIR_DEB', d, 1)
79 if not outdir: 77 if not outdir:
80 bb.error("DEPLOY_DIR_DEB not defined, unable to package") 78 bb.error("DEPLOY_DIR_DEB not defined, unable to package")
@@ -135,8 +133,7 @@ python do_package_deb () {
135 except ValueError: 133 except ValueError:
136 pass 134 pass
137 if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1": 135 if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
138 from bb import note 136 bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
139 note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
140 bb.utils.unlockfile(lf) 137 bb.utils.unlockfile(lf)
141 continue 138 continue
142 139
@@ -186,6 +183,7 @@ python do_package_deb () {
186 for (c, fs) in fields: 183 for (c, fs) in fields:
187 ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)))) 184 ctrlfile.write(unicode(c % tuple(pullData(fs, localdata))))
188 except KeyError: 185 except KeyError:
186 import sys
189 (type, value, traceback) = sys.exc_info() 187 (type, value, traceback) = sys.exc_info()
190 bb.utils.unlockfile(lf) 188 bb.utils.unlockfile(lf)
191 ctrlfile.close() 189 ctrlfile.close()
@@ -252,7 +250,6 @@ python do_package_deb () {
252} 250}
253 251
254python () { 252python () {
255 import bb
256 if bb.data.getVar('PACKAGES', d, True) != '': 253 if bb.data.getVar('PACKAGES', d, True) != '':
257 deps = (bb.data.getVarFlag('do_package_write_deb', 'depends', d) or "").split() 254 deps = (bb.data.getVarFlag('do_package_write_deb', 'depends', d) or "").split()
258 deps.append('dpkg-native:do_populate_staging') 255 deps.append('dpkg-native:do_populate_staging')