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

View File

@ -22,7 +22,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, os, getopt, re, time, optparse, xmlrpclib
import sys, os, optparse
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
'lib'))

View File

@ -53,7 +53,8 @@ __all__ = [
"providers",
]
import sys, os, types, re, string
import os
import bb.msg
if "BBDEBUG" in os.environ:
level = int(os.environ["BBDEBUG"])

View File

@ -200,7 +200,6 @@ def exec_func(func, d, dirs = None):
def exec_func_python(func, d, runfile, logfile):
"""Execute a python BB 'function'"""
import re, os
bbfile = bb.data.getVar('FILE', d, 1)
tmp = "def " + func + "(d):\n%s" % data.getVar(func, d)

View File

@ -28,7 +28,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import os
import bb.data
import bb.utils
@ -452,14 +452,13 @@ class Cache:
Return the data and whether parsing resulted in the file being skipped
"""
import bb
from bb import utils, data, parse, debug, event, fatal
from bb import data, parse
# expand tmpdir to include this topdir
data.setVar('TMPDIR', data.getVar('TMPDIR', config, 1) or "", config)
bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
oldpath = os.path.abspath(os.getcwd())
if bb.parse.cached_mtime_noerror(bbfile_loc):
if parse.cached_mtime_noerror(bbfile_loc):
os.chdir(bbfile_loc)
bb_data = data.init_db(config)
try:

View File

@ -22,11 +22,10 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, os, getopt, glob, copy, os.path, re, time
import sys, os, glob, os.path, re, time
import bb
from bb import utils, data, parse, event, cache, providers, taskdata, runqueue
from bb import command
import itertools, sre_constants
from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue
import sre_constants
class MultipleMatches(Exception):
"""

View File

@ -28,11 +28,10 @@ BitBake build tools.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
import copy, os, re, sys, time, types
import copy, re, sys, types
import bb
from bb import utils, methodpool
from bb import utils
from bb.COW import COWDictBase
from new import classobj
__setvar_keyword__ = ["_append", "_prepend"]

View File

@ -22,7 +22,7 @@ BitBake build tools.
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re, sys
import os, sys
import warnings
import bb.utils
import pickle

View File

@ -23,11 +23,10 @@ BitBake "Fetch" repo (git) implementation
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re
import os
import bb
from bb import data
from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import runfetchcmd
class Repo(Fetch):

View File

@ -22,9 +22,10 @@ Message handling infrastructure for bitbake
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, bb
import sys
import collections
from bb import event
import bb
import bb.event
debug_level = collections.defaultdict(lambda: 0)
verbose = False
@ -54,7 +55,7 @@ class MsgBase(bb.event.Event):
def __init__(self, msg):
self._message = msg
event.Event.__init__(self)
bb.event.Event.__init__(self)
class MsgDebug(MsgBase):
"""Debug Message"""

View File

@ -22,6 +22,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import bb, re, string
from bb import methodpool
from itertools import chain
__word__ = re.compile(r"\S+")

View File

@ -25,12 +25,12 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, bb, os, sys, time, string
import re, bb, os
import bb.fetch, bb.build, bb.utils
from bb import data, fetch
from bb import data
from ConfHandler import include, init
from bb.parse import ParseError, resolve_file, ast
from bb.parse import resolve_file, ast
# For compatibility
from bb.parse import vars_from_file

View File

@ -24,7 +24,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, bb.data, os, sys
import re, bb.data, os
import bb.utils
from bb.parse import ParseError, resolve_file, ast

View File

@ -22,8 +22,8 @@ Handles preparation and execution of a queue of tasks
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from bb import msg, data, event, mkdirhier, utils
import bb, os, sys
from bb import msg, data, event
import signal
import stat
import fcntl

View File

@ -56,8 +56,8 @@ try:
set
except NameError:
from sets import Set as set
import sys, os, readline, socket, httplib, urllib, commands, popen2, copy, shlex, Queue, fnmatch
from bb import data, parse, build, fatal, cache, taskdata, runqueue, providers as Providers
import sys, os, readline, socket, httplib, urllib, commands, popen2, shlex, Queue, fnmatch
from bb import data, parse, build, cache, taskdata, runqueue, providers as Providers
__version__ = "0.5.3.1"
__credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>

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