summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
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 f9ee4f1c1d..20dea64c0e 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -793,22 +793,28 @@ def copyfile(src, dest, newmtime = None, sstat = None):
793 newmtime = sstat[stat.ST_MTIME] 793 newmtime = sstat[stat.ST_MTIME]
794 return newmtime 794 return newmtime
795 795
796def which(path, item, direction = 0): 796def which(path, item, direction = 0, history = False):
797 """ 797 """
798 Locate a file in a PATH 798 Locate a file in a PATH
799 """ 799 """
800 800
801 hist = []
801 paths = (path or "").split(':') 802 paths = (path or "").split(':')
802 if direction != 0: 803 if direction != 0:
803 paths.reverse() 804 paths.reverse()
804 805
805 for p in paths: 806 for p in paths:
806 next = os.path.join(p, item) 807 next = os.path.join(p, item)
808 hist.append(next)
807 if os.path.exists(next): 809 if os.path.exists(next):
808 if not os.path.isabs(next): 810 if not os.path.isabs(next):
809 next = os.path.abspath(next) 811 next = os.path.abspath(next)
812 if history:
813 return next, hist
810 return next 814 return next
811 815
816 if history:
817 return "", hist
812 return "" 818 return ""
813 819
814def to_boolean(string, default=None): 820def to_boolean(string, default=None):