From bf2562ba1ea13d65fe499ad28c56be5a275828fa Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Thu, 5 Apr 2018 14:16:24 +0200 Subject: Alpine support (#269) * work around restricted/different coreutils * alpine: have CI test alpine --- kerl | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'kerl') diff --git a/kerl b/kerl index 6acdcb4..e561866 100755 --- a/kerl +++ b/kerl @@ -1083,21 +1083,26 @@ ACTIVATE_CSH build_plt "$absdir" fi - PID=$$ - PARENT_PID=$(ps -p $PID -o ppid=) || exit 1 - # shellcheck disable=SC2086 - PARENT_CMD=$(ps -p $PARENT_PID -o ucomm | tail -n 1) - case "$PARENT_CMD" in - fish) - SHELL_SUFFIX='.fish' - ;; - csh) - SHELL_SUFFIX='.csh' - ;; - *) - SHELL_SUFFIX='' - ;; - esac + if which apk >/dev/null 2>&1; then + # Running on Alpine Linux, assuming non-exotic shell + SHELL_SUFFIX='' + else + PID=$$ + PARENT_PID=$(ps -p $PID -o ppid=) || exit 1 + # shellcheck disable=SC2086 + PARENT_CMD=$(ps -p $PARENT_PID -o ucomm | tail -n 1) + case "$PARENT_CMD" in + fish) + SHELL_SUFFIX='.fish' + ;; + csh) + SHELL_SUFFIX='.csh' + ;; + *) + SHELL_SUFFIX='' + ;; + esac + fi echo 'You can activate this installation running the following command:' echo ". $absdir/activate$SHELL_SUFFIX" -- cgit v1.2.3