diff options
| author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-07-08 15:24:31 +0300 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-07-08 16:34:48 +0300 |
| commit | 2939317205d1f39eefebec7bd6ba01faaa0f9369 (patch) | |
| tree | 45f4ba1e0bca7dc394b7fa77ca3122f1121a6a55 /poky/bitbake/lib/bb | |
| parent | 963b1beb7e04e1c6c55bea2104b856e3121202db (diff) | |
| download | openbmc-2.7.0-rc1.tar.xz | |
reset upstream subtrees to warrior HEAD2.7.0-rc1
Reset the following subtrees on warrior HEAD:
meta-security: 4f7be0d252(warrior)
poky: 38d5c8ea98(warrior)
meta-raspberrypi: 6c73694912(warrior)
meta-openembedded: 6fa72d587a(warrior)
Change-Id: Id2550baeb90de14bdd9ee8c06f2c619fc719bc68
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/bitbake/lib/bb')
53 files changed, 174 insertions, 332 deletions
diff --git a/poky/bitbake/lib/bb/COW.py b/poky/bitbake/lib/bb/COW.py index d26e981951..06678a9bf8 100644 --- a/poky/bitbake/lib/bb/COW.py +++ b/poky/bitbake/lib/bb/COW.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # This is a copy on write dictionary and set which abuses classes to try and be nice and fast. # diff --git a/poky/bitbake/lib/bb/__init__.py b/poky/bitbake/lib/bb/__init__.py index 7579a893b6..afa49abc73 100644 --- a/poky/bitbake/lib/bb/__init__.py +++ b/poky/bitbake/lib/bb/__init__.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Build System Python Library # @@ -9,7 +11,7 @@ # SPDX-License-Identifier: GPL-2.0-only # -__version__ = "1.43.0" +__version__ = "1.42.0" import sys if sys.version_info < (3, 4, 0): diff --git a/poky/bitbake/lib/bb/build.py b/poky/bitbake/lib/bb/build.py index e2f91fa3b7..5ba2e6d517 100644 --- a/poky/bitbake/lib/bb/build.py +++ b/poky/bitbake/lib/bb/build.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake 'Build' implementation # @@ -163,35 +165,12 @@ class LogTee(object): def __repr__(self): return '<LogTee {0}>'.format(self.name) - def flush(self): self.outfile.flush() - -class StdoutNoopContextManager: - """ - This class acts like sys.stdout, but adds noop __enter__ and __exit__ methods. - """ - def __enter__(self): - return sys.stdout - - def __exit__(self, *exc_info): - pass - - def write(self, string): - return sys.stdout.write(string) - - def flush(self): - sys.stdout.flush() - - @property - def name(self): - return sys.stdout.name - - # # pythonexception allows the python exceptions generated to be raised -# as the real exceptions (not FuncFailed) and without a backtrace at the +# as the real exceptions (not FuncFailed) and without a backtrace at the # origin of the failure. # def exec_func(func, d, dirs = None, pythonexception=False): @@ -346,42 +325,6 @@ trap 'bb_exit_handler' 0 set -e ''' -def create_progress_handler(func, progress, logfile, d): - if progress == 'percent': - # Use default regex - return bb.progress.BasicProgressHandler(d, outfile=logfile) - elif progress.startswith('percent:'): - # Use specified regex - return bb.progress.BasicProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile) - elif progress.startswith('outof:'): - # Use specified regex - return bb.progress.OutOfProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile) - elif progress.startswith("custom:"): - # Use a custom progress handler that was injected via OE_EXTRA_IMPORTS or __builtins__ - import functools - from types import ModuleType - - parts = progress.split(":", 2) - _, cls, otherargs = parts[0], parts[1], (parts[2] or None) if parts[2:] else None - if cls: - def resolve(x, y): - if not x: - return None - if isinstance(x, ModuleType): - return getattr(x, y, None) - return x.get(y) - cls_obj = functools.reduce(resolve, cls.split("."), bb.utils._context) - if not cls_obj: - # Fall-back on __builtins__ - cls_obj = functools.reduce(lambda x, y: x.get(y), cls.split("."), __builtins__) - if cls_obj: - return cls_obj(d, outfile=logfile, otherargs=otherargs) - bb.warn('%s: unknown custom progress handler in task progress varflag value "%s", ignoring' % (func, cls)) - else: - bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress)) - - return logfile - def exec_func_shell(func, d, runfile, cwd=None): """Execute a shell function from the metadata @@ -419,13 +362,23 @@ exit $ret cmd = [fakerootcmd, runfile] if bb.msg.loggerDefaultVerbose: - logfile = LogTee(logger, StdoutNoopContextManager()) + logfile = LogTee(logger, sys.stdout) else: - logfile = StdoutNoopContextManager() + logfile = sys.stdout progress = d.getVarFlag(func, 'progress') if progress: - logfile = create_progress_handler(func, progress, logfile, d) + if progress == 'percent': + # Use default regex + logfile = bb.progress.BasicProgressHandler(d, outfile=logfile) + elif progress.startswith('percent:'): + # Use specified regex + logfile = bb.progress.BasicProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile) + elif progress.startswith('outof:'): + # Use specified regex + logfile = bb.progress.OutOfProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile) + else: + bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress)) fifobuffer = bytearray() def readfifo(data): @@ -444,8 +397,6 @@ exit $ret bb.plain(value) elif cmd == 'bbnote': bb.note(value) - elif cmd == 'bbverbnote': - bb.verbnote(value) elif cmd == 'bbwarn': bb.warn(value) elif cmd == 'bberror': @@ -477,7 +428,7 @@ exit $ret bb.debug(2, "Executing shell function %s" % func) try: - with open(os.devnull, 'r+') as stdin, logfile: + with open(os.devnull, 'r+') as stdin: bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)]) except bb.process.CmdError: logfn = d.getVar('BB_LOGFILE') @@ -853,9 +804,6 @@ def add_tasks(tasklist, d): task_deps['parents'][task] = [] if 'deps' in flags: for dep in flags['deps']: - # Check and warn for "addtask task after foo" while foo does not exist - #if not dep in tasklist: - # bb.warn('%s: dependent task %s for %s does not exist' % (d.getVar('PN'), dep, task)) dep = d.expand(dep) task_deps['parents'][task].append(dep) diff --git a/poky/bitbake/lib/bb/cache.py b/poky/bitbake/lib/bb/cache.py index 5fb2f17cda..af410aac39 100644 --- a/poky/bitbake/lib/bb/cache.py +++ b/poky/bitbake/lib/bb/cache.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Cache implementation # @@ -237,7 +239,7 @@ def virtualfn2realfn(virtualfn): Convert a virtual file name to a real one + the associated subclass keyword """ mc = "" - if virtualfn.startswith('mc:'): + if virtualfn.startswith('multiconfig:'): elems = virtualfn.split(':') mc = elems[1] virtualfn = ":".join(elems[2:]) @@ -258,7 +260,7 @@ def realfn2virtual(realfn, cls, mc): if cls: realfn = "virtual:" + cls + ":" + realfn if mc: - realfn = "mc:" + mc + ":" + realfn + realfn = "multiconfig:" + mc + ":" + realfn return realfn def variant2virtual(realfn, variant): @@ -267,11 +269,11 @@ def variant2virtual(realfn, variant): """ if variant == "": return realfn - if variant.startswith("mc:"): + if variant.startswith("multiconfig:"): elems = variant.split(":") if elems[2]: - return "mc:" + elems[1] + ":virtual:" + ":".join(elems[2:]) + ":" + realfn - return "mc:" + elems[1] + ":" + realfn + return "multiconfig:" + elems[1] + ":virtual:" + ":".join(elems[2:]) + ":" + realfn + return "multiconfig:" + elems[1] + ":" + realfn return "virtual:" + variant + ":" + realfn def parse_recipe(bb_data, bbfile, appends, mc=''): @@ -349,7 +351,7 @@ class NoCache(object): bb_data = self.databuilder.mcdata[mc].createCopy() newstores = parse_recipe(bb_data, bbfile, appends, mc) for ns in newstores: - datastores["mc:%s:%s" % (mc, ns)] = newstores[ns] + datastores["multiconfig:%s:%s" % (mc, ns)] = newstores[ns] return datastores diff --git a/poky/bitbake/lib/bb/cache_extra.py b/poky/bitbake/lib/bb/cache_extra.py index bf4226d168..d282601134 100644 --- a/poky/bitbake/lib/bb/cache_extra.py +++ b/poky/bitbake/lib/bb/cache_extra.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Extra RecipeInfo will be all defined in this file. Currently, # Only Hob (Image Creator) Requests some extra fields. So diff --git a/poky/bitbake/lib/bb/cooker.py b/poky/bitbake/lib/bb/cooker.py index 0008c2fde1..a97bafdcac 100644 --- a/poky/bitbake/lib/bb/cooker.py +++ b/poky/bitbake/lib/bb/cooker.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2003, 2004 Phil Blundell @@ -495,7 +497,6 @@ class BBCooker: """ fn = None envdata = None - mc = '' if not pkgs_to_build: pkgs_to_build = [] @@ -504,12 +505,6 @@ class BBCooker: self.enableDataTracking() self.reset() - def mc_base(p): - if p.startswith('mc:'): - s = p.split(':') - if len(s) == 2: - return s[1] - return None if buildfile: # Parse the configuration here. We need to do it explicitly here since @@ -520,16 +515,18 @@ class BBCooker: fn = self.matchFile(fn) fn = bb.cache.realfn2virtual(fn, cls, mc) elif len(pkgs_to_build) == 1: - mc = mc_base(pkgs_to_build[0]) - if not mc: - ignore = self.data.getVar("ASSUME_PROVIDED") or "" - if pkgs_to_build[0] in set(ignore.split()): - bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0]) + ignore = self.data.getVar("ASSUME_PROVIDED") or "" + if pkgs_to_build[0] in set(ignore.split()): + bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0]) - taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True) + taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True) - mc = runlist[0][0] - fn = runlist[0][3] + mc = runlist[0][0] + fn = runlist[0][3] + else: + envdata = self.data + data.expandKeys(envdata) + parse.ast.runAnonFuncs(envdata) if fn: try: @@ -538,12 +535,6 @@ class BBCooker: except Exception as e: parselog.exception("Unable to read %s", fn) raise - else: - if not mc in self.databuilder.mcdata: - bb.fatal('Not multiconfig named "%s" found' % mc) - envdata = self.databuilder.mcdata[mc] - data.expandKeys(envdata) - parse.ast.runAnonFuncs(envdata) # Display history with closing(StringIO()) as env: @@ -583,10 +574,10 @@ class BBCooker: wildcard = False # Wild card expansion: - # Replace string such as "mc:*:bash" - # into "mc:A:bash mc:B:bash bash" + # Replace string such as "multiconfig:*:bash" + # into "multiconfig:A:bash multiconfig:B:bash bash" for k in targetlist: - if k.startswith("mc:"): + if k.startswith("multiconfig:"): if wildcard: bb.fatal('multiconfig conflict') if k.split(":")[1] == "*": @@ -619,7 +610,7 @@ class BBCooker: runlist = [] for k in fulltargetlist: mc = "" - if k.startswith("mc:"): + if k.startswith("multiconfig:"): mc = k.split(":")[1] k = ":".join(k.split(":")[2:]) ktask = task @@ -704,7 +695,7 @@ class BBCooker: @staticmethod def add_mc_prefix(mc, pn): if mc: - return "mc:%s:%s" % (mc, pn) + return "multiconfig:%s:%s" % (mc, pn) return pn def buildDependTree(self, rq, taskdata): @@ -1481,7 +1472,7 @@ class BBCooker: ntargets = [] for target in runlist: if target[0]: - ntargets.append("mc:%s:%s:%s" % (target[0], target[1], target[2])) + ntargets.append("multiconfig:%s:%s:%s" % (target[0], target[1], target[2])) ntargets.append("%s:%s" % (target[1], target[2])) for mc in self.multiconfigs: @@ -1604,9 +1595,6 @@ class BBCooker: for pkg in pkgs_to_build: if pkg in ignore: parselog.warning("Explicit target \"%s\" is in ASSUME_PROVIDED, ignoring" % pkg) - if pkg.startswith("multiconfig:"): - pkgs_to_build.remove(pkg) - pkgs_to_build.append(pkg.replace("multiconfig:", "mc:")) if 'world' in pkgs_to_build: pkgs_to_build.remove('world') @@ -1614,7 +1602,7 @@ class BBCooker: bb.providers.buildWorldTargetList(self.recipecaches[mc], task) for t in self.recipecaches[mc].world_target: if mc: - t = "mc:" + mc + ":" + t + t = "multiconfig:" + mc + ":" + t pkgs_to_build.append(t) if 'universe' in pkgs_to_build: @@ -1633,7 +1621,7 @@ class BBCooker: bb.debug(1, "Skipping %s for universe tasks as task %s doesn't exist" % (t, task)) continue if mc: - t = "mc:" + mc + ":" + t + t = "multiconfig:" + mc + ":" + t pkgs_to_build.append(t) return pkgs_to_build diff --git a/poky/bitbake/lib/bb/cookerdata.py b/poky/bitbake/lib/bb/cookerdata.py index 842275d530..50b6b6bd3a 100644 --- a/poky/bitbake/lib/bb/cookerdata.py +++ b/poky/bitbake/lib/bb/cookerdata.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2003, 2004 Phil Blundell @@ -342,24 +344,14 @@ class CookerDataBuilder(object): data = parse_config_file(layerconf, data) layers = (data.getVar('BBLAYERS') or "").split() - broken_layers = [] data = bb.data.createCopy(data) approved = bb.utils.approved_variables() - - # Check whether present layer directories exist for layer in layers: if not os.path.isdir(layer): - broken_layers.append(layer) - - if broken_layers: - parselog.critical("The following layer directories do not exist:") - for layer in broken_layers: - parselog.critical(" %s", layer) - parselog.critical("Please check BBLAYERS in %s" % (layerconf)) - sys.exit(1) - - for layer in layers: + parselog.critical("Layer directory '%s' does not exist! " + "Please check BBLAYERS in %s" % (layer, layerconf)) + sys.exit(1) parselog.debug(2, "Adding layer %s", layer) if 'HOME' in approved and '~' in layer: layer = os.path.expanduser(layer) diff --git a/poky/bitbake/lib/bb/data.py b/poky/bitbake/lib/bb/data.py index 92ef405304..2dcb16e56a 100644 --- a/poky/bitbake/lib/bb/data.py +++ b/poky/bitbake/lib/bb/data.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Data' implementations diff --git a/poky/bitbake/lib/bb/data_smart.py b/poky/bitbake/lib/bb/data_smart.py index dd5c618564..da67998b10 100644 --- a/poky/bitbake/lib/bb/data_smart.py +++ b/poky/bitbake/lib/bb/data_smart.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake Smart Dictionary Implementation diff --git a/poky/bitbake/lib/bb/event.py b/poky/bitbake/lib/bb/event.py index 7cbb5ca47e..656491494e 100644 --- a/poky/bitbake/lib/bb/event.py +++ b/poky/bitbake/lib/bb/event.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Event' implementation diff --git a/poky/bitbake/lib/bb/fetch2/__init__.py b/poky/bitbake/lib/bb/fetch2/__init__.py index f6b5529bb8..84327c2f8f 100644 --- a/poky/bitbake/lib/bb/fetch2/__init__.py +++ b/poky/bitbake/lib/bb/fetch2/__init__.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations diff --git a/poky/bitbake/lib/bb/fetch2/clearcase.py b/poky/bitbake/lib/bb/fetch2/clearcase.py index 9ed0d9beaa..09c9d0c33c 100644 --- a/poky/bitbake/lib/bb/fetch2/clearcase.py +++ b/poky/bitbake/lib/bb/fetch2/clearcase.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' clearcase implementation diff --git a/poky/bitbake/lib/bb/fetch2/cvs.py b/poky/bitbake/lib/bb/fetch2/cvs.py index 1b35ba4cf0..c780a6a45d 100644 --- a/poky/bitbake/lib/bb/fetch2/cvs.py +++ b/poky/bitbake/lib/bb/fetch2/cvs.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations diff --git a/poky/bitbake/lib/bb/fetch2/git.py b/poky/bitbake/lib/bb/fetch2/git.py index e171aa7eb1..80caf109b1 100644 --- a/poky/bitbake/lib/bb/fetch2/git.py +++ b/poky/bitbake/lib/bb/fetch2/git.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' git implementation diff --git a/poky/bitbake/lib/bb/fetch2/gitannex.py b/poky/bitbake/lib/bb/fetch2/gitannex.py index 1d497dcb0f..939e058127 100644 --- a/poky/bitbake/lib/bb/fetch2/gitannex.py +++ b/poky/bitbake/lib/bb/fetch2/gitannex.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' git annex implementation """ diff --git a/poky/bitbake/lib/bb/fetch2/gitsm.py b/poky/bitbake/lib/bb/fetch2/gitsm.py index c622771d21..0b3abe4c8c 100644 --- a/poky/bitbake/lib/bb/fetch2/gitsm.py +++ b/poky/bitbake/lib/bb/fetch2/gitsm.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' git submodules implementation diff --git a/poky/bitbake/lib/bb/fetch2/hg.py b/poky/bitbake/lib/bb/fetch2/hg.py index 15d729e7b2..289fcd14bf 100644 --- a/poky/bitbake/lib/bb/fetch2/hg.py +++ b/poky/bitbake/lib/bb/fetch2/hg.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementation for mercurial DRCS (hg). diff --git a/poky/bitbake/lib/bb/fetch2/local.py b/poky/bitbake/lib/bb/fetch2/local.py index 01d9ff9f8f..b04476fe48 100644 --- a/poky/bitbake/lib/bb/fetch2/local.py +++ b/poky/bitbake/lib/bb/fetch2/local.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations diff --git a/poky/bitbake/lib/bb/fetch2/npm.py b/poky/bitbake/lib/bb/fetch2/npm.py index 4427b1bb87..7235f899f4 100644 --- a/poky/bitbake/lib/bb/fetch2/npm.py +++ b/poky/bitbake/lib/bb/fetch2/npm.py @@ -1,6 +1,8 @@ # # SPDX-License-Identifier: GPL-2.0-only # +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' NPM implementation @@ -151,11 +153,20 @@ class Npm(FetchMethod): Parse the output of npm view --json; the last JSON result is assumed to be the one that we're interested in. ''' - pdata = json.loads(output); - try: - return pdata[-1] - except: - return pdata + pdata = None + outdeps = {} + datalines = [] + bracelevel = 0 + for line in output.splitlines(): + if bracelevel: + datalines.append(line) + elif '{' in line: + datalines = [] + datalines.append(line) + bracelevel = bracelevel + line.count('{') - line.count('}') + if datalines: + pdata = json.loads('\n'.join(datalines)) + return pdata def _getdependencies(self, pkg, data, version, d, ud, optional=False, fetchedlist=None): if fetchedlist is None: diff --git a/poky/bitbake/lib/bb/fetch2/osc.py b/poky/bitbake/lib/bb/fetch2/osc.py index 3e567155dc..19c0d9dcaa 100644 --- a/poky/bitbake/lib/bb/fetch2/osc.py +++ b/poky/bitbake/lib/bb/fetch2/osc.py @@ -1,6 +1,8 @@ # # SPDX-License-Identifier: GPL-2.0-only # +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ Bitbake "Fetch" implementation for osc (Opensuse build service client). Based on the svn "Fetch" implementation. diff --git a/poky/bitbake/lib/bb/fetch2/perforce.py b/poky/bitbake/lib/bb/fetch2/perforce.py index 54d001ec81..a03a36d340 100644 --- a/poky/bitbake/lib/bb/fetch2/perforce.py +++ b/poky/bitbake/lib/bb/fetch2/perforce.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementation for perforce diff --git a/poky/bitbake/lib/bb/fetch2/repo.py b/poky/bitbake/lib/bb/fetch2/repo.py index 2bdbbd4097..cd752d5283 100644 --- a/poky/bitbake/lib/bb/fetch2/repo.py +++ b/poky/bitbake/lib/bb/fetch2/repo.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake "Fetch" repo (git) implementation diff --git a/poky/bitbake/lib/bb/fetch2/s3.py b/poky/bitbake/lib/bb/fetch2/s3.py index ffca73c8e4..479528f926 100644 --- a/poky/bitbake/lib/bb/fetch2/s3.py +++ b/poky/bitbake/lib/bb/fetch2/s3.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementation for Amazon AWS S3. diff --git a/poky/bitbake/lib/bb/fetch2/sftp.py b/poky/bitbake/lib/bb/fetch2/sftp.py index f87f292e5d..f4a979197a 100644 --- a/poky/bitbake/lib/bb/fetch2/sftp.py +++ b/poky/bitbake/lib/bb/fetch2/sftp.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake SFTP Fetch implementation diff --git a/poky/bitbake/lib/bb/fetch2/ssh.py b/poky/bitbake/lib/bb/fetch2/ssh.py index f5be060c43..be2427cf9a 100644 --- a/poky/bitbake/lib/bb/fetch2/ssh.py +++ b/poky/bitbake/lib/bb/fetch2/ssh.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- ''' BitBake 'Fetch' implementations diff --git a/poky/bitbake/lib/bb/fetch2/svn.py b/poky/bitbake/lib/bb/fetch2/svn.py index 59ce93160c..6a82da9d52 100644 --- a/poky/bitbake/lib/bb/fetch2/svn.py +++ b/poky/bitbake/lib/bb/fetch2/svn.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementation for svn. @@ -91,13 +93,6 @@ class Svn(FetchMethod): svncmd = "%s log --limit 1 %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module) else: suffix = "" - - # externals may be either 'allowed' or 'nowarn', but not both. Allowed - # will not issue a warning, but will log to the debug buffer what has likely - # been downloaded by SVN. - if not ("externals" in ud.parm and ud.parm["externals"] == "allowed"): - options.append("--ignore-externals") - if ud.revision: options.append("-r %s" % ud.revision) suffix = "@%s" % (ud.revision) @@ -143,18 +138,6 @@ class Svn(FetchMethod): bb.fetch2.check_network_access(d, svnfetchcmd, ud.url) runfetchcmd(svnfetchcmd, d, workdir=ud.pkgdir) - if not ("externals" in ud.parm and ud.parm["externals"] == "nowarn"): - # Warn the user if this had externals (won't catch them all) - output = runfetchcmd("svn propget svn:externals", d, workdir=ud.moddir) - if output: - if "--ignore-externals" in svnfetchcmd.split(): - bb.warn("%s contains svn:externals." % ud.url) - bb.warn("These should be added to the recipe SRC_URI as necessary.") - bb.warn("svn fetch has ignored externals:\n%s" % output) - bb.warn("To disable this warning add ';externals=nowarn' to the url.") - else: - bb.debug(1, "svn repository has externals:\n%s" % output) - scmdata = ud.parm.get("scmdata", "") if scmdata == "keep": tar_flags = "" diff --git a/poky/bitbake/lib/bb/fetch2/wget.py b/poky/bitbake/lib/bb/fetch2/wget.py index 0f71ee4eac..143db1b361 100644 --- a/poky/bitbake/lib/bb/fetch2/wget.py +++ b/poky/bitbake/lib/bb/fetch2/wget.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations diff --git a/poky/bitbake/lib/bb/main.py b/poky/bitbake/lib/bb/main.py index ca59eb9af8..3c8746d2bd 100755 --- a/poky/bitbake/lib/bb/main.py +++ b/poky/bitbake/lib/bb/main.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2003, 2004 Phil Blundell @@ -491,7 +493,7 @@ def setup_bitbake(configParams, configuration, extrafeatures=None): def lockBitbake(): topdir = bb.cookerdata.findTopdir() if not topdir: - bb.error("Unable to find conf/bblayers.conf or conf/bitbake.conf. BBPATH is unset and/or not in a build directory?") + bb.error("Unable to find conf/bblayers.conf or conf/bitbake.conf. BBAPTH is unset and/or not in a build directory?") raise BBMainFatal lockfile = topdir + "/bitbake.lock" return topdir, bb.utils.lockfile(lockfile, False, False) diff --git a/poky/bitbake/lib/bb/methodpool.py b/poky/bitbake/lib/bb/methodpool.py index 51783acc1b..2f383c229c 100644 --- a/poky/bitbake/lib/bb/methodpool.py +++ b/poky/bitbake/lib/bb/methodpool.py @@ -1,3 +1,6 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# # # Copyright (C) 2006 Holger Hans Peter Freyther # diff --git a/poky/bitbake/lib/bb/monitordisk.py b/poky/bitbake/lib/bb/monitordisk.py index 69b25c7720..855452d2b4 100644 --- a/poky/bitbake/lib/bb/monitordisk.py +++ b/poky/bitbake/lib/bb/monitordisk.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2012 Robert Yang # diff --git a/poky/bitbake/lib/bb/msg.py b/poky/bitbake/lib/bb/msg.py index 6216eb3bc4..a116444fa1 100644 --- a/poky/bitbake/lib/bb/msg.py +++ b/poky/bitbake/lib/bb/msg.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'msg' implementation diff --git a/poky/bitbake/lib/bb/parse/ast.py b/poky/bitbake/lib/bb/parse/ast.py index f0911e6fb7..71ee49b8ce 100644 --- a/poky/bitbake/lib/bb/parse/ast.py +++ b/poky/bitbake/lib/bb/parse/ast.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ AbstractSyntaxTree classes for the Bitbake language """ diff --git a/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py b/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py index 889f230f79..cf84ddfb12 100644 --- a/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ class for handling .bb files @@ -29,7 +31,7 @@ __func_start_regexp__ = re.compile(r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*( __inherit_regexp__ = re.compile(r"inherit\s+(.+)" ) __export_func_regexp__ = re.compile(r"EXPORT_FUNCTIONS\s+(.+)" ) __addtask_regexp__ = re.compile(r"addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*") -__deltask_regexp__ = re.compile(r"deltask\s+(?P<func>\w+)(?P<ignores>.*)") +__deltask_regexp__ = re.compile(r"deltask\s+(?P<func>\w+)") __addhandler_regexp__ = re.compile(r"addhandler\s+(.+)" ) __def_regexp__ = re.compile(r"def\s+(\w+).*:" ) __python_func_regexp__ = re.compile(r"(\s+.*)|(^$)|(^#)" ) @@ -223,27 +225,11 @@ def feeder(lineno, s, fn, root, statements, eof=False): m = __addtask_regexp__.match(s) if m: - if len(m.group().split()) == 2: - # Check and warn for "addtask task1 task2" - m2 = re.match(r"addtask\s+(?P<func>\w+)(?P<ignores>.*)", s) - if m2 and m2.group('ignores'): - logger.warning('addtask ignored: "%s"' % m2.group('ignores')) - - # Check and warn for "addtask task1 before task2 before task3", the - # similar to "after" - taskexpression = s.split() - for word in ('before', 'after'): - if taskexpression.count(word) > 1: - logger.warning("addtask contained multiple '%s' keywords, only one is supported" % word) - ast.handleAddTask(statements, fn, lineno, m) return m = __deltask_regexp__.match(s) if m: - # Check and warn "for deltask task1 task2" - if m.group('ignores'): - logger.warning('deltask ignored: "%s"' % m.group('ignores')) ast.handleDelTask(statements, fn, lineno, m) return diff --git a/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py index 71bf61b761..cc70da0db6 100644 --- a/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py +++ b/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ class for handling configuration data files diff --git a/poky/bitbake/lib/bb/parse/parse_py/__init__.py b/poky/bitbake/lib/bb/parse/parse_py/__init__.py index cdebe440dd..696c71b458 100644 --- a/poky/bitbake/lib/bb/parse/parse_py/__init__.py +++ b/poky/bitbake/lib/bb/parse/parse_py/__init__.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake Parsers diff --git a/poky/bitbake/lib/bb/progress.py b/poky/bitbake/lib/bb/progress.py index 4022caa717..e9b72e28b9 100644 --- a/poky/bitbake/lib/bb/progress.py +++ b/poky/bitbake/lib/bb/progress.py @@ -13,7 +13,6 @@ import time import inspect import bb.event import bb.build -from bb.build import StdoutNoopContextManager class ProgressHandler(object): """ @@ -28,14 +27,7 @@ class ProgressHandler(object): if outfile: self._outfile = outfile else: - self._outfile = StdoutNoopContextManager() - - def __enter__(self): - self._outfile.__enter__() - return self - - def __exit__(self, *excinfo): - self._outfile.__exit__(*excinfo) + self._outfile = sys.stdout def _fire_progress(self, taskprogress, rate=None): """Internal function to fire the progress event""" @@ -155,12 +147,6 @@ class MultiStageProgressReporter(object): self._stage_total = None self._callers = [] - def __enter__(self): - return self - - def __exit__(self, *excinfo): - pass - def _fire_progress(self, taskprogress): bb.event.fire(bb.build.TaskProgress(taskprogress), self._data) diff --git a/poky/bitbake/lib/bb/providers.py b/poky/bitbake/lib/bb/providers.py index f80963cb40..78445d6a72 100644 --- a/poky/bitbake/lib/bb/providers.py +++ b/poky/bitbake/lib/bb/providers.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2003, 2004 Phil Blundell diff --git a/poky/bitbake/lib/bb/runqueue.py b/poky/bitbake/lib/bb/runqueue.py index 010b085010..c7047b3b84 100644 --- a/poky/bitbake/lib/bb/runqueue.py +++ b/poky/bitbake/lib/bb/runqueue.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'RunQueue' implementation @@ -39,7 +41,7 @@ def taskname_from_tid(tid): return tid.rsplit(":", 1)[1] def mc_from_tid(tid): - if tid.startswith('mc:'): + if tid.startswith('multiconfig:'): return tid.split(':')[1] return "" @@ -48,12 +50,12 @@ def split_tid(tid): return (mc, fn, taskname) def split_tid_mcfn(tid): - if tid.startswith('mc:'): + if tid.startswith('multiconfig:'): elems = tid.split(':') mc = elems[1] fn = ":".join(elems[2:-1]) taskname = elems[-1] - mcfn = "mc:" + mc + ":" + fn + mcfn = "multiconfig:" + mc + ":" + fn else: tid = tid.rsplit(":", 1) mc = "" @@ -65,7 +67,7 @@ def split_tid_mcfn(tid): def build_tid(mc, fn, taskname): if mc: - return "mc:" + mc + ":" + fn + ":" + taskname + return "multiconfig:" + mc + ":" + fn + ":" + taskname return fn + ":" + taskname class RunQueueStats: @@ -1655,7 +1657,7 @@ class RunQueue: recout = [] if len(hashfiles) == 2: out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb) - recout.extend(list(' ' + l for l in out2)) + recout.extend(list(' ' + l for l in out2)) else: recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2)) diff --git a/poky/bitbake/lib/bb/siggen.py b/poky/bitbake/lib/bb/siggen.py index fe580e487f..3e2a85fc8c 100644 --- a/poky/bitbake/lib/bb/siggen.py +++ b/poky/bitbake/lib/bb/siggen.py @@ -123,12 +123,6 @@ class SignatureGeneratorBasic(SignatureGenerator): k = fn + "." + task if not ignore_mismatch and k in self.basehash and self.basehash[k] != basehash[k]: bb.error("When reparsing %s, the basehash value changed from %s to %s. The metadata is not deterministic and this needs to be fixed." % (k, self.basehash[k], basehash[k])) - bb.error("The following commands may help:") - cmd = "$ bitbake %s -c%s" % (d.getVar('PN'), task) - # Make sure sigdata is dumped before run printdiff - bb.error("%s -Snone" % cmd) - bb.error("Then:") - bb.error("%s -Sprintdiff\n" % cmd) self.basehash[k] = basehash[k] self.taskdeps[fn] = taskdeps @@ -179,7 +173,7 @@ class SignatureGeneratorBasic(SignatureGenerator): def get_taskhash(self, fn, task, deps, dataCache): mc = '' - if fn.startswith('mc:'): + if fn.startswith('multiconfig:'): mc = fn.split(':')[1] k = fn + "." + task @@ -194,7 +188,7 @@ class SignatureGeneratorBasic(SignatureGenerator): depmc = pkgname.split(':')[1] if mc != depmc: continue - if dep.startswith("mc:") and not mc: + if dep.startswith("multiconfig:") and not mc: continue depname = dataCache.pkg_fn[pkgname] if not self.rundep_check(fn, recipename, task, dep, depname, dataCache): @@ -412,13 +406,13 @@ def list_inline_diff(oldlist, newlist, colors=None): def clean_basepath(a): mc = None - if a.startswith("mc:"): + if a.startswith("multiconfig:"): _, mc, a = a.split(":", 2) b = a.rsplit("/", 2)[1] + '/' + a.rsplit("/", 2)[2] if a.startswith("virtual:"): b = b + ":" + a.rsplit(":", 1)[0] if mc: - b = b + ":mc:" + mc + b = b + ":multiconfig:" + mc return b def clean_basepaths(a): @@ -643,10 +637,6 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False): a_taint = a_data.get('taint', None) b_taint = b_data.get('taint', None) if a_taint != b_taint: - if a_taint.startswith('nostamp:'): - a_taint = a_taint.replace('nostamp:', 'nostamp(uuid4):') - if b_taint.startswith('nostamp:'): - b_taint = b_taint.replace('nostamp:', 'nostamp(uuid4):') output.append(color_format("{color_title}Taint (by forced/invalidated task) changed{color_default} from %s to %s") % (a_taint, b_taint)) return output @@ -719,11 +709,7 @@ def dump_sigfile(a): output.append("Hash for dependent task %s is %s" % (dep, a_data['runtaskhashes'][dep])) if 'taint' in a_data: - if a_data['taint'].startswith('nostamp:'): - msg = a_data['taint'].replace('nostamp:', 'nostamp(uuid4):') - else: - msg = a_data['taint'] - output.append("Tainted (by forced/invalidated task): %s" % msg) + output.append("Tainted (by forced/invalidated task): %s" % a_data['taint']) if 'task' in a_data: computed_basehash = calc_basehash(a_data) diff --git a/poky/bitbake/lib/bb/taskdata.py b/poky/bitbake/lib/bb/taskdata.py index d13bd7c3bf..5c49739da3 100644 --- a/poky/bitbake/lib/bb/taskdata.py +++ b/poky/bitbake/lib/bb/taskdata.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'TaskData' implementation @@ -81,7 +83,7 @@ class TaskData: def add_mcdepends(task): for dep in task_deps['mcdepends'][task].split(): if len(dep.split(':')) != 5: - bb.msg.fatal("TaskData", "Error for %s:%s[%s], multiconfig dependency %s does not contain exactly four ':' characters.\n Task '%s' should be specified in the form 'mc:fromMC:toMC:packagename:task'" % (fn, task, 'mcdepends', dep, 'mcdepends')) + bb.msg.fatal("TaskData", "Error for %s:%s[%s], multiconfig dependency %s does not contain exactly four ':' characters.\n Task '%s' should be specified in the form 'multiconfig:fromMC:toMC:packagename:task'" % (fn, task, 'mcdepends', dep, 'mcdepends')) if dep not in self.mcdepends: self.mcdepends.append(dep) diff --git a/poky/bitbake/lib/bb/tests/codeparser.py b/poky/bitbake/lib/bb/tests/codeparser.py index 826a2d2f6d..742ccc2c27 100644 --- a/poky/bitbake/lib/bb/tests/codeparser.py +++ b/poky/bitbake/lib/bb/tests/codeparser.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Test for codeparser.py # diff --git a/poky/bitbake/lib/bb/tests/cooker.py b/poky/bitbake/lib/bb/tests/cooker.py index 090916e949..70b18598e1 100644 --- a/poky/bitbake/lib/bb/tests/cooker.py +++ b/poky/bitbake/lib/bb/tests/cooker.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Tests for cooker.py # diff --git a/poky/bitbake/lib/bb/tests/cow.py b/poky/bitbake/lib/bb/tests/cow.py index b4af4bbcbf..59ad242183 100644 --- a/poky/bitbake/lib/bb/tests/cow.py +++ b/poky/bitbake/lib/bb/tests/cow.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Tests for Copy-on-Write (cow.py) # diff --git a/poky/bitbake/lib/bb/tests/data.py b/poky/bitbake/lib/bb/tests/data.py index 3cf5abec70..8bd472a8be 100644 --- a/poky/bitbake/lib/bb/tests/data.py +++ b/poky/bitbake/lib/bb/tests/data.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Tests for the Data Store (data.py/data_smart.py) # diff --git a/poky/bitbake/lib/bb/tests/event.py b/poky/bitbake/lib/bb/tests/event.py index b6e40c6ae9..e6254c7a1e 100644 --- a/poky/bitbake/lib/bb/tests/event.py +++ b/poky/bitbake/lib/bb/tests/event.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Tests for the Event implementation (event.py) # diff --git a/poky/bitbake/lib/bb/tests/fetch.py b/poky/bitbake/lib/bb/tests/fetch.py index 16f975b137..9fca98e083 100644 --- a/poky/bitbake/lib/bb/tests/fetch.py +++ b/poky/bitbake/lib/bb/tests/fetch.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Tests for the Fetcher (fetch2/) # @@ -991,86 +993,6 @@ class FetcherNetworkTest(FetcherTest): self.assertTrue(os.path.exists(os.path.join(repo_path, 'edgelet/hsm-sys/azure-iot-hsm-c/deps/utpm/deps/c-utility/testtools/umock-c/deps/ctest/README.md')), msg='Missing submodule checkout') self.assertTrue(os.path.exists(os.path.join(repo_path, 'edgelet/hsm-sys/azure-iot-hsm-c/deps/utpm/deps/c-utility/testtools/umock-c/deps/testrunner/readme.md')), msg='Missing submodule checkout') -class SVNTest(FetcherTest): - def skipIfNoSvn(): - import shutil - if not shutil.which("svn"): - return unittest.skip("svn not installed, tests being skipped") - - if not shutil.which("svnadmin"): - return unittest.skip("svnadmin not installed, tests being skipped") - - return lambda f: f - - @skipIfNoSvn() - def setUp(self): - """ Create a local repository """ - - super(SVNTest, self).setUp() - - # Create something we can fetch - src_dir = tempfile.mkdtemp(dir=self.tempdir, - prefix='svnfetch_srcdir_') - src_dir = os.path.abspath(src_dir) - bb.process.run("echo readme > README.md", cwd=src_dir) - - # Store it in a local SVN repository - repo_dir = tempfile.mkdtemp(dir=self.tempdir, - prefix='svnfetch_localrepo_') - repo_dir = os.path.abspath(repo_dir) - bb.process.run("svnadmin create project", cwd=repo_dir) - - self.repo_url = "file://%s/project" % repo_dir - bb.process.run("svn import --non-interactive -m 'Initial import' %s %s/trunk" % (src_dir, self.repo_url), - cwd=repo_dir) - - bb.process.run("svn co %s svnfetch_co" % self.repo_url, cwd=self.tempdir) - # Github will emulate SVN. Use this to check if we're downloding... - bb.process.run("svn propset svn:externals 'bitbake http://github.com/openembedded/bitbake' .", - cwd=os.path.join(self.tempdir, 'svnfetch_co', 'trunk')) - bb.process.run("svn commit --non-interactive -m 'Add external'", - cwd=os.path.join(self.tempdir, 'svnfetch_co', 'trunk')) - - self.src_dir = src_dir - self.repo_dir = repo_dir - - @skipIfNoSvn() - def tearDown(self): - os.chdir(self.origdir) - if os.environ.get("BB_TMPDIR_NOCLEAN") == "yes": - print("Not cleaning up %s. Please remove manually." % self.tempdir) - else: - bb.utils.prunedir(self.tempdir) - - @skipIfNoSvn() - @skipIfNoNetwork() - def test_noexternal_svn(self): - # Always match the rev count from setUp (currently rev 2) - url = "svn://%s;module=trunk;protocol=file;rev=2" % self.repo_url.replace('file://', '') - fetcher = bb.fetch.Fetch([url], self.d) - fetcher.download() - os.chdir(os.path.dirname(self.unpackdir)) - fetcher.unpack(self.unpackdir) - - self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'trunk')), msg="Missing trunk") - self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'trunk', 'README.md')), msg="Missing contents") - self.assertFalse(os.path.exists(os.path.join(self.unpackdir, 'trunk/bitbake/trunk')), msg="External dir should NOT exist") - self.assertFalse(os.path.exists(os.path.join(self.unpackdir, 'trunk/bitbake/trunk', 'README')), msg="External README should NOT exit") - - @skipIfNoSvn() - def test_external_svn(self): - # Always match the rev count from setUp (currently rev 2) - url = "svn://%s;module=trunk;protocol=file;externals=allowed;rev=2" % self.repo_url.replace('file://', '') - fetcher = bb.fetch.Fetch([url], self.d) - fetcher.download() - os.chdir(os.path.dirname(self.unpackdir)) - fetcher.unpack(self.unpackdir) - - self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'trunk')), msg="Missing trunk") - self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'trunk', 'README.md')), msg="Missing contents") - self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'trunk/bitbake/trunk')), msg="External dir should exist") - self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'trunk/bitbake/trunk', 'README')), msg="External README should exit") - class TrustedNetworksTest(FetcherTest): def test_trusted_network(self): # Ensure trusted_network returns False when the host IS in the list. diff --git a/poky/bitbake/lib/bb/tests/parse.py b/poky/bitbake/lib/bb/tests/parse.py index 9afd1b208e..78c611fb12 100644 --- a/poky/bitbake/lib/bb/tests/parse.py +++ b/poky/bitbake/lib/bb/tests/parse.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Test for lib/bb/parse/ # @@ -174,21 +176,3 @@ python () { self.assertEqual(d1.getVar("VAR_var"), "B") self.assertEqual(d2.getVar("VAR_var"), None) - addtask_deltask = """ -addtask do_patch after do_foo after do_unpack before do_configure before do_compile -addtask do_fetch do_patch - -deltask do_fetch do_patch -""" - def test_parse_addtask_deltask(self): - import sys - f = self.parsehelper(self.addtask_deltask) - d = bb.parse.handle(f.name, self.d)[''] - - stdout = sys.stdout.getvalue() - self.assertTrue("addtask contained multiple 'before' keywords" in stdout) - self.assertTrue("addtask contained multiple 'after' keywords" in stdout) - self.assertTrue('addtask ignored: " do_patch"' in stdout) - self.assertTrue('deltask ignored: " do_patch"' in stdout) - #self.assertTrue('dependent task do_foo for do_patch does not exist' in stdout) - diff --git a/poky/bitbake/lib/bb/tests/persist_data.py b/poky/bitbake/lib/bb/tests/persist_data.py index f641b5acbc..dbb3ce183d 100644 --- a/poky/bitbake/lib/bb/tests/persist_data.py +++ b/poky/bitbake/lib/bb/tests/persist_data.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Test for lib/bb/persist_data/ # diff --git a/poky/bitbake/lib/bb/tests/utils.py b/poky/bitbake/lib/bb/tests/utils.py index f4adf1d44b..1f01447bbb 100644 --- a/poky/bitbake/lib/bb/tests/utils.py +++ b/poky/bitbake/lib/bb/tests/utils.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Tests for utils.py # @@ -29,10 +31,6 @@ class VerCmpString(unittest.TestCase): self.assertTrue(result < 0) result = bb.utils.vercmp_string('1.1', '1.0+1.1-beta1') self.assertTrue(result > 0) - result = bb.utils.vercmp_string('1a', '1a1') - self.assertTrue(result < 0) - result = bb.utils.vercmp_string('1a1', '1a') - self.assertTrue(result > 0) result = bb.utils.vercmp_string('1.', '1.1') self.assertTrue(result < 0) result = bb.utils.vercmp_string('1.1', '1.') diff --git a/poky/bitbake/lib/bb/ui/knotty.py b/poky/bitbake/lib/bb/ui/knotty.py index 88f638fb38..58e6b8e364 100644 --- a/poky/bitbake/lib/bb/ui/knotty.py +++ b/poky/bitbake/lib/bb/ui/knotty.py @@ -212,23 +212,6 @@ class TerminalFilter(object): sys.stdout.flush() self.footer_present = False - def elapsed(self, sec): - hrs = int(sec / 3600.0) - sec -= hrs * 3600 - min = int(sec / 60.0) - sec -= min * 60 - if hrs > 0: - return "%dh%dm%ds" % (hrs, min, sec) - elif min > 0: - return "%dm%ds" % (min, sec) - else: - return "%ds" % (sec) - - def keepAlive(self, t): - if not self.cuu: - print("Bitbake still alive (%ds)" % t) - sys.stdout.flush() - def updateFooter(self): if not self.cuu: return @@ -265,7 +248,7 @@ class TerminalFilter(object): else: start_time = activetasks[t].get("starttime", None) if start_time: - tasks.append("%s - %s (pid %s)" % (activetasks[t]["title"], self.elapsed(currenttime - start_time), t)) + tasks.append("%s - %ds (pid %s)" % (activetasks[t]["title"], currenttime - start_time, t)) else: tasks.append("%s (pid %s)" % (activetasks[t]["title"], t)) @@ -300,8 +283,8 @@ class TerminalFilter(object): if start_time: pbar.start_time = start_time pbar.setmessage('%s:%s' % (tasknum, pbar.msg.split(':', 1)[1])) - pbar.setextra(rate) if progress > -1: + pbar.setextra(rate) content = pbar.update(progress) else: content = pbar.update(1) @@ -462,17 +445,11 @@ def main(server, eventHandler, params, tf = TerminalFilter): warnings = 0 taskfailures = [] - printinterval = 5000 - lastprint = time.time() - termfilter = tf(main, helper, console, errconsole, format, params.options.quiet) atexit.register(termfilter.finish) while True: try: - if (lastprint + printinterval) <= time.time(): - termfilter.keepAlive(printinterval) - printinterval += 5000 event = eventHandler.waitEvent(0) if event is None: if main.shutdown > 1: @@ -501,8 +478,6 @@ def main(server, eventHandler, params, tf = TerminalFilter): continue if isinstance(event, logging.LogRecord): - lastprint = time.time() - printinterval = 5000 if event.levelno >= format.ERROR: errors = errors + 1 return_value = 1 diff --git a/poky/bitbake/lib/bb/ui/uievent.py b/poky/bitbake/lib/bb/ui/uievent.py index fedb05064d..7276bdaf9d 100644 --- a/poky/bitbake/lib/bb/ui/uievent.py +++ b/poky/bitbake/lib/bb/ui/uievent.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2007 Richard Purdie diff --git a/poky/bitbake/lib/bb/ui/uihelper.py b/poky/bitbake/lib/bb/ui/uihelper.py index db7f0ca08b..45519c8afd 100644 --- a/poky/bitbake/lib/bb/ui/uihelper.py +++ b/poky/bitbake/lib/bb/ui/uihelper.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2007 Richard Purdie diff --git a/poky/bitbake/lib/bb/utils.py b/poky/bitbake/lib/bb/utils.py index ed19825faf..e438694082 100644 --- a/poky/bitbake/lib/bb/utils.py +++ b/poky/bitbake/lib/bb/utils.py @@ -1,3 +1,5 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake Utility Functions """ |
