From 9e1847f1193b0862c01689622a1427b26e925216 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 May 2018 15:58:31 +0200 Subject: Minor improvements to build scripts --- build.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'build.sh') 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 Alternative installation directory." - diag " --sudo Optional sudo program to use." + diag " --sudo Optional sudo program to use (pass false to disable)." diag " --repo Alternative package repository location." diag " --trust Repository certificate fingerprint to trust." diag " --timeout 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 -- cgit v1.1