 +	if [ -z "${use_pkgng}" ]; then
 +		$PM_SU_CMD /usr/sbin/pkg_delete $*;
 +	else
-+		$PM_SU_CMD /usr/sbin/pkg delete -y $*;
++		$PM_SU_CMD /usr/local/sbin/pkg delete -y $*;
 +	fi
 +}
  pm_rm_s           () { $PM_SU_CMD /bin/rm $*; }

+	if [ -z "$usr_pkgng" ]; then
+		pkglist="pkg_info -q -L"
+	else
+		pkglist="pkg info -q -l -a"
+	fi
+	for file in `$pkglist $new_port`; do
 		[ -f "${LOCALBASE_COMPAT}/${file##*/}" ] &&

+		if [ -z "$usr_pkgng" ]; then
+			pkglist="pkg_info -q -L"
+		else
+			pkglist="pkg info -q -l"
+		fi
+		for file in `$pkglist $UPGRADE_PORT |
 		    sort - $ldconfig_out | uniq -d`; do
