Honor NOSUDO and --prefix in sys/install.sh ##build

This commit is contained in:
pancake 2024-05-11 11:28:49 +02:00 committed by GitHub
parent 0364181115
commit 145df15c75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 9 deletions

View File

@ -38,6 +38,9 @@ for a in $* ; do
'')
:
;;
'--prefix='*)
PREFIX=`echo "$1" | cut -d = -f 2`
;;
--**|-)
shift
CFGARG="${CFGARG} $a"

View File

@ -67,6 +67,7 @@ while : ; do
;;
'--prefix='*)
PREFIX=`echo "$1" | cut -d = -f 2`
ARGS="${ARGS} $1"
;;
-*)
# just for the penguin face case
@ -127,19 +128,21 @@ else
[ -n "${NOSUDO}" ] && SUDO=
fi
if [ "$(id -u)" = 0 ]; then
SUDO=""
else
if [ -d /system/bin ]; then
# This is an android
if [ "${NOSUDO}" != 1 ]; then
if [ "$(id -u)" = 0 ]; then
SUDO=""
else
[ -n "${NOSUDO}" ] && SUDO="echo NOTE: sudo not found. Please run as root: "
if [ -d /system/bin ]; then
# This is an android
SUDO=""
else
[ -n "${NOSUDO}" ] && SUDO="echo NOTE: sudo not found. Please run as root: "
fi
fi
fi
if [ "${USE_SU}" = 1 ]; then
SUDO="/bin/su -m root -c"
if [ "${USE_SU}" = 1 ]; then
SUDO="/bin/su -m root -c"
fi
fi
${SHELL} --help 2> /dev/null | grep -q fish