From 81bdf9133524e76c3239f155dca9539e68032658 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 11 Nov 2009 15:36:52 +0000 Subject: classes: Drop some random import bb/os statements Signed-off-by: Richard Purdie --- classes/binconfig.bbclass | 1 - classes/manifest.bbclass | 2 +- classes/packaged-staging.bbclass | 1 - classes/patch.bbclass | 4 ---- classes/recipe_sanity.bbclass | 9 --------- recipes/addons/devshell.bb | 3 --- 6 files changed, 1 insertion(+), 19 deletions(-) diff --git a/classes/binconfig.bbclass b/classes/binconfig.bbclass index dad54a5f56..b3b2236709 100644 --- a/classes/binconfig.bbclass +++ b/classes/binconfig.bbclass @@ -2,7 +2,6 @@ FILES_${PN}-dev += "${bindir}/*-config" # The namespaces can clash here hence the two step replace def get_binconfig_mangle(d): - import bb.data s = "-e ''" if not bb.data.inherits_class('native', d): optional_quote = r"\(\"\?\)" diff --git a/classes/manifest.bbclass b/classes/manifest.bbclass index 687f4b756e..8d714d3bbc 100644 --- a/classes/manifest.bbclass +++ b/classes/manifest.bbclass @@ -1,6 +1,6 @@ python read_manifest () { - import sys, bb.manifest + import sys mfn = bb.data.getVar("MANIFEST", d, 1) if os.access(mfn, os.R_OK): # we have a manifest, so emit do_stage and do_populate_pkgs, diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass index c65efd8b12..013f22dead 100644 --- a/classes/packaged-staging.bbclass +++ b/classes/packaged-staging.bbclass @@ -27,7 +27,6 @@ PSTAGE_NATIVEDEPENDS = "\ BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}" python () { - import bb pstage_allowed = True # These classes encode staging paths into the binary data so can only be diff --git a/classes/patch.bbclass b/classes/patch.bbclass index dfb8ec960f..bb49fed7a1 100644 --- a/classes/patch.bbclass +++ b/classes/patch.bbclass @@ -76,8 +76,6 @@ def patch_init(d): def __str__(self): return "Patch Error: %s" % self.msg - import bb, bb.data, bb.fetch - class PatchSet(object): defaults = { "strippath": 1 @@ -457,8 +455,6 @@ do_patch[depends] = "${PATCHDEPENDENCY}" python patch_do_patch() { import re - import bb.fetch - patch_init(d) src_uri = (bb.data.getVar('SRC_URI', d, 1) or '').split() diff --git a/classes/recipe_sanity.bbclass b/classes/recipe_sanity.bbclass index 29f4a8fada..d929da6319 100644 --- a/classes/recipe_sanity.bbclass +++ b/classes/recipe_sanity.bbclass @@ -1,10 +1,8 @@ def __note(msg, d): - import bb bb.note("%s: recipe_sanity: %s" % (d.getVar("P", 1), msg)) __recipe_sanity_badtargetvars = "RDEPENDS RPROVIDES" def bad_target_vars(cfgdata, d): - import bb.data if bb.data.inherits_class("native", d) or \ bb.data.inherits_class("cross", d): return @@ -43,14 +41,12 @@ def var_renames_overwrite(cfgdata, d): __note("rename of variable '%s' to '%s' overwrote existing value '%s' with '%s'." % (key, newkey, oldvalue, newvalue), d) def incorrect_nonempty_PACKAGES(cfgdata, d): - import bb.data if bb.data.inherits_class("native", d) or \ bb.data.inherits_class("cross", d): if d.getVar("PACKAGES", 1): return True def can_use_autotools_base(cfgdata, d): - import bb cfg = d.getVar("do_configure", 1) if not bb.data.inherits_class("autotools", d): return False @@ -68,8 +64,6 @@ def can_use_autotools_base(cfgdata, d): return True def can_remove_FILESPATH(cfgdata, d): - import os - import bb expected = cfgdata.get("FILESPATH") #expected = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', 1).split(':') for p in d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES', 1) + ':').split(':') if os.path.exists(os.path.join(fp, p, o))])}:${FILESDIR}" expectedpaths = bb.data.expand(expected, d) @@ -84,8 +78,6 @@ def can_remove_FILESPATH(cfgdata, d): return expected != unexpanded def can_remove_FILESDIR(cfgdata, d): - import os - import bb expected = cfgdata.get("FILESDIR") #expected = "${@bb.which(d.getVar('FILESPATH', 1), '.')}" unexpanded = d.getVar("FILESDIR", 0) @@ -102,7 +94,6 @@ def can_remove_FILESDIR(cfgdata, d): expanded == bb.data.expand(expected, d)) def can_remove_others(p, cfgdata, d): - import bb for k in ["S", "PV", "PN", "DESCRIPTION", "LICENSE", "DEPENDS", "SECTION", "PACKAGES", "EXTRA_OECONF", "EXTRA_OEMAKE"]: #for k in cfgdata: diff --git a/recipes/addons/devshell.bb b/recipes/addons/devshell.bb index 9ac6821e0e..5921125d12 100644 --- a/recipes/addons/devshell.bb +++ b/recipes/addons/devshell.bb @@ -11,9 +11,6 @@ do_configure() { def devshell_emit_env(o, d, all=False, funcwhitelist=None): """Emits all items in the data store in a format such that it can be sourced by a shell.""" - import bb - import bb.data - env = bb.data.keys(d) for e in env: -- cgit v1.2.3