]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake/cooker.py: Fix -b option regexp handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 27 May 2011 14:11:49 +0000 (15:11 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 27 May 2011 16:23:55 +0000 (17:23 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/cooker.py

index 6ecb4f7a9a49dcebc823531e1050757f53759e41..415e1f3011ae4868b3acf543099e18dd2d67b61a 100644 (file)
@@ -666,22 +666,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
 
@@ -712,8 +712,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()
 
@@ -722,7 +721,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: