Files
AndroidDeviceStreaming/deploy/deb-cli-links.sh
T

32 lines
1.0 KiB
Bash

#!/bin/sh
# Template expanded into Debian maintainer scripts by build-linux-packages.sh.
set -eu
package='@PACKAGE@'
priority='@PRIORITY@'
hook='@HOOK@'
prefix="/opt/ttstd/$package"
# DPKG_ROOT also permits real dpkg lifecycle tests without touching host links.
root=${DPKG_ROOT:-}
alternatives() {
if [ -n "$root" ]; then
update-alternatives --root "$root" "$@"
else
update-alternatives "$@"
fi
}
case "$hook:${1:-}" in
postinst:configure|postinst:triggered|postinst:abort-upgrade|postinst:abort-remove|postinst:abort-deconfigure)
for tool in adsctl ads-agent ads-client ads-usb; do
if [ -x "$root$prefix/$tool" ]; then
alternatives --install "/usr/bin/$tool" "$tool" "$prefix/$tool" "$priority"
fi
done
;;
prerm:remove|prerm:deconfigure|postrm:remove|postrm:purge|postrm:disappear)
for tool in adsctl ads-agent ads-client ads-usb; do
alternatives --remove "$tool" "$prefix/$tool"
done
;;
esac
exit 0