diff options
author | Renato Botelho <renato@netgate.com> | 2016-02-01 10:15:10 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-02-01 10:15:10 -0200 |
commit | 73e4bf68ebca91e9f2716d0b68c499455a749edf (patch) | |
tree | 6ed0b65aeb2e468a81320cb504bbf30b80ee9443 /src/usr/local/sbin/pfSense-upgrade | |
parent | 93a8ddf7a4c5d43cbeb623c923eb76659e6f49e0 (diff) | |
download | pfsense-73e4bf68ebca91e9f2716d0b68c499455a749edf.zip pfsense-73e4bf68ebca91e9f2716d0b68c499455a749edf.tar.gz |
Respect ALL_PACKAGES for package removal
Diffstat (limited to 'src/usr/local/sbin/pfSense-upgrade')
-rwxr-xr-x | src/usr/local/sbin/pfSense-upgrade | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade index 665f1b7..540c587 100755 --- a/src/usr/local/sbin/pfSense-upgrade +++ b/src/usr/local/sbin/pfSense-upgrade @@ -639,6 +639,17 @@ pkg_delete() { _exec "pkg autoremove" "Removing stale packages" mute ignore_result } +# Delete every pfSense-pkg-* package +pkg_delete_all() { + for _pkg in $(pkg query -e '%a == 0' %n); do + case ${_pkg} in "${pkg_prefix}"* ) + _echo "Removing ${_pkg}" + pkg_delete ${_pkg} + ;; + esac + done +} + # Reinstall every pfSense-pkg-* package pkg_reinstall_all() { for _pkg in $(pkg query -e '%a == 0' %n); do @@ -849,7 +860,11 @@ case "${action}" in fi ;; delete) - pkg_delete ${action_pkg} + if [ ${action_pkg} == "ALL_PACKAGES" ] && [ -n ${force} ]; then + pkg_delete_all + else + pkg_delete ${action_pkg} + fi ;; *) _echo "ERROR: Invalid action!" |