From patchwork Thu May 24 10:01:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel] bitbake/cooker: Ensure matchFile returns full pathnames Date: Thu, 24 May 2012 10:01:16 -0000 From: Richard Purdie X-Patchwork-Id: 28589 Message-Id: <1337853676.8248.104.camel@ted> To: bitbake-devel We should always be passing full pathnames around within bitbake. If a file was referenced as a relative path to the current working directory, it might not get passed through the abspath call and hence the cwd would not get added as a prefix. This change attempts to put everything through abspath and ignores failures. Any failure cases would mean the file simply wouldn't exist and then would get covered by the catchall code below. [YOCTO #1465] Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 8ad4922..e036efb 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -985,9 +985,10 @@ class BBCooker: """ Find the .bb files which match the expression in 'buildfile'. """ - - if bf.startswith("/") or bf.startswith("../"): + try: bf = os.path.abspath(bf) + except: + pass filelist, masked = self.collect_bbfiles() try: os.stat(bf)