1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
# shellcheck shell=sh
#
# this file is to be sourced by other shell-scripts
# it's POSIX-compliant
ssr_addalternatives() {
# usage: ssr_addalternatives <file> <flavor> <priority>
# e.g. 'ssr_addalternatives /usr/share/soundscaperenderer-nox/alternatives .nox'
cat "$1" | while read f; do
if [ -x "/usr/bin/${f}${2}" ]; then
update-alternatives --install "/usr/bin/${f}" "${f}" "/usr/bin/${f}${2}" "${3}" \
--slave "/usr/share/man/man1/${f}.1.gz" "${f}.1.gz" "/usr/share/man/man1/${f}${2}.1.gz"
fi
done
}
ssr_delalternatives() {
# usage: ssr_delalternatives <file> <flavor>
# e.g. 'ssr_delalternatives /usr/share/soundscaperenderer/alternatives .qt'
cat "$1" | while read f; do
if [ -x "/usr/bin/${f}${2}" ]; then
update-alternatives --remove "${f}" "/usr/bin/${f}${2}"
fi
done
}
|