 --- portmaster.orig	2012-01-27 19:10:47.000000000 +0100
-+++ portmaster	2012-01-31 02:28:07.181096526 +0100
++++ portmaster	2012-01-31 03:07:29.361097824 +0100
 @@ -292,7 +292,13 @@
  			 unset -v PM_URB_LIST;
  			 $PM_SU_CMD /usr/bin/nice /usr/bin/make $PM_MAKE_ARGS $*; ); }

 
 	echo '' ; echo "===>>> Running ${0##*/} -s $ARGS"
 	exec $0 -s $ARGS
@@ -2075,7 +2195,11 @@
 		case "$no_del_list" in *:${iport}:*) continue ;; esac
 
 		origin=`origin_from_pdb $iport`
-		deplist=`grep -l DEPORIGIN:$origin$ $pdb/*/+CONTENTS`
+		if [ -z "$use_pkgng" ]; then
+			deplist=`grep -l DEPORIGIN:$origin$ $pdb/*/+CONTENTS`
+		else
+			deplist=`pkg query "%rn-%rv" $origin`
+		fi
 		if [ -n "$deplist" ]; then
 			echo ''
 			echo "===>>> Warning: Unrecorded dependencies on ${iport}:"
@@ -2088,7 +2212,11 @@
 			continue
 		fi
 
-		pkg_info $iport
+		if [ -z "$use_pkgng" ]; then
+			pkg_info $iport
+		else
+			pkg info -f $iport
+		fi
 
 		get_answer_yn n "\t===>>> ${iport} is no longer depended on, delete"
 		case "$?" in
@@ -2243,7 +2371,12 @@
 			fail "No entry for $origin in $PM_INDEX"
 	fi
 

 	\<)	build_l="${build_l}\tUpgrade $iport to $new_port\n" ;;
 	=)	build_l="${build_l}\tRe-install $iport\n" ;;
 	\>)	build_l="${build_l}\tDowngrade $iport to $new_port\n" ;;
@@ -2466,7 +2610,11 @@
 				fail "Cannot cd to $d_port"
 			fi
 			for glob in $conflicts; do
