Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 73 lines (59 sloc) 1.29 KB
#!/bin/bash
extension_args=()
while (( $# ))
do
token="$1"
shift
case "$token" in
(--trace|trace)
extension_args+=("--trace=all")
;;
(--prefix=*)
prefix_path="${token/*=}"
;;
(--prefix|prefix)
prefix_path="$1"
if ! shift
then
echo "ERROR: A prefix path must be followed by keyword 'prefix'."
exit 1
fi
;;
(DESTROOT=)
DESTROOT="${token/*=}"
;;
(DESTROOT)
DESTROOT="$1"
if ! shift
then
echo "ERROR: A DESTROOT path must be followed by keyword 'DESTROOT'."
exit 1
fi
;;
(*)
extension_args+=("$token")
;;
esac
done
if [[ -n "${prefix_path}" ]]
then
sm_path="${DESTROOT:-}${prefix_path}/sm"
elif [[ -z "${sm_path:-}" ]]
then
if (( UID ))
then
sm_path="${DESTROOT:-}$HOME/.sm"
else
sm_path="${DESTROOT:-}/opt/sm"
fi
fi
# set BDSM basic paths
install_path="${sm_path}" # Path to install everything to.
archives_path="${sm_path}/archives"
scm_path="${sm_path}/scm"
src_path="${sm_path}/src"
extension_sets_home="${sm_path}/sets"
extension_exts_home="${sm_path}/exts"
export sm_path install_path archives_path scm_path src_path \
extension_sets_home DESTROOT
exec "${PWD}/local" --call=install/install_sm "${extension_args[@]}"
Jump to Line
Something went wrong with that request. Please try again.