From 65b5553278980c3de62b835b034b1fcaf5d6db23 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 27 May 2011 15:11:49 +0100 Subject: bitbake/cooker.py: Fix -b option regexp handling bitbake -b core-image was showing no matches when it should list all targets containing the fragment "core-image". This patch only calls os.path.abspath() on things that look like paths and passed the path around more consistently to various functions to get this use case working again. (Bitbake rev: 6e9119c42d3f4cb3dab3d25856eee8b4bf4ad94f) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index b708943682..8b144fbee4 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -679,22 +679,22 @@ class BBCooker: bb.data.setVar("BUILDNAME", time.strftime('%Y%m%d%H%M'), self.configuration.data) bb.data.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', time.gmtime()), self.configuration.data) - def matchFiles(self, buildfile): + def matchFiles(self, bf): """ Find the .bb files which match the expression in 'buildfile'. """ - bf = os.path.abspath(buildfile) + if bf.startswith("/") or bf.startswith("../"): + bf = os.path.abspath(bf) filelist, masked = self.collect_bbfiles() try: os.stat(bf) return [bf] except OSError: - regexp = re.compile(buildfile) + regexp = re.compile(bf) matches = [] for f in filelist: if regexp.search(f) and os.path.isfile(f): - bf = f matches.append(f) return matches @@ -725,8 +725,7 @@ class BBCooker: task = self.configuration.cmd fn, cls = bb.cache.Cache.virtualfn2realfn(buildfile) - fn = os.path.abspath(fn) - buildfile = self.matchFile(fn) + fn = self.matchFile(fn) self.buildSetVars() @@ -735,7 +734,7 @@ class BBCooker: self.configuration.data) infos = dict(infos) - fn = bb.cache.Cache.realfn2virtual(buildfile, cls) + fn = bb.cache.Cache.realfn2virtual(fn, cls) try: maininfo = infos[fn] except KeyError: -- cgit v1.2.3-54-g00ecf