[lua-torch-trepl] 04/05: d/*: update wrapper script th
Zhou Mo
cdluminate-guest at moszumanska.debian.org
Thu Aug 25 12:15:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
cdluminate-guest pushed a commit to branch master
in repository lua-torch-trepl.
commit 4e96d147d057c1d4279632fd4c635b81139ce945
Author: Zhou Mo <cdluminate at gmail.com>
Date: Thu Aug 25 12:12:10 2016 +0000
d/*: update wrapper script th
---
debian/th | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/debian/th b/debian/th
index 036c0f1..2b29ff2 100755
--- a/debian/th
+++ b/debian/th
@@ -10,14 +10,17 @@ TREPL=/usr/lib/torch-trepl/th
# probe lua interpreters, only luajit (recommend) and
# lua5.1 are supported. Here I don't use hardcoded lua
# interpreter path so user can override the default
-# interpreter without modifying this script.
-which luajit 1>/dev/null && \
- LUA=$(which luajit) || \
+# interpreter with `$PATH` instead of modifying this script.
+if test -z "`which luajit 1>/dev/null`"; then
+ LUA=$(which luajit)
+else
printf "I: luajit not found, falling back to lua5.1\n";
-if test -z "$LUA"; then
- which lua5.1 1>/dev/null && \
- LUA=$(which lua5.1) || \
- (printf "E: lua5.1 not found.\n"; false)
+ if test -z "`which lua5.1 1>/dev/null`"; then
+ LUA=$(which lua5.1)
+ else
+ printf "E: lua5.1 not found. No available lua interpreter.\n"
+ false
+ fi
fi
# run the real trepl script with possible arguments
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/lua-torch-trepl.git
More information about the debian-science-commits
mailing list