Kaynağa Gözat

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.

(From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 13 yıl önce
ebeveyn
işleme
73cf0335c4
43 değiştirilmiş dosya ile 58 ekleme ve 135 silme
  1. 0 3
      meta/classes/archiver.bbclass
  2. 4 6
      meta/classes/base.bbclass
  3. 1 1
      meta/classes/bugzilla.bbclass
  4. 0 3
      meta/classes/buildhistory.bbclass
  5. 0 1
      meta/classes/copyleft_compliance.bbclass
  6. 0 3
      meta/classes/distrodata.bbclass
  7. 0 1
      meta/classes/imagetest-qemu.bbclass
  8. 1 1
      meta/classes/kernel-yocto.bbclass
  9. 1 1
      meta/classes/libc-package.bbclass
  10. 0 2
      meta/classes/license.bbclass
  11. 1 1
      meta/classes/package.bbclass
  12. 0 3
      meta/classes/package_rpm.bbclass
  13. 0 2
      meta/classes/qemu.bbclass
  14. 1 4
      meta/classes/recipe_sanity.bbclass
  15. 2 5
      meta/classes/sanity.bbclass
  16. 43 55
      meta/classes/tinderclient.bbclass
  17. 0 2
      meta/conf/distro/include/csl-versions.inc
  18. 0 1
      meta/conf/distro/include/tcmode-external-sourcery.inc
  19. 0 1
      meta/lib/oe/data.py
  20. 0 1
      meta/lib/oe/maketype.py
  21. 0 2
      meta/lib/oe/packagedata.py
  22. 0 2
      meta/lib/oe/patch.py
  23. 0 2
      meta/lib/oe/path.py
  24. 0 1
      meta/lib/oe/prservice.py
  25. 0 1
      meta/lib/oe/terminal.py
  26. 0 2
      meta/lib/oe/utils.py
  27. 1 1
      meta/recipes-core/eglibc/eglibc_2.15.bb
  28. 1 1
      meta/recipes-core/eglibc/eglibc_2.16.bb
  29. 0 2
      meta/recipes-core/tasks/task-base.bb
  30. 0 1
      meta/recipes-devtools/apt/apt-package.inc
  31. 0 2
      meta/recipes-extended/pam/libpam_1.1.5.bb
  32. 0 2
      meta/recipes-gnome/gtk+/gtk+_2.12.7.bb
  33. 0 2
      meta/recipes-gnome/gtk+/gtk+_2.16.6.bb
  34. 0 2
      meta/recipes-gnome/gtk+/gtk+_2.24.8.bb
  35. 0 2
      meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
  36. 0 1
      meta/recipes-graphics/directfb/directfb.inc
  37. 0 2
      meta/recipes-graphics/mesa/mesa-dri.inc
  38. 0 2
      meta/recipes-kernel/linux/linux-dtb.inc
  39. 0 1
      meta/recipes-qt/qt-apps/qmmp_0.5.2.bb
  40. 1 3
      meta/recipes-qt/qt4/qt4.inc
  41. 0 1
      meta/recipes-sato/puzzles/oh-puzzles_git.bb
  42. 0 2
      meta/recipes-support/boost/boost.inc
  43. 1 1
      meta/recipes-support/pth/pth_2.0.7.bb

+ 0 - 3
meta/classes/archiver.bbclass

@@ -76,7 +76,6 @@ def tar_filter(d):
 def get_bb_inc(d):
 def get_bb_inc(d):
 	'''create a directory "script-logs" including .bb and .inc file in ${WORKDIR}'''
 	'''create a directory "script-logs" including .bb and .inc file in ${WORKDIR}'''
 	import re
 	import re
-	import os
 	import shutil
 	import shutil
 	
 	
 	bbinc = []
 	bbinc = []
@@ -154,7 +153,6 @@ def get_series(d):
 
 
 def get_applying_patches(d):
 def get_applying_patches(d):
 	"""only copy applying patches to a pointed directory which will be archived to tarball"""
 	"""only copy applying patches to a pointed directory which will be archived to tarball"""
-	import os
 	import shutil
 	import shutil
 
 
 
 
@@ -174,7 +172,6 @@ def get_applying_patches(d):
 
 
 def not_tarball(d):
 def not_tarball(d):
 	'''packages including key words 'work-shared','native', 'task-' will be passed'''
 	'''packages including key words 'work-shared','native', 'task-' will be passed'''
-	import os
 
 
 	workdir = d.getVar('WORKDIR',True)
 	workdir = d.getVar('WORKDIR',True)
 	s = d.getVar('S',True)
 	s = d.getVar('S',True)

+ 4 - 6
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"
 OE_IMPORTS[type] = "list"
 
 
 def oe_import(d):
 def oe_import(d):
-    import os, sys
+    import sys
 
 
     bbpath = d.getVar("BBPATH", True).split(":")
     bbpath = d.getVar("BBPATH", True).split(":")
     sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
     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"
 GIT_CONFIG = "${GIT_CONFIG_PATH}/gitconfig"
 
 
 def generate_git_config(e):
 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)
         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}"))
         bb.mkdirhier(e.data.expand("${GIT_CONFIG_PATH}"))
         if (os.path.exists(gitconfig_path)):
         if (os.path.exists(gitconfig_path)):
@@ -129,7 +127,7 @@ def generate_git_config(e):
 
 
         f = open(gitconfig_path, 'w')
         f = open(gitconfig_path, 'w')
         f.write("[core]\n")
         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:
         for ignore_host in ignore_hosts:
             f.write("    gitProxy = none for %s\n" % ignore_host)
             f.write("    gitProxy = none for %s\n" % ignore_host)
         f.write(proxy_command)
         f.write(proxy_command)

+ 1 - 1
meta/classes/bugzilla.bbclass

@@ -72,7 +72,7 @@ def bugzilla_add_comment(debug_file, server, args, bug_number, text):
 
 
 addhandler bugzilla_eventhandler
 addhandler bugzilla_eventhandler
 python bugzilla_eventhandler() {
 python bugzilla_eventhandler() {
-    import bb, os, glob
+    import glob
     import xmlrpclib, httplib
     import xmlrpclib, httplib
 
 
     class ProxiedTransport(xmlrpclib.Transport):
     class ProxiedTransport(xmlrpclib.Transport):

+ 0 - 3
meta/classes/buildhistory.bbclass

@@ -414,9 +414,6 @@ buildhistory_commit() {
 }
 }
 
 
 python buildhistory_eventhandler() {
 python buildhistory_eventhandler() {
-	import bb.build
-	import bb.event
-
 	if isinstance(e, bb.event.BuildCompleted):
 	if isinstance(e, bb.event.BuildCompleted):
 		if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
 		if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
 			if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":
 			if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":

+ 0 - 1
meta/classes/copyleft_compliance.bbclass

@@ -58,7 +58,6 @@ def copyleft_should_include(d):
 
 
 python do_prepare_copyleft_sources () {
 python do_prepare_copyleft_sources () {
     """Populate a tree of the recipe sources and emit patch series files"""
     """Populate a tree of the recipe sources and emit patch series files"""
-    import os.path
     import shutil
     import shutil
 
 
     p = d.getVar('P', True)
     p = d.getVar('P', True)

+ 0 - 3
meta/classes/distrodata.bbclass

@@ -654,7 +654,6 @@ do_distro_check[nostamp] = "1"
 python do_distro_check() {
 python do_distro_check() {
     """checks if the package is present in other public Linux distros"""
     """checks if the package is present in other public Linux distros"""
     import oe.distro_check as dc
     import oe.distro_check as dc
-    import bb
     import shutil
     import shutil
     if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk',d):
     if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk',d):
         return
         return
@@ -704,8 +703,6 @@ python checklicense_eventhandler() {
 addtask checklicense
 addtask checklicense
 do_checklicense[nostamp] = "1"
 do_checklicense[nostamp] = "1"
 python do_checklicense() {
 python do_checklicense() {
-    import os
-    import bb
     import shutil
     import shutil
     logpath = d.getVar('LOG_DIR', True)
     logpath = d.getVar('LOG_DIR', True)
     bb.utils.mkdirhier(logpath)
     bb.utils.mkdirhier(logpath)

+ 0 - 1
meta/classes/imagetest-qemu.bbclass

@@ -26,7 +26,6 @@ do_qemuimagetest_standalone[depends] += "qemu-native:do_populate_sysroot"
 def qemuimagetest_main(d):
 def qemuimagetest_main(d):
     import sys
     import sys
     import re
     import re
-    import os
     import shutil
     import shutil
     import subprocess
     import subprocess
     
     

+ 1 - 1
meta/classes/kernel-yocto.bbclass

@@ -188,7 +188,7 @@ do_kernel_configme() {
 }
 }
 
 
 python do_kernel_configcheck() {
 python do_kernel_configcheck() {
-    import bb, re, string, sys, commands
+    import re, string, sys, commands
 
 
     bb.plain("NOTE: validating kernel configuration")
     bb.plain("NOTE: validating kernel configuration")
 
 

+ 1 - 1
meta/classes/libc-package.bbclass

@@ -118,7 +118,7 @@ do_collect_bins_from_locale_tree() {
 inherit qemu
 inherit qemu
 
 
 python package_do_split_gconvs () {
 python package_do_split_gconvs () {
-    import os, re
+    import re
     if (d.getVar('PACKAGE_NO_GCONV', True) == '1'):
     if (d.getVar('PACKAGE_NO_GCONV', True) == '1'):
         bb.note("package requested not splitting gconvs")
         bb.note("package requested not splitting gconvs")
         return
         return

+ 0 - 2
meta/classes/license.bbclass

@@ -143,8 +143,6 @@ python do_populate_lic() {
     """
     """
     Populate LICENSE_DIRECTORY with licenses.
     Populate LICENSE_DIRECTORY with licenses.
     """
     """
-    import os
-    import bb
     import shutil
     import shutil
     import oe.license
     import oe.license
 
 

+ 1 - 1
meta/classes/package.bbclass

@@ -444,7 +444,7 @@ python perform_packagecopy () {
 # seeding this list with reasonable defaults, then load from
 # seeding this list with reasonable defaults, then load from
 # the fs-perms.txt files
 # the fs-perms.txt files
 python fixup_perms () {
 python fixup_perms () {
-    import os, pwd, grp
+    import pwd, grp
 
 
     # init using a string with the same format as a line as documented in
     # init using a string with the same format as a line as documented in
     # the fs-perms.txt file
     # the fs-perms.txt file

+ 0 - 3
meta/classes/package_rpm.bbclass

@@ -637,7 +637,6 @@ python write_specfile () {
                     array.append("%s: %s" % (tag, dep))
                     array.append("%s: %s" % (tag, dep))
 
 
     def walk_files(walkpath, target, conffiles):
     def walk_files(walkpath, target, conffiles):
-        import os
         for rootpath, dirs, files in os.walk(walkpath):
         for rootpath, dirs, files in os.walk(walkpath):
             path = rootpath.replace(walkpath, "")
             path = rootpath.replace(walkpath, "")
             for dir in dirs:
             for dir in dirs:
@@ -996,8 +995,6 @@ python write_specfile () {
 }
 }
 
 
 python do_package_rpm () {
 python do_package_rpm () {
-    import os
-    
     def creat_srpm_dir(d):
     def creat_srpm_dir(d):
         if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM':
         if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM':
             clean_licenses = get_licenses(d)
             clean_licenses = get_licenses(d)

+ 0 - 2
meta/classes/qemu.bbclass

@@ -4,8 +4,6 @@
 #
 #
 
 
 def qemu_target_binary(data):
 def qemu_target_binary(data):
-    import bb
-
     target_arch = data.getVar("TARGET_ARCH", True)
     target_arch = data.getVar("TARGET_ARCH", True)
     if target_arch in ("i486", "i586", "i686"):
     if target_arch in ("i486", "i586", "i686"):
         target_arch = "i386"
         target_arch = "i386"

+ 1 - 4
meta/classes/recipe_sanity.bbclass

@@ -55,7 +55,6 @@ def can_use_autotools_base(cfgdata, d):
         if cfg.find(i) != -1:
         if cfg.find(i) != -1:
             return False
             return False
 
 
-    import os
     for clsfile in d.getVar("__inherit_cache", 0):
     for clsfile in d.getVar("__inherit_cache", 0):
         (base, _) = os.path.splitext(os.path.basename(clsfile))
         (base, _) = os.path.splitext(os.path.basename(clsfile))
         if cfg.find("%s_do_configure" % base) != -1:
         if cfg.find("%s_do_configure" % base) != -1:
@@ -146,9 +145,7 @@ do_recipe_sanity_all () {
 addtask recipe_sanity_all after do_recipe_sanity
 addtask recipe_sanity_all after do_recipe_sanity
 
 
 python recipe_sanity_eh () {
 python recipe_sanity_eh () {
-    from bb.event import getName
-
-    if getName(e) != "ConfigParsed":
+    if bb.event.getName(e) != "ConfigParsed":
         return
         return
 
 
     d = e.data
     d = e.data

+ 2 - 5
meta/classes/sanity.bbclass

@@ -254,8 +254,6 @@ def check_supported_distro(sanity_data):
 
 
 # Checks we should only make if MACHINE is set correctly
 # Checks we should only make if MACHINE is set correctly
 def check_sanity_validmachine(sanity_data):
 def check_sanity_validmachine(sanity_data):
-    from bb import data
-
     messages = ""
     messages = ""
 
 
     # Check TUNE_ARCH is set
     # Check TUNE_ARCH is set
@@ -291,7 +289,6 @@ def check_sanity_validmachine(sanity_data):
 
 
 
 
 def check_sanity(sanity_data):
 def check_sanity(sanity_data):
-    from bb import note, error, data, __version__
     import subprocess
     import subprocess
 
 
     try:
     try:
@@ -319,8 +316,8 @@ def check_sanity(sanity_data):
     if sys.hexversion < 0x020600F0:
     if sys.hexversion < 0x020600F0:
         messages = messages + 'The system requires at least Python 2.6 to run. Please update your Python interpreter.\n'
         messages = messages + 'The system requires at least Python 2.6 to run. Please update your Python interpreter.\n'
 
 
-    if (LooseVersion(__version__) < LooseVersion(minversion)):
-        messages = messages + 'Bitbake version %s is required and version %s was found\n' % (minversion, __version__)
+    if (LooseVersion(bb.__version__) < LooseVersion(minversion)):
+        messages = messages + 'Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__)
 
 
     # Check that the MACHINE is valid, if it is set
     # Check that the MACHINE is valid, if it is set
     if sanity_data.getVar('MACHINE', True):
     if sanity_data.getVar('MACHINE', True):

+ 43 - 55
meta/classes/tinderclient.bbclass

@@ -55,22 +55,22 @@ def tinder_format_http_post(d,status,log):
 
 
     # the variables we will need to send on this form post
     # the variables we will need to send on this form post
     variables =  {
     variables =  {
-        "tree"         : data.getVar('TINDER_TREE',    d, True),
-        "machine_name" : data.getVar('TINDER_MACHINE', d, True),
+        "tree"         : d.getVar('TINDER_TREE', True),
+        "machine_name" : d.getVar('TINDER_MACHINE', True),
         "os"           : os.uname()[0],
         "os"           : os.uname()[0],
         "os_version"   : os.uname()[2],
         "os_version"   : os.uname()[2],
         "compiler"     : "gcc",
         "compiler"     : "gcc",
-        "clobber"      : data.getVar('TINDER_CLOBBER', d, True) or "0",
-        "srcdate"      : data.getVar('SRCDATE', d, True),
-        "PN"           : data.getVar('PN', d, True),
-        "PV"           : data.getVar('PV', d, True),
-        "PR"           : data.getVar('PR', d, True),
-        "FILE"         : data.getVar('FILE', d, True) or "N/A",
-        "TARGETARCH"   : data.getVar('TARGET_ARCH', d, True),
-        "TARGETFPU"    : data.getVar('TARGET_FPU', d, True) or "Unknown",
-        "TARGETOS"     : data.getVar('TARGET_OS', d, True) or "Unknown",
-        "MACHINE"      : data.getVar('MACHINE', d, True) or "Unknown",
-        "DISTRO"       : data.getVar('DISTRO', d, True) or "Unknown",
+        "clobber"      : d.getVar('TINDER_CLOBBER', True) or "0",
+        "srcdate"      : d.getVar('SRCDATE', True),
+        "PN"           : d.getVar('PN', True),
+        "PV"           : d.getVar('PV', True),
+        "PR"           : d.getVar('PR', True),
+        "FILE"         : d.getVar('FILE', True) or "N/A",
+        "TARGETARCH"   : d.getVar('TARGET_ARCH', True),
+        "TARGETFPU"    : d.getVar('TARGET_FPU', True) or "Unknown",
+        "TARGETOS"     : d.getVar('TARGET_OS', True) or "Unknown",
+        "MACHINE"      : d.getVar('MACHINE', True) or "Unknown",
+        "DISTRO"       : d.getVar('DISTRO', True) or "Unknown",
         "zecke-rocks"  : "sure",
         "zecke-rocks"  : "sure",
     }
     }
 
 
@@ -82,7 +82,7 @@ def tinder_format_http_post(d,status,log):
     # we only need on build_status.pl but sending it
     # we only need on build_status.pl but sending it
     # always does not hurt
     # always does not hurt
     try:
     try:
-        f = file(data.getVar('TMPDIR',d,True)+'/tinder-machine.id', 'r')
+        f = file(d.getVar('TMPDIR',True)+'/tinder-machine.id', 'r')
         id = f.read()
         id = f.read()
         variables['machine_id'] = id
         variables['machine_id'] = id
     except:
     except:
@@ -103,12 +103,11 @@ def tinder_build_start(d):
     by posting our name and tree to the build_start.pl script
     by posting our name and tree to the build_start.pl script
     on the server.
     on the server.
     """
     """
-    from bb import data
 
 
     # get the body and type
     # get the body and type
     content_type, body = tinder_format_http_post(d,None,None)
     content_type, body = tinder_format_http_post(d,None,None)
-    server = data.getVar('TINDER_HOST', d, True )
-    url    = data.getVar('TINDER_URL',  d, True )
+    server = d.getVar('TINDER_HOST', True )
+    url    = d.getVar('TINDER_URL', True )
 
 
     selector = url + "/xml/build_start.pl"
     selector = url + "/xml/build_start.pl"
 
 
@@ -128,7 +127,7 @@ def tinder_build_start(d):
 
 
     # now we will need to save the machine number
     # now we will need to save the machine number
     # we will override any previous numbers
     # we will override any previous numbers
-    f = file(data.getVar('TMPDIR', d, True)+"/tinder-machine.id", 'w')
+    f = file(d.getVar('TMPDIR', True)+"/tinder-machine.id", 'w')
     f.write(report)
     f.write(report)
 
 
 
 
@@ -136,12 +135,10 @@ def tinder_send_http(d, status, _log):
     """
     """
     Send this log as build status
     Send this log as build status
     """
     """
-    from bb import data
-
 
 
     # get the body and type
     # get the body and type
-    server = data.getVar('TINDER_HOST', d, True )
-    url    = data.getVar('TINDER_URL',  d, True )
+    server = d.getVar('TINDER_HOST', True)
+    url    = d.getVar('TINDER_URL', True)
 
 
     selector = url + "/xml/build_status.pl"
     selector = url + "/xml/build_status.pl"
 
 
@@ -162,22 +159,20 @@ def tinder_print_info(d):
         we use.
         we use.
     """
     """
 
 
-    from   bb import data
     # get the local vars
     # get the local vars
-
     time    = tinder_time_string()
     time    = tinder_time_string()
     ops     = os.uname()[0]
     ops     = os.uname()[0]
     version = os.uname()[2]
     version = os.uname()[2]
-    url     = data.getVar( 'TINDER_URL' , d, True )
-    tree    = data.getVar( 'TINDER_TREE', d, True )
-    branch  = data.getVar( 'TINDER_BRANCH', d, True )
-    srcdate = data.getVar( 'SRCDATE', d, True )
-    machine = data.getVar( 'MACHINE', d, True )
-    distro  = data.getVar( 'DISTRO',  d, True )
-    bbfiles = data.getVar( 'BBFILES', d, True )
-    tarch   = data.getVar( 'TARGET_ARCH', d, True )
-    fpu     = data.getVar( 'TARGET_FPU', d, True )
-    oerev   = data.getVar( 'OE_REVISION', d, True ) or "unknown"
+    url     = d.getVar( 'TINDER_URL' , True )
+    tree    = d.getVar( 'TINDER_TREE', True )
+    branch  = d.getVar( 'TINDER_BRANCH', True )
+    srcdate = d.getVar( 'SRCDATE', True )
+    machine = d.getVar( 'MACHINE', True )
+    distro  = d.getVar( 'DISTRO', True )
+    bbfiles = d.getVar( 'BBFILES', True )
+    tarch   = d.getVar( 'TARGET_ARCH', True )
+    fpu     = d.getVar( 'TARGET_FPU', True )
+    oerev   = d.getVar( 'OE_REVISION', True ) or "unknown"
 
 
     # there is a bug with tipple quoted strings
     # there is a bug with tipple quoted strings
     # i will work around but will fix the original
     # i will work around but will fix the original
@@ -212,8 +207,6 @@ def tinder_print_env():
     """
     """
     Print the environment variables of this build
     Print the environment variables of this build
     """
     """
-    from bb import data
-
     time_start = tinder_time_string()
     time_start = tinder_time_string()
     time_end   = tinder_time_string()
     time_end   = tinder_time_string()
 
 
@@ -272,12 +265,10 @@ def tinder_do_tinder_report(event):
     BuildCompleted Event. In this case we have to look up the status and
     BuildCompleted Event. In this case we have to look up the status and
     send it instead of 100/success.
     send it instead of 100/success.
     """
     """
-    from bb.event import getName
-    from bb import data, mkdirhier, build
     import glob
     import glob
 
 
     # variables
     # variables
-    name = getName(event)
+    name = bb.event.getName(event)
     log  = ""
     log  = ""
     status = 1
     status = 1
     # Check what we need to do Build* shows we start or are done
     # Check what we need to do Build* shows we start or are done
@@ -287,7 +278,7 @@ def tinder_do_tinder_report(event):
 
 
         try:
         try:
             # truncate the tinder log file
             # truncate the tinder log file
-            f = file(data.getVar('TINDER_LOG', event.data, True), 'w')
+            f = file(event.data.getVar('TINDER_LOG', True), 'w')
             f.write("")
             f.write("")
             f.close()
             f.close()
         except:
         except:
@@ -296,7 +287,7 @@ def tinder_do_tinder_report(event):
         try:
         try:
             # write a status to the file. This is needed for the -k option
             # write a status to the file. This is needed for the -k option
             # of BitBake
             # of BitBake
-            g = file(data.getVar('TMPDIR', event.data, True)+"/tinder-status", 'w')
+            g = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
             g.write("")
             g.write("")
             g.close()
             g.close()
         except IOError:
         except IOError:
@@ -305,10 +296,10 @@ def tinder_do_tinder_report(event):
     # Append the Task-Log (compile,configure...) to the log file
     # Append the Task-Log (compile,configure...) to the log file
     # we will send to the server
     # we will send to the server
     if name == "TaskSucceeded" or name == "TaskFailed":
     if name == "TaskSucceeded" or name == "TaskFailed":
-        log_file = glob.glob("%s/log.%s.*" % (data.getVar('T', event.data, True), event.task))
+        log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T', True), event.task))
 
 
         if len(log_file) != 0:
         if len(log_file) != 0:
-            to_file  = data.getVar('TINDER_LOG', event.data, True)
+            to_file  = event.data.getVar('TINDER_LOG', True)
             log     += "".join(open(log_file[0], 'r').readlines())
             log     += "".join(open(log_file[0], 'r').readlines())
 
 
     # set the right 'HEADER'/Summary for the TinderBox
     # set the right 'HEADER'/Summary for the TinderBox
@@ -319,23 +310,23 @@ def tinder_do_tinder_report(event):
     elif name == "TaskFailed":
     elif name == "TaskFailed":
         log += "<--- TINDERBOX Task %s failed (FAILURE)\n" % event.task
         log += "<--- TINDERBOX Task %s failed (FAILURE)\n" % event.task
     elif name == "PkgStarted":
     elif name == "PkgStarted":
-        log += "---> TINDERBOX Package %s started\n" % data.getVar('PF', event.data, True)
+        log += "---> TINDERBOX Package %s started\n" % event.data.getVar('PF', True)
     elif name == "PkgSucceeded":
     elif name == "PkgSucceeded":
-        log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % data.getVar('PF', event.data, True)
+        log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % event.data.getVar('PF', True)
     elif name == "PkgFailed":
     elif name == "PkgFailed":
-        if not data.getVar('TINDER_AUTOBUILD', event.data, True) == "0":
+        if not event.data.getVar('TINDER_AUTOBUILD', True) == "0":
             build.exec_task('do_clean', event.data)
             build.exec_task('do_clean', event.data)
-        log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % data.getVar('PF', event.data, True)
+        log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF', True)
         status = 200
         status = 200
         # remember the failure for the -k case
         # remember the failure for the -k case
-        h = file(data.getVar('TMPDIR', event.data, True)+"/tinder-status", 'w')
+        h = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
         h.write("200")
         h.write("200")
     elif name == "BuildCompleted":
     elif name == "BuildCompleted":
         log += "Build Completed\n"
         log += "Build Completed\n"
         status = 100
         status = 100
         # Check if we have a old status...
         # Check if we have a old status...
         try:
         try:
-            h = file(data.getVar('TMPDIR',event.data,True)+'/tinder-status', 'r')
+            h = file(event.data.getVar('TMPDIR',True)+'/tinder-status', 'r')
             status = int(h.read())
             status = int(h.read())
         except:
         except:
             pass
             pass
@@ -351,7 +342,7 @@ def tinder_do_tinder_report(event):
         log += "Error:Was Runtime: %d\n" % event.isRuntime()
         log += "Error:Was Runtime: %d\n" % event.isRuntime()
         status = 200
         status = 200
         # remember the failure for the -k case
         # remember the failure for the -k case
-        h = file(data.getVar('TMPDIR', event.data, True)+"/tinder-status", 'w')
+        h = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
         h.write("200")
         h.write("200")
 
 
     # now post the log
     # now post the log
@@ -366,13 +357,10 @@ def tinder_do_tinder_report(event):
 # we want to be an event handler
 # we want to be an event handler
 addhandler tinderclient_eventhandler
 addhandler tinderclient_eventhandler
 python tinderclient_eventhandler() {
 python tinderclient_eventhandler() {
-    from bb import note, error, data
-    from bb.event import getName
-
-    if e.data is None or getName(e) == "MsgNote":
+    if e.data is None or bb.event.getName(e) == "MsgNote":
         return
         return
 
 
-    do_tinder_report = data.getVar('TINDER_REPORT', e.data, True)
+    do_tinder_report = e.data.getVar('TINDER_REPORT', True)
     if do_tinder_report and do_tinder_report == "1":
     if do_tinder_report and do_tinder_report == "1":
         tinder_do_tinder_report(e)
         tinder_do_tinder_report(e)
 
 

+ 0 - 2
meta/conf/distro/include/csl-versions.inc

@@ -38,7 +38,6 @@ def csl_get_gcc_version(d):
 		return version
 		return version
 
 
 def csl_get_libc_version(d):
 def csl_get_libc_version(d):
-	import os,bb
 	syspath = d.expand('${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}')
 	syspath = d.expand('${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}')
 	if not syspath:
 	if not syspath:
 	        return 'UNKNOWN'
 	        return 'UNKNOWN'
@@ -54,7 +53,6 @@ def csl_get_libc_version(d):
 	return 'UNKNOWN'
 	return 'UNKNOWN'
 
 
 def csl_get_kernel_version(d):
 def csl_get_kernel_version(d):
-	import os,bb
 	syspath = d.expand('${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}')
 	syspath = d.expand('${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}')
 	if not syspath:
 	if not syspath:
 	        return 'UNKNOWN'
 	        return 'UNKNOWN'

+ 0 - 1
meta/conf/distro/include/tcmode-external-sourcery.inc

@@ -104,7 +104,6 @@ addhandler toolchain_setup
 
 
 def populate_toolchain_links(d):
 def populate_toolchain_links(d):
     import errno
     import errno
-    import os
     from glob import glob
     from glob import glob
 
 
     d = d.createCopy()
     d = d.createCopy()

+ 0 - 1
meta/lib/oe/data.py

@@ -1,5 +1,4 @@
 import oe.maketype
 import oe.maketype
-import bb.msg
 
 
 def typed_value(key, d):
 def typed_value(key, d):
     """Construct a value for the specified metadata variable, using its flags
     """Construct a value for the specified metadata variable, using its flags

+ 0 - 1
meta/lib/oe/maketype.py

@@ -5,7 +5,6 @@ variable.  Other flags may be utilized in the construction of the types.  See
 the arguments of the type's factory for details.
 the arguments of the type's factory for details.
 """
 """
 
 
-import bb
 import inspect
 import inspect
 import types
 import types
 
 

+ 0 - 2
meta/lib/oe/packagedata.py

@@ -1,5 +1,3 @@
-import os
-import bb.data
 import codecs
 import codecs
 
 
 def packaged(pkg, d):
 def packaged(pkg, d):

+ 0 - 2
meta/lib/oe/patch.py

@@ -1,6 +1,4 @@
 import oe.path
 import oe.path
-import os
-import bb.utils, bb.msg, bb.data, bb.fetch2
 
 
 class NotFoundError(bb.BBHandledException):
 class NotFoundError(bb.BBHandledException):
     def __init__(self, path):
     def __init__(self, path):

+ 0 - 2
meta/lib/oe/path.py

@@ -1,7 +1,5 @@
-import bb
 import errno
 import errno
 import glob
 import glob
-import os
 import shutil
 import shutil
 import subprocess
 import subprocess
 
 

+ 0 - 1
meta/lib/oe/prservice.py

@@ -1,4 +1,3 @@
-import bb
 
 
 def prserv_make_conn(d, check = False):
 def prserv_make_conn(d, check = False):
     import prserv.serv
     import prserv.serv

+ 0 - 1
meta/lib/oe/terminal.py

@@ -1,5 +1,4 @@
 import logging
 import logging
-import os
 import oe.classutils
 import oe.classutils
 import shlex
 import shlex
 from bb.process import Popen, ExecutionError
 from bb.process import Popen, ExecutionError

+ 0 - 2
meta/lib/oe/utils.py

@@ -1,5 +1,3 @@
-import bb, bb.data
-
 def read_file(filename):
 def read_file(filename):
     try:
     try:
         f = file( filename, "r" )
         f = file( filename, "r" )

+ 1 - 1
meta/recipes-core/eglibc/eglibc_2.15.bb

@@ -58,7 +58,7 @@ FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/eglibc-${PV}', '${FILE_DIR
 #
 #
 
 
 python __anonymous () {
 python __anonymous () {
-    import bb, re
+    import re
     uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
     uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
     if uc_os:
     if uc_os:
         raise bb.parse.SkipPackage("incompatible with target %s" %
         raise bb.parse.SkipPackage("incompatible with target %s" %

+ 1 - 1
meta/recipes-core/eglibc/eglibc_2.16.bb

@@ -54,7 +54,7 @@ FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/eglibc-${PV}', '${FILE_DIR
 #
 #
 
 
 python __anonymous () {
 python __anonymous () {
-    import bb, re
+    import re
     uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
     uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
     if uc_os:
     if uc_os:
         raise bb.parse.SkipPackage("incompatible with target %s" %
         raise bb.parse.SkipPackage("incompatible with target %s" %

+ 0 - 2
meta/recipes-core/tasks/task-base.bb

@@ -124,8 +124,6 @@ python __anonymous () {
     # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
     # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
     # then include task-base-wifi in task-base
     # then include task-base-wifi in task-base
 
 
-    import bb
-
     distro_features = set(d.getVar("DISTRO_FEATURES", True).split())
     distro_features = set(d.getVar("DISTRO_FEATURES", True).split())
     machine_features= set(d.getVar("MACHINE_FEATURES", True).split())
     machine_features= set(d.getVar("MACHINE_FEATURES", True).split())
 
 

+ 0 - 1
meta/recipes-devtools/apt/apt-package.inc

@@ -40,7 +40,6 @@ def get_files_apt_doc(d, bb, manpages):
     return manpages
     return manpages
 
 
 def get_commands_apt_doc(d, bb, manpages):
 def get_commands_apt_doc(d, bb, manpages):
-    import os
     s = list()
     s = list()
     __dir_cache__ = list()
     __dir_cache__ = list()
     for m in manpages.split():
     for m in manpages.split():

+ 0 - 2
meta/recipes-extended/pam/libpam_1.1.5.bb

@@ -53,8 +53,6 @@ RDEPENDS_${PN}-xtests = "libpam pam-plugin-access pam-plugin-debug pam-plugin-cr
 RRECOMMENDS_${PN} = "libpam-runtime"
 RRECOMMENDS_${PN} = "libpam-runtime"
 
 
 python populate_packages_prepend () {
 python populate_packages_prepend () {
-    import os.path
-
     def pam_plugin_append_file(pn, dir, file):
     def pam_plugin_append_file(pn, dir, file):
         nf = os.path.join(dir, file)
         nf = os.path.join(dir, file)
         of = d.getVar('FILES_' + pn, True)
         of = d.getVar('FILES_' + pn, True)

+ 0 - 2
meta/recipes-gnome/gtk+/gtk+_2.12.7.bb

@@ -32,8 +32,6 @@ LIBV = "2.10.0"
 PACKAGES_DYNAMIC += "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
 PACKAGES_DYNAMIC += "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
 
 
 python populate_packages_prepend () {
 python populate_packages_prepend () {
-    import os.path
-
     prologue = d.getVar("postinst_prologue", True)
     prologue = d.getVar("postinst_prologue", True)
     postinst_pixbufloader = d.getVar("postinst_pixbufloader", True)
     postinst_pixbufloader = d.getVar("postinst_pixbufloader", True)
 
 

+ 0 - 2
meta/recipes-gnome/gtk+/gtk+_2.16.6.bb

@@ -32,8 +32,6 @@ LIBV = "2.10.0"
 PACKAGES_DYNAMIC += "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
 PACKAGES_DYNAMIC += "gdk-pixbuf-loader-* gtk-immodule-* gtk-printbackend-*"
 
 
 python populate_packages_prepend () {
 python populate_packages_prepend () {
-    import os.path
-
     prologue = d.getVar("postinst_prologue", True)
     prologue = d.getVar("postinst_prologue", True)
     postinst_pixbufloader = d.getVar("postinst_pixbufloader", True)
     postinst_pixbufloader = d.getVar("postinst_pixbufloader", True)
 
 

+ 0 - 2
meta/recipes-gnome/gtk+/gtk+_2.24.8.bb

@@ -39,8 +39,6 @@ LIBV = "2.10.0"
 PACKAGES_DYNAMIC += "gtk-immodule-* gtk-printbackend-*"
 PACKAGES_DYNAMIC += "gtk-immodule-* gtk-printbackend-*"
 
 
 python populate_packages_prepend () {
 python populate_packages_prepend () {
-    import os.path
-
     prologue = d.getVar("postinst_prologue", True)
     prologue = d.getVar("postinst_prologue", True)
 
 
     gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}')
     gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}')

+ 0 - 2
meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb

@@ -29,8 +29,6 @@ CFLAGS_prepend = "-DHAVE_ANIMATION "
 inherit gnome
 inherit gnome
 
 
 python populate_packages_prepend() {
 python populate_packages_prepend() {
-    import os.path
-
     engines_root = os.path.join(d.getVar('libdir', True), "gtk-2.0/2.10.0/engines")
     engines_root = os.path.join(d.getVar('libdir', True), "gtk-2.0/2.10.0/engines")
     themes_root = os.path.join(d.getVar('datadir', True), "themes")
     themes_root = os.path.join(d.getVar('datadir', True), "themes")
 
 

+ 0 - 1
meta/recipes-graphics/directfb/directfb.inc

@@ -35,7 +35,6 @@ EXTRA_OECONF = "\
 #PACKAGES_DYNAMIC = "directfb-inputdrivers-*"
 #PACKAGES_DYNAMIC = "directfb-inputdrivers-*"
 #
 #
 #python populate_packages_prepend () {
 #python populate_packages_prepend () {
-#    import os.path
 #    inputdrivers_libdir = d.expand('${libdir}/directfb-${RV}/inputdrivers')
 #    inputdrivers_libdir = d.expand('${libdir}/directfb-${RV}/inputdrivers')
 #    do_split_packages(d, inputdrivers_libdir, '*.so$', 'directfb-inputdrivers-%s', 'Directfb plugin for %s')
 #    do_split_packages(d, inputdrivers_libdir, '*.so$', 'directfb-inputdrivers-%s', 'Directfb plugin for %s')
 #}
 #}

+ 0 - 2
meta/recipes-graphics/mesa/mesa-dri.inc

@@ -11,8 +11,6 @@ DRIDRIVERS_append_x86-64 = ",i915,i965"
 EXTRA_OECONF += "--with-driver=dri --disable-egl --disable-gallium --without-gallium-drivers --with-dri-drivers=${DRIDRIVERS}"
 EXTRA_OECONF += "--with-driver=dri --disable-egl --disable-gallium --without-gallium-drivers --with-dri-drivers=${DRIDRIVERS}"
 
 
 python populate_packages_prepend() {
 python populate_packages_prepend() {
-    import os.path
-
     dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri")
     dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri")
 
 
     do_split_packages(d, dri_drivers_root, '^(.*)_dri\.so$', 'mesa-dri-driver-%s', 'Mesa %s DRI driver', extra_depends='')
     do_split_packages(d, dri_drivers_root, '^(.*)_dri\.so$', 'mesa-dri-driver-%s', 'Mesa %s DRI driver', extra_depends='')

+ 0 - 2
meta/recipes-kernel/linux/linux-dtb.inc

@@ -3,8 +3,6 @@ FILES_kernel-devicetree = "/boot/devicetree*"
 KERNEL_DEVICETREE_FLAGS = "-R 8 -p 0x3000"
 KERNEL_DEVICETREE_FLAGS = "-R 8 -p 0x3000"
 
 
 python __anonymous () {
 python __anonymous () {
-    import bb
-
     devicetree = d.getVar("KERNEL_DEVICETREE", True) or ''
     devicetree = d.getVar("KERNEL_DEVICETREE", True) or ''
     if devicetree:
     if devicetree:
 	depends = d.getVar("DEPENDS", True)
 	depends = d.getVar("DEPENDS", True)

+ 0 - 1
meta/recipes-qt/qt-apps/qmmp_0.5.2.bb

@@ -30,7 +30,6 @@ PACKAGES_DYNAMIC = "qmmp-plugin-* "
 
 
 
 
 python populate_packages_prepend () {
 python populate_packages_prepend () {
-    import os
     qmmp_libdir = d.expand('${libdir}/qmmp')
     qmmp_libdir = d.expand('${libdir}/qmmp')
     gd = d.expand('${D}/${libdir}/qmmp')
     gd = d.expand('${D}/${libdir}/qmmp')
     plug_dirs = os.listdir(gd)
     plug_dirs = os.listdir(gd)

+ 1 - 3
meta/recipes-qt/qt4/qt4.inc

@@ -38,8 +38,6 @@ QT_LIB_NAMES = "Qt3Support QtAssistantClient QtCLucene QtCore QtDBus QtDesigner
 QT_EXTRA_LIBS = "pvrQWSWSEGL"
 QT_EXTRA_LIBS = "pvrQWSWSEGL"
 
 
 python __anonymous () {
 python __anonymous () {
-    import bb
-
     lib_packages = []
     lib_packages = []
     dev_packages = []
     dev_packages = []
     dbg_packages = []
     dbg_packages = []
@@ -280,7 +278,7 @@ python populate_packages_prepend() {
  
  
     phrasebook_dir = d.expand('${datadir}/${QT_DIR_NAME}/phrasebooks/')
     phrasebook_dir = d.expand('${datadir}/${QT_DIR_NAME}/phrasebooks/')
     phrasebook_name = d.expand('${QT_BASE_NAME}-phrasebook-%s')
     phrasebook_name = d.expand('${QT_BASE_NAME}-phrasebook-%s')
-    import os;
+
     if os.path.exists("%s%s" % (d.expand('${D}'), phrasebook_dir)):
     if os.path.exists("%s%s" % (d.expand('${D}'), phrasebook_dir)):
         do_split_packages(d, phrasebook_dir, '^(.*)\.qph$', phrasebook_name, '${PN} phrasebook for %s', extra_depends='' )
         do_split_packages(d, phrasebook_dir, '^(.*)\.qph$', phrasebook_name, '${PN} phrasebook for %s', extra_depends='' )
     else:
     else:

+ 0 - 1
meta/recipes-sato/puzzles/oh-puzzles_git.bb

@@ -59,7 +59,6 @@ FILES_${PN}-dbg += "/usr/games/.debug/*"
 FILES_${PN}-extra = "/usr/games/ /usr/share/applications /etc/gconf/schemas"
 FILES_${PN}-extra = "/usr/games/ /usr/share/applications /etc/gconf/schemas"
 
 
 python __anonymous () {
 python __anonymous () {
-    import bb
     var = bb.data.expand("FILES_${PN}", d, 1)
     var = bb.data.expand("FILES_${PN}", d, 1)
     data = d.getVar(var, True)
     data = d.getVar(var, True)
     for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
     for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):

+ 0 - 2
meta/recipes-support/boost/boost.inc

@@ -47,8 +47,6 @@ BOOST_LIBS = "\
 # Make a package for each library, plus -dev
 # Make a package for each library, plus -dev
 PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
 PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
 python __anonymous () {
 python __anonymous () {
-    import bb
-
     packages = []
     packages = []
     extras = []
     extras = []
     for lib in d.getVar('BOOST_LIBS', True).split( ):
     for lib in d.getVar('BOOST_LIBS', True).split( ):

+ 1 - 1
meta/recipes-support/pth/pth_2.0.7.bb

@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;beginline=12;endline=15;md5=a48af114a80c222ca
 PR = "r2"
 PR = "r2"
 
 
 python __anonymous () {
 python __anonymous () {
-    import bb, re
+    import re
     uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
     uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
     if uc_os:
     if uc_os:
         raise bb.parse.SkipPackage("incompatible with uClibc")
         raise bb.parse.SkipPackage("incompatible with uClibc")