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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 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])), sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])),
'lib')) 'lib'))

View File

@ -53,7 +53,8 @@ __all__ = [
"providers", "providers",
] ]
import sys, os, types, re, string import os
import bb.msg
if "BBDEBUG" in os.environ: if "BBDEBUG" in os.environ:
level = int(os.environ["BBDEBUG"]) 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): def exec_func_python(func, d, runfile, logfile):
"""Execute a python BB 'function'""" """Execute a python BB 'function'"""
import re, os
bbfile = bb.data.getVar('FILE', d, 1) bbfile = bb.data.getVar('FILE', d, 1)
tmp = "def " + func + "(d):\n%s" % data.getVar(func, d) 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. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re import os
import bb.data import bb.data
import bb.utils import bb.utils
@ -452,14 +452,13 @@ class Cache:
Return the data and whether parsing resulted in the file being skipped Return the data and whether parsing resulted in the file being skipped
""" """
import bb from bb import data, parse
from bb import utils, data, parse, debug, event, fatal
# expand tmpdir to include this topdir # expand tmpdir to include this topdir
data.setVar('TMPDIR', data.getVar('TMPDIR', config, 1) or "", config) data.setVar('TMPDIR', data.getVar('TMPDIR', config, 1) or "", config)
bbfile_loc = os.path.abspath(os.path.dirname(bbfile)) bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
oldpath = os.path.abspath(os.getcwd()) 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) os.chdir(bbfile_loc)
bb_data = data.init_db(config) bb_data = data.init_db(config)
try: try:

View File

@ -22,11 +22,10 @@
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 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 import bb
from bb import utils, data, parse, event, cache, providers, taskdata, runqueue from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue
from bb import command import sre_constants
import itertools, sre_constants
class MultipleMatches(Exception): class MultipleMatches(Exception):
""" """

View File

@ -28,11 +28,10 @@ BitBake build tools.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Based on functions from the base bb module, Copyright 2003 Holger Schurig # 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 import bb
from bb import utils, methodpool from bb import utils
from bb.COW import COWDictBase from bb.COW import COWDictBase
from new import classobj
__setvar_keyword__ = ["_append", "_prepend"] __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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re, sys import os, sys
import warnings import warnings
import bb.utils import bb.utils
import pickle 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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import os, re import os
import bb import bb
from bb import data from bb import data
from bb.fetch import Fetch from bb.fetch import Fetch
from bb.fetch import FetchError
from bb.fetch import runfetchcmd from bb.fetch import runfetchcmd
class Repo(Fetch): 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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys, bb import sys
import collections import collections
from bb import event import bb
import bb.event
debug_level = collections.defaultdict(lambda: 0) debug_level = collections.defaultdict(lambda: 0)
verbose = False verbose = False
@ -54,7 +55,7 @@ class MsgBase(bb.event.Event):
def __init__(self, msg): def __init__(self, msg):
self._message = msg self._message = msg
event.Event.__init__(self) bb.event.Event.__init__(self)
class MsgDebug(MsgBase): class MsgDebug(MsgBase):
"""Debug Message""" """Debug Message"""

View File

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

View File

@ -25,12 +25,12 @@
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 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 import bb.fetch, bb.build, bb.utils
from bb import data, fetch from bb import data
from ConfHandler import include, init from ConfHandler import include, init
from bb.parse import ParseError, resolve_file, ast from bb.parse import resolve_file, ast
# For compatibility # For compatibility
from bb.parse import vars_from_file 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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import re, bb.data, os, sys import re, bb.data, os
import bb.utils import bb.utils
from bb.parse import ParseError, resolve_file, ast 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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from bb import msg, data, event, mkdirhier, utils
import bb, os, sys import bb, os, sys
from bb import msg, data, event
import signal import signal
import stat import stat
import fcntl import fcntl

View File

@ -56,8 +56,8 @@ try:
set set
except NameError: except NameError:
from sets import Set as set from sets import Set as set
import sys, os, readline, socket, httplib, urllib, commands, popen2, copy, shlex, Queue, fnmatch import sys, os, readline, socket, httplib, urllib, commands, popen2, shlex, Queue, fnmatch
from bb import data, parse, build, fatal, cache, taskdata, runqueue, providers as Providers from bb import data, parse, build, cache, taskdata, runqueue, providers as Providers
__version__ = "0.5.3.1" __version__ = "0.5.3.1"
__credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> __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., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 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 from commands import getstatusoutput
# Version comparison # Version comparison
@ -287,8 +291,6 @@ def _print_trace(body, line):
""" """
Print the Environment of a Text Body Print the Environment of a Text Body
""" """
import bb
# print the environment of the method # print the environment of the method
bb.msg.error(bb.msg.domain.Util, "Printing the environment of the function") bb.msg.error(bb.msg.domain.Util, "Printing the environment of the function")
min_line = max(1, line-4) min_line = max(1, line-4)
@ -305,8 +307,6 @@ def better_compile(text, file, realfile, mode = "exec"):
try: try:
return compile(text, file, mode) return compile(text, file, mode)
except Exception, e: except Exception, e:
import bb, sys
# split the text into lines again # split the text into lines again
body = text.split('\n') body = text.split('\n')
bb.msg.error(bb.msg.domain.Util, "Error in compiling python function in: ", realfile) 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 print the lines that are responsible for the
error. error.
""" """
import bb, sys import bb.parse
try: try:
exec code in _context, context exec code in _context, context
except: except:
@ -361,7 +361,6 @@ def lockfile(name):
""" """
path = os.path.dirname(name) path = os.path.dirname(name)
if not os.path.isdir(path): if not os.path.isdir(path):
import bb, sys
bb.msg.error(bb.msg.domain.Util, "Error, lockfile path does not exist!: %s" % path) bb.msg.error(bb.msg.domain.Util, "Error, lockfile path does not exist!: %s" % path)
sys.exit(1) sys.exit(1)
@ -467,8 +466,6 @@ def filter_environment(good_vars):
are not known and may influence the build in a negative way. are not known and may influence the build in a negative way.
""" """
import bb
removed_vars = [] removed_vars = []
for key in os.environ.keys(): for key in os.environ.keys():
if key in good_vars: if key in good_vars:
@ -509,7 +506,7 @@ def build_environment(d):
""" """
Build an environment from all exported variables. Build an environment from all exported variables.
""" """
import bb import bb.data
for var in bb.data.keys(d): for var in bb.data.keys(d):
export = bb.data.getVarFlag(var, "export", d) export = bb.data.getVarFlag(var, "export", d)
if export: if export:
@ -550,9 +547,8 @@ def mkdirhier(dir):
os.makedirs(dir) os.makedirs(dir)
bb.msg.debug(2, bb.msg.domain.Util, "created " + dir) bb.msg.debug(2, bb.msg.domain.Util, "created " + dir)
except OSError, e: except OSError, e:
if e.errno != 17: raise e if e.errno != errno.EEXIST:
raise e
import stat
def movefile(src, dest, newmtime = None, sstat = None): def movefile(src, dest, newmtime = None, sstat = None):
"""Moves a file from src to dest, preserving all permissions and """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) ret = os.rename(src, dest)
renamefailed = 0 renamefailed = 0
except Exception, e: except Exception, e:
import errno
if e[0] != errno.EXDEV: if e[0] != errno.EXDEV:
# Some random error. # Some random error.
print "movefile: Failed to move", src, "to", dest, e print "movefile: Failed to move", src, "to", dest, e