# 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'))
"providers",
]
-import sys, os, types, re, string
+import os
+import bb.msg
if "BBDEBUG" in os.environ:
level = int(os.environ["BBDEBUG"])
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)
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import os, re
+import os
import bb.data
import bb.utils
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:
# 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):
"""
# 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"]
# 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
# 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):
# 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
def __init__(self, msg):
self._message = msg
- event.Event.__init__(self)
+ bb.event.Event.__init__(self)
class MsgDebug(MsgBase):
"""Debug Message"""
# 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+")
# 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
# 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
# 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
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>
# 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
"""
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)
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)
print the lines that are responsible for the
error.
"""
- import bb, sys
+ import bb.parse
try:
exec code in _context, context
except:
"""
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)
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:
"""
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:
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
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