summaryrefslogtreecommitdiff
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)
downloadopenembedded-core-c54117458a19d05d404ec00907a8f3e9c73a416b.tar.gz
openembedded-core-c54117458a19d05d404ec00907a8f3e9c73a416b.tar.bz2
openembedded-core-c54117458a19d05d404ec00907a8f3e9c73a416b.tar.xz
openembedded-core-c54117458a19d05d404ec00907a8f3e9c73a416b.zip
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 d90939fdb..5c002465b 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -15,13 +15,11 @@ DPKG_ARCH_i686 ?= "i386"
DPKG_ARCH_pentium ?= "i386"
python package_deb_fn () {
- from bb import data
bb.data.setVar('PKGFN', bb.data.getVar('PKG',d), d)
}
addtask package_deb_install
python do_package_deb_install () {
- import os, sys
pkg = bb.data.getVar('PKG', d, 1)
pkgfn = bb.data.getVar('PKGFN', d, 1)
rootfs = bb.data.getVar('IMAGE_ROOTFS', d, 1)
@@ -37,6 +35,7 @@ python do_package_deb_install () {
os.makedirs(rootfs)
os.chdir(rootfs)
except OSError:
+ import sys
raise bb.build.FuncFailed(str(sys.exc_value))
# update packages file
@@ -67,14 +66,13 @@ python do_package_deb_install () {
}
python do_package_deb () {
- import sys, re, copy
+ import re, copy
workdir = bb.data.getVar('WORKDIR', d, 1)
if not workdir:
bb.error("WORKDIR not defined, unable to package")
return
- import os # path manipulations
outdir = bb.data.getVar('DEPLOY_DIR_DEB', d, 1)
if not outdir:
bb.error("DEPLOY_DIR_DEB not defined, unable to package")
@@ -135,8 +133,7 @@ python do_package_deb () {
except ValueError:
pass
if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
- from bb import note
- note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
+ bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
bb.utils.unlockfile(lf)
continue
@@ -186,6 +183,7 @@ python do_package_deb () {
for (c, fs) in fields:
ctrlfile.write(unicode(c % tuple(pullData(fs, localdata))))
except KeyError:
+ import sys
(type, value, traceback) = sys.exc_info()
bb.utils.unlockfile(lf)
ctrlfile.close()
@@ -252,7 +250,6 @@ python do_package_deb () {
}
python () {
- import bb
if bb.data.getVar('PACKAGES', d, True) != '':
deps = (bb.data.getVarFlag('do_package_write_deb', 'depends', d) or "").split()
deps.append('dpkg-native:do_populate_staging')