From 9bdf72fde199a822cb1bc6416f43647cd9365345 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 16 Nov 2015 17:06:28 -0200 Subject: Add a workaround on pfSense-upgrade to prevent breaking strongswan port due to the symlinks we create --- src/usr/local/sbin/pfSense-upgrade | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/usr/local/sbin') diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade index 0d0388c..3d37e33 100755 --- a/src/usr/local/sbin/pfSense-upgrade +++ b/src/usr/local/sbin/pfSense-upgrade @@ -360,6 +360,24 @@ pkg_upgrade() { if [ "${next_stage}" = "2" ]; then pkg_lock "${pkg_prefix}*" + # XXX: Workaround to upgrade strongswan + # If those symlinks are present, pkg exit because it expects them + # to be a directory + if [ $(pkg ${pkg_chroot} upgrade -nq strongswan | wc -l) -gt 1 ]; then + if [ -L ${chroot_dir}/usr/local/etc/ipsec.d ]; then + rm -f ${chroot_dir}/usr/local/etc/ipsec.d + fi + if [ -L ${chroot_dir}/usr/local/etc/ipsec.conf ]; then + rm -f ${chroot_dir}/usr/local/etc/ipsec.conf + fi + if [ -L ${chroot_dir}/usr/local/etc/strongswan.d ]; then + rm -f ${chroot_dir}/usr/local/etc/strongswan.d + fi + if [ -L ${chroot_dir}/usr/local/etc/strongswan.conf ]; then + rm -f ${chroot_dir}/usr/local/etc/strongswan.conf + fi + fi + if [ $(pkg ${pkg_chroot} upgrade -nq | wc -l) -gt 1 ]; then _echo "Upgrading necessary packages..." if ! pkg ${pkg_chroot} upgrade 2>&1 | tee -a ${logfile}; then -- cgit v1.1