Add 'reinstall' command.

The 'install' command does nothing if the package is detected to be
already installed, but there are circumstances where we will want to
trigger a rebuild and reinstall explicitly. Separate out into two
commands, one of which is a superset of the other.
This commit is contained in:
Simon Howard 2016-02-17 00:29:56 -05:00
parent cb4b2cbdd6
commit 7db68eee5f

View file

@ -167,12 +167,7 @@ build_package() {
)
}
install_package() {
# Already installed?
if check_installed; then
return
fi
reinstall_package() {
build_package "$PACKAGE_NAME"
cd "$PACKAGE_BUILD_DIR"
@ -181,6 +176,13 @@ install_package() {
)
}
install_package() {
# Already installed? Don't install again.
if ! check_installed; then
reinstall_package
fi
}
if [ $# -lt 2 ]; then
echo "Usage: $0 [fetch|build|install|installed] <package name>"
exit -1
@ -196,6 +198,9 @@ case "$cmd" in
build)
build_package
;;
reinstall)
reinstall_package
;;
install)
install_package
;;