aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-17 15:58:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-17 15:58:31 +0200
commit9e1847f1193b0862c01689622a1427b26e925216 (patch)
treeb218982dfffffb7fd7265d4ce876529b079d0e67 /build.sh
parent590ba56543bd8e10c05cd8bf9e9ff6ff1f72e03e (diff)
Minor improvements to build scripts
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/build.sh b/build.sh
index bcb851d..b6f3994 100755
--- a/build.sh
+++ b/build.sh
@@ -32,7 +32,7 @@ run ()
diag "+ $@"
"$@"
if test "$?" -ne "0"; then
- exit 1;
+ exit 1
fi
}
@@ -41,20 +41,19 @@ owd="$(pwd)"
cxx=
idir=
sudo=
-sudo_set=
trust=
timeout=
make=
verbose=
while test $# -ne 0; do
- case $1 in
+ case "$1" in
-h|--help)
diag
diag "$usage"
diag "Options:"
diag " --install-dir <dir> Alternative installation directory."
- diag " --sudo <prog> Optional sudo program to use."
+ diag " --sudo <prog> Optional sudo program to use (pass false to disable)."
diag " --repo <loc> Alternative package repository location."
diag " --trust <fp> Repository certificate fingerprint to trust."
diag " --timeout <sec> Network operations timeout in seconds."
@@ -98,7 +97,6 @@ while test $# -ne 0; do
exit 1
fi
sudo="$1"
- sudo_set="y"
shift
;;
--repo)
@@ -170,11 +168,15 @@ fi
if test -z "$idir"; then
idir="/usr/local"
- if test -z "$sudo_set"; then
+ if test -z "$sudo"; then
sudo="sudo"
fi
fi
+if test "$sudo" = false; then
+ sudo=
+fi
+
if test -f build/config.build; then
diag "error: current directory already configured, start with clean source"
exit 1