1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

classes: Remove and sanitise import statements

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie
2009-11-08 22:32:43 +00:00
parent 80d55bbd6e
commit c54117458a
31 changed files with 34 additions and 147 deletions
+4 -7
View File
@@ -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')