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 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):