diff options
author | Renato Botelho <renato@netgate.com> | 2015-09-14 13:48:06 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-09-14 13:48:06 -0300 |
commit | 3296e3dc2041a10d480263973c30eb6897244e8b (patch) | |
tree | 48a5771182977f1489772fc55da5b7b00c4200a9 | |
parent | 5ec643eb61d1cf5a019597c847510d375f226565 (diff) | |
download | pfsense-3296e3dc2041a10d480263973c30eb6897244e8b.zip pfsense-3296e3dc2041a10d480263973c30eb6897244e8b.tar.gz |
Process pfSense.obsoletedfiles on base post-install script
-rw-r--r-- | tools/templates/core_pkg/base/metadir/+INSTALL | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tools/templates/core_pkg/base/metadir/+INSTALL b/tools/templates/core_pkg/base/metadir/+INSTALL index 895c39c..e59bde8 100644 --- a/tools/templates/core_pkg/base/metadir/+INSTALL +++ b/tools/templates/core_pkg/base/metadir/+INSTALL @@ -26,4 +26,31 @@ echo "===> Extracting new base tarball" # Install new base files tar -C / -xJPUf /usr/local/share/%%PRODUCT_NAME%%/base.txz -exit $? +echo "===> Removing static obsoleted files" + +# Set IFS to \n to deal with filenames containing spaces +oIFS=${IFS} +IFS=" +" + +PLATFORM=$(cat /etc/platform) + +# Process obsolete files +if [ "${PLATFORM}" != "nanobsd" -a -f /etc/%%PRODUCT_NAME%%.obsoletedfiles ]; then + for f in $(cat /etc/%%PRODUCT_NAME%%.obsoletedfiles); do + if [ -n "${f}" -a -d "${f}" ]; then + chflags -R noschg "${f}" + rm -rf "${f}" + elif [ -n "${f}" -a -f "${f}" ]; then + chflags noschg "${f}" + rm -f "${f}" + elif [ -n "${f}" -a -L "${f}" ]; then + rm -f "${f}" + fi + done +fi + +# Restore IFS +IFS=${oIFS} + +exit 0 |