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
-9
View File
@@ -1,5 +1,4 @@
def packaged(pkg, d):
import os, bb
return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
def read_pkgdatafile(fn):
@@ -10,7 +9,6 @@ def read_pkgdatafile(fn):
c = codecs.getdecoder("string_escape")
return c(str)[0]
import os
if os.access(fn, os.R_OK):
import re
f = file(fn, 'r')
@@ -25,7 +23,6 @@ def read_pkgdatafile(fn):
return pkgdata
def get_subpkgedata_fn(pkg, d):
import bb, os
archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
archs.reverse()
pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d)
@@ -37,25 +34,20 @@ def get_subpkgedata_fn(pkg, d):
return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)
def has_subpkgdata(pkg, d):
import bb, os
return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
def read_subpkgdata(pkg, d):
import bb
return read_pkgdatafile(get_subpkgedata_fn(pkg, d))
def has_pkgdata(pn, d):
import bb, os
fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
return os.access(fn, os.R_OK)
def read_pkgdata(pn, d):
import bb
fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
return read_pkgdatafile(fn)
python read_subpackage_metadata () {
import bb
data = read_pkgdata(bb.data.getVar('PN', d, 1), d)
for key in data.keys():
@@ -72,7 +64,6 @@ python read_subpackage_metadata () {
# Collapse FOO_pkg variables into FOO
#
def read_subpkgdata_dict(pkg, d):
import bb
ret = {}
subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
for var in subd: