index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | pactest/util.py | 8 |
diff --git a/pactest/util.py b/pactest/util.py index 99d71e55..72777ca0 100755 --- a/pactest/util.py +++ b/pactest/util.py @@ -235,6 +235,14 @@ def diffmtime(mt1, mt2): # Miscellaneous # +def which(filename): + path = os.environ["PATH"].split(':') + for p in path: + f = os.path.join(p, filename) + if os.access(f, os.F_OK): + return f + return None + def grep(filename, pattern): lines = file(filename, 'r').readlines() for line in lines: |