summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/pacman/pactest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py
index b2b9c289..cba439c3 100755
--- a/test/pacman/pactest.py
+++ b/test/pacman/pactest.py
@@ -49,7 +49,7 @@ def create_parser():
help = "set debug level for pacman")
parser.add_option("-p", "--pacman", action = "callback",
callback = resolve_binary_path, type = "string",
- dest = "bin", default = "pacman",
+ dest = "bin", default = util.which("pacman"),
help = "specify location of the pacman binary")
parser.add_option("--keep-root", action = "store_true",
dest = "keeproot", default = False,
@@ -86,6 +86,10 @@ if __name__ == "__main__":
opt_parser = create_parser()
(opts, args) = opt_parser.parse_args()
+ if opts.bin is None or not os.access(opts.bin, os.X_OK):
+ tap.bail("cannot locate pacman binary")
+ sys.exit(2)
+
# instantiate env
root_path = tempfile.mkdtemp(prefix='pactest-')
env = pmenv.pmenv(root=root_path)