From 7d674820958be3a7051ea619effe1a6061d9cbe2 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 18 Jul 2012 13:08:48 +0000 Subject: Remove a number of unneeded import os/bb calls The bb and os modules are always imported so having these extra import calls are a waste of space/execution time. They also set a bad example for people copy and pasting code so clean them up. Signed-off-by: Richard Purdie --- meta/classes/base.bbclass | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'meta/classes/base.bbclass') diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index f3587bcbef..1f7602394e 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -14,7 +14,7 @@ OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.packagegroup oe.sstatesig OE_IMPORTS[type] = "list" def oe_import(d): - import os, sys + import sys bbpath = d.getVar("BBPATH", True).split(":") sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath] @@ -117,11 +117,9 @@ GIT_CONFIG_PATH = "${STAGING_DIR_NATIVE}/etc" GIT_CONFIG = "${GIT_CONFIG_PATH}/gitconfig" def generate_git_config(e): - from bb import data - - if data.getVar('GIT_CORE_CONFIG', e.data, True): + if e.data.getVar('GIT_CORE_CONFIG', True): gitconfig_path = e.data.getVar('GIT_CONFIG', True) - proxy_command = " gitProxy = %s\n" % data.getVar('OE_GIT_PROXY_COMMAND', e.data, True) + proxy_command = " gitProxy = %s\n" % e.data.getVar('OE_GIT_PROXY_COMMAND', True) bb.mkdirhier(e.data.expand("${GIT_CONFIG_PATH}")) if (os.path.exists(gitconfig_path)): @@ -129,7 +127,7 @@ def generate_git_config(e): f = open(gitconfig_path, 'w') f.write("[core]\n") - ignore_hosts = data.getVar('GIT_PROXY_IGNORE', e.data, True).split() + ignore_hosts = e.data.getVar('GIT_PROXY_IGNORE', True).split() for ignore_host in ignore_hosts: f.write(" gitProxy = none for %s\n" % ignore_host) f.write(proxy_command) -- cgit 1.2.3-korg