diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-04-08 10:22:29 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:32 +0100 |
commit | 1c74fd768f8e4f5778411538b906cdcc22fe3f67 (patch) | |
tree | 3d3a5f1021276055f91322afa64a9eee53d3cc9f /bitbake/lib/bb/utils.py | |
parent | 7acc132cac873e60005516272473a55a8160b9c4 (diff) | |
download | openembedded-core-1c74fd768f8e4f5778411538b906cdcc22fe3f67.tar.gz openembedded-core-1c74fd768f8e4f5778411538b906cdcc22fe3f67.tar.bz2 openembedded-core-1c74fd768f8e4f5778411538b906cdcc22fe3f67.zip |
Import fixups
(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r-- | bitbake/lib/bb/utils.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 93c158c604..132d5e56b2 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -19,7 +19,11 @@ BitBake Utility Functions # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import re, fcntl, os, types, bb, string, stat, shutil, time +import re, fcntl, os, types, string, stat, shutil, time +import sys +import bb +import errno +import bb.msg from commands import getstatusoutput # Version comparison @@ -287,8 +291,6 @@ def _print_trace(body, line): """ Print the Environment of a Text Body """ - import bb - # print the environment of the method bb.msg.error(bb.msg.domain.Util, "Printing the environment of the function") min_line = max(1, line-4) @@ -305,8 +307,6 @@ def better_compile(text, file, realfile, mode = "exec"): try: return compile(text, file, mode) except Exception, e: - import bb, sys - # split the text into lines again body = text.split('\n') bb.msg.error(bb.msg.domain.Util, "Error in compiling python function in: ", realfile) @@ -324,7 +324,7 @@ def better_exec(code, context, text, realfile): print the lines that are responsible for the error. """ - import bb, sys + import bb.parse try: exec code in _context, context except: @@ -361,7 +361,6 @@ def lockfile(name): """ path = os.path.dirname(name) if not os.path.isdir(path): - import bb, sys bb.msg.error(bb.msg.domain.Util, "Error, lockfile path does not exist!: %s" % path) sys.exit(1) @@ -467,8 +466,6 @@ def filter_environment(good_vars): are not known and may influence the build in a negative way. """ - import bb - removed_vars = [] for key in os.environ.keys(): if key in good_vars: @@ -509,7 +506,7 @@ def build_environment(d): """ Build an environment from all exported variables. """ - import bb + import bb.data for var in bb.data.keys(d): export = bb.data.getVarFlag(var, "export", d) if export: @@ -550,9 +547,8 @@ def mkdirhier(dir): os.makedirs(dir) bb.msg.debug(2, bb.msg.domain.Util, "created " + dir) except OSError, e: - if e.errno != 17: raise e - -import stat + if e.errno != errno.EEXIST: + raise e def movefile(src, dest, newmtime = None, sstat = None): """Moves a file from src to dest, preserving all permissions and @@ -603,7 +599,6 @@ def movefile(src, dest, newmtime = None, sstat = None): ret = os.rename(src, dest) renamefailed = 0 except Exception, e: - import errno if e[0] != errno.EXDEV: # Some random error. print "movefile: Failed to move", src, "to", dest, e |