mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2024-12-02 17:12:52 +00:00
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:
parent
cb4b2cbdd6
commit
7db68eee5f
1 changed files with 11 additions and 6 deletions
|
@ -167,12 +167,7 @@ build_package() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
install_package() {
|
reinstall_package() {
|
||||||
# Already installed?
|
|
||||||
if check_installed; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
build_package "$PACKAGE_NAME"
|
build_package "$PACKAGE_NAME"
|
||||||
|
|
||||||
cd "$PACKAGE_BUILD_DIR"
|
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
|
if [ $# -lt 2 ]; then
|
||||||
echo "Usage: $0 [fetch|build|install|installed] <package name>"
|
echo "Usage: $0 [fetch|build|install|installed] <package name>"
|
||||||
exit -1
|
exit -1
|
||||||
|
@ -196,6 +198,9 @@ case "$cmd" in
|
||||||
build)
|
build)
|
||||||
build_package
|
build_package
|
||||||
;;
|
;;
|
||||||
|
reinstall)
|
||||||
|
reinstall_package
|
||||||
|
;;
|
||||||
install)
|
install)
|
||||||
install_package
|
install_package
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue