1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

Import fixups

(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Chris Larson
2010-04-08 10:22:29 -07:00
committed by Richard Purdie
parent 7acc132cac
commit 1c74fd768f
15 changed files with 34 additions and 41 deletions
+9 -14
View File
@@ -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