  			esac
  
  			[ -z "$do_update" ] && {
-@@ -1682,6 +1764,11 @@
+@@ -1683,7 +1782,13 @@
  	fi
  
  	pm_cd $pkgdir || fail "Cannot cd into $pkgdir to create a package"
+-	if $PM_SU_CMD pkg_create -b $2; then
++	local pkg_create
 +	if [ -z "${use_pkgng}" ]; then
-+		pm_pkg_create="pkg_create -b"
-+	else
-+		pm_pkg_create="pkg create "
-+	fi
- 	if $PM_SU_CMD pkg_create -b $2; then
++		pkg_create="pkg_create -b"
++	else
++		pkg_create="pkg create "
++	fi
++	if $PM_SU_CMD $pkg_create $2; then
  		if [ "$1" = "$pbu" ]; then
  			if [ -n "$BACKUP" ]; then
-@@ -2224,7 +2311,12 @@
+ 				echo "	===>>> Package saved to $1" ; echo ''
+@@ -2034,7 +2139,11 @@
+ 	fi
+ 
+ 	origin=`origin_from_pdb $EXPUNGE`
+-	deplist=`grep -l DEPORIGIN:$origin$ $pdb/*/+CONTENTS`
++	if [ -n "${use_pkgng}" ]; then
++		deplist=`pkg query "%rn-%rv" $origin`
++	else
++		deplist=`grep -l DEPORIGIN:$origin$ $pdb/*/+CONTENTS`
++	fi
+ 	if [ -n "$deplist" ]; then
+ 		echo "===>>> Warning: Ports with dependencies on ${EXPUNGE}:"
+ 		for dep in $deplist; do
+@@ -2042,7 +2151,9 @@
+ 		done
+ 		get_answer_yn n "\n\t===>>> Delete this dependency data"
+ 		case "$?" in
+-		0)	for f in $deplist; do
++		0)	
++			[ -n "$use_pkgng" ] && exit 0
++			for f in $deplist; do
+ 				update_contents delete $f $origin
+ 			done ;;
+ 		*)	exit 1 ;;
+@@ -2069,7 +2180,11 @@
+ 		case "$no_del_list" in *:${iport}:*) continue ;; esac
+ 
+ 		origin=`origin_from_pdb $iport`
+-		deplist=`grep -l DEPORIGIN:$origin$ $pdb/*/+CONTENTS`
++		if [ -n "${use_pkgng}" ]; then
++			deplist=`pkg query "%rn-%rv" $origin`
++		else
++			deplist=`grep -l DEPORIGIN:$origin$ $pdb/*/+CONTENTS`
++		fi
+ 		if [ -n "$deplist" ]; then
+ 			echo ''
+ 			echo "===>>> Warning: Unrecorded dependencies on ${iport}:"
+@@ -2082,7 +2197,11 @@
+ 			continue
+ 		fi
+ 
+-		pkg_info $iport
++		if [ -z "$use_pkgng" ]; then
++			pkg_info $iport
++		else
++			pkg info $iport
++		fi
+ 
+ 		get_answer_yn n "\t===>>> ${iport} is no longer depended on, delete"
+ 		case "$?" in
+@@ -2237,7 +2356,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" ;;
@@ -2982,7 +3074,12 @@
 	/*)	echo '' ; no_valid_port ;;
 	*/*)	portdir=$argv ;;
 	\.)	portdir=${PWD##*/ports/} ;; # Not always $pd, could be symlink

--- /usr/local/sbin/portmaster	2011-12-11 21:50:47.000000000 +0100
+++ ~/pkgng/portmaster	2011-12-12 12:23:56.000000000 +0100
@@ -286,7 +286,13 @@
 			 unset -v PM_URB_LIST;
 			 $PM_SU_CMD /usr/bin/nice /usr/bin/make $PM_MAKE_ARGS $*; ); }
 pm_mkdir_s        () { $PM_SU_CMD /bin/mkdir -p $1; }
-pm_pkg_delete_s   () { $PM_SU_CMD /usr/sbin/pkg_delete $*; }
