  			esac
  
  			[ -z "$do_update" ] && {
-@@ -2224,7 +2308,12 @@
+@@ -1682,6 +1766,11 @@
+ 	fi
+ 
+ 	pm_cd $pkgdir || fail "Cannot cd into $pkgdir to create a package"
++	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
+ 		if [ "$1" = "$pbu" ]; then
+ 			if [ -n "$BACKUP" ]; then
+@@ -2224,7 +2313,12 @@
  			fail "No entry for $origin in $PM_INDEX"
  	fi
  

 	esac
 
 	if [ -z "$portdir" -a -z "$upg_port" ]; then
@@ -3015,11 +3109,20 @@
 
 	case "$arg2" in
 	*/*)	ro_opd=$arg2 ; ro_upg_port=`iport_from_origin $ro_opd` ;;

 	\<)	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 +3076,12 @@
 	/*)	echo '' ; no_valid_port ;;
 	*/*)	portdir=$argv ;;
 	\.)	portdir=${PWD##*/ports/} ;; # Not always $pd, could be symlink
