Skip to content

Commit

Permalink
Process pfSense.obsoletedfiles on base post-install script
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgarga committed Sep 14, 2015
1 parent 5ec643e commit 3296e3d
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion tools/templates/core_pkg/base/metadir/+INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3296e3d

Please sign in to comment.