summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-29 23:15:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-30 22:26:30 +0000
commitf5f3ef7b09ab3790da92f8bef83835033bbeb0ac (patch)
tree29738d839ecaa60576babcfbbdda836dc489bce3 /bitbake/lib/bb/utils.py
parentea03ed0e8da1110e5cd27365f7b1f3f071572d02 (diff)
downloadpoky-f5f3ef7b09ab3790da92f8bef83835033bbeb0ac.tar.gz
bitbake: parse/ConfHander/BBHandler/utils: Fix cache dependency bugs
Currently bitbake only adds files to its dependency list if they exist. If you add 'include foo.inc' to your recipe and the file doesn't exist, then later you add the file, the cache will not be invalidated. This leads to another bug which is that if files don't exist and then you add them and they should be found first due to BBPATH, again the cache won't invalidate. This patch adds in tracking of files we check for the existence of so that if they are added later, the cache correctly invalidates. This necessitated a new version of bb.utils.which which returns a list of files tested for. The patch also adds in checks for duplicate file includes and for now prints a warning about this. That will likely become a fatal error at some point since its never usually desired to include a file twice. The same issue is also fixed for class inheritance. Now when a class is added which would be found in the usual search path, it will cause the cache to be invalidated. Unfortunately this is old code in bitbake and the patch isn't the neatest since we have to work within that framework. [YOCTO #5611] [YOCTO #4425] (Bitbake rev: 78d285871e4b8c54ccc4602d571e85f922e37ccd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 560f55a074..0be45e1af6 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -796,22 +796,28 @@ def copyfile(src, dest, newmtime = None, sstat = None):
796 newmtime = sstat[stat.ST_MTIME] 796 newmtime = sstat[stat.ST_MTIME]
797 return newmtime 797 return newmtime
798 798
799def which(path, item, direction = 0): 799def which(path, item, direction = 0, history = False):
800 """ 800 """
801 Locate a file in a PATH 801 Locate a file in a PATH
802 """ 802 """
803 803
804 hist = []
804 paths = (path or "").split(':') 805 paths = (path or "").split(':')
805 if direction != 0: 806 if direction != 0:
806 paths.reverse() 807 paths.reverse()
807 808
808 for p in paths: 809 for p in paths:
809 next = os.path.join(p, item) 810 next = os.path.join(p, item)
811 hist.append(next)
810 if os.path.exists(next): 812 if os.path.exists(next):
811 if not os.path.isabs(next): 813 if not os.path.isabs(next):
812 next = os.path.abspath(next) 814 next = os.path.abspath(next)
815 if history:
816 return next, hist
813 return next 817 return next
814 818
819 if history:
820 return "", hist
815 return "" 821 return ""
816 822
817def to_boolean(string, default=None): 823def to_boolean(string, default=None):