  
  	echo "===>>> Checking $port_dbdir"
  
-@@ -1610,14 +1726,19 @@
+@@ -1610,14 +1726,20 @@
  				unset port_ver
  			fi
  		else
 -			case `pkg_version -t $iport $port_ver` in
++			local pkg_version
 +			if [ -z "$use_pkgng" ]; then
 +				pkg_version="pkg_version"
 +			else

 
 	echo '' ; echo "===>>> Running ${0##*/} -s $ARGS"
 	exec $0 -s $ARGS
@@ -2069,13 +2211,22 @@
 if [ -n "$CLEAN_STALE" ]; then
 	[ -z "$no_del_list" ] && export no_del_list=':'
 

 			esac
 
 			[ -z "$do_update" ] && {
@@ -1689,7 +1811,13 @@
 	fi
 
 	pm_cd $pkgdir || fail "Cannot cd into $pkgdir to create a package"
