From 7db68eee5fa4346e4c3543b39e3f23ab981d1c7a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 17 Feb 2016 00:29:56 -0500 Subject: [PATCH] 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. --- chocpkg/chocpkg | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/chocpkg/chocpkg b/chocpkg/chocpkg index 0ea907c..581deec 100755 --- a/chocpkg/chocpkg +++ b/chocpkg/chocpkg @@ -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] " exit -1 @@ -196,6 +198,9 @@ case "$cmd" in build) build_package ;; + reinstall) + reinstall_package + ;; install) install_package ;;