mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2024-11-30 07:50:58 +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() {
|
||||
# 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
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue