summaryrefslogtreecommitdiffstats
path: root/src/usr/local/sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-13 16:08:12 -0300
committerRenato Botelho <renato@netgate.com>2015-10-13 16:08:12 -0300
commitbb12c4b1957cb890a9edc5e9705c05573bc12961 (patch)
treecdcd0aaf2b2c3a6d6986219dc109b21c43b35606 /src/usr/local/sbin
parent3c5a06e798f0840c1632e72ac9694bdb2216ae5c (diff)
downloadpfsense-bb12c4b1957cb890a9edc5e9705c05573bc12961.zip
pfsense-bb12c4b1957cb890a9edc5e9705c05573bc12961.tar.gz
Add -f option to force package reinstallation
Diffstat (limited to 'src/usr/local/sbin')
-rwxr-xr-xsrc/usr/local/sbin/pfSense-upgrade18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade
index 292200a..c81b54e 100755
--- a/src/usr/local/sbin/pfSense-upgrade
+++ b/src/usr/local/sbin/pfSense-upgrade
@@ -47,9 +47,10 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
usage() {
- echo "Usage: $(basename ${0}) [-bdy] [-u|-i PKG_NAME|-r PKG_NAME]" >&2
+ echo "Usage: $(basename ${0}) [-bdyf] [-u|-i PKG_NAME|-r PKG_NAME]" >&2
echo " -b - Platform is booting" >&2
echo " -d - Turn on debug" >&2
+ echo " -f - Force package installation" >&2
echo " -h - Show this usage help" >&2
echo " -l - Logfile name in /cf/conf/ (defaults to upgrade_log.txt)" >&2
echo " -p FIFO - Write pkg progress to FIFO"
@@ -475,6 +476,11 @@ compare_pkg_version() {
pkg_install() {
local _pkg_name="${1}"
+ local _force=""
+ if [ -n "${2}" ]; then
+ _force="-f"
+ fi
+
if [ -z "${_pkg_name}" ]; then
_echo "ERROR: Blank package name"
_exit 1
@@ -492,7 +498,7 @@ pkg_install() {
_echo "Installed ${_pkg_name} version is newer than remote"
_exit 0
fi
- local _cmd="upgrade"
+ local _cmd="upgrade ${_force}"
local _msg="Upgrading"
else
local _cmd="install"
@@ -547,11 +553,12 @@ export chroot_dir=""
unset booting
unset boot_stage
+unset force
unset yes
unset progress_fifo
unset action
unset action_pkg
-while getopts b:di:hp:l:r:uy opt; do
+while getopts b:dfi:hp:l:r:uy opt; do
case ${opt} in
b)
booting=1
@@ -560,6 +567,9 @@ while getopts b:di:hp:l:r:uy opt; do
d)
stdout=''
;;
+ f)
+ force=1
+ ;;
i)
if [ -n "${action}" ]; then
usage
@@ -644,7 +654,7 @@ case "${action}" in
pkg_update force
;;
install)
- pkg_install ${action_pkg}
+ pkg_install ${action_pkg} ${force}
;;
delete)
pkg_delete ${action_pkg}
OpenPOWER on IntegriCloud