  		[ -f "${LOCALBASE_COMPAT}/${file##*/}" ] &&
  			files="${files}${LOCALBASE_COMPAT}/${file##*/} "
  	done
-@@ -3844,7 +4126,8 @@
+@@ -3844,7 +4127,8 @@
  	/bin/unlink $dist_list_temp ; unset ds dist_list_temp
  fi
  

 if [ -n "$preserve_dir" ]; then
 	rmdir $preserve_dir 2>/dev/null
 	unset preserve_dir preserve_port_files
@@ -3781,7 +4058,12 @@
 temp=`find $LOCALBASE_COMPAT -type d -empty 2>/dev/null`
 if [ -z "$temp" ] && [ -d "$LOCALBASE_COMPAT" ]; then
 	unset files

+		if [ -d "$pdb/$OPTARG" ] && ( [ -z "$use_pkgng" ] || pkg info -e $OPTARG ); then
 			glob_dirs=$OPTARG
 		else
+			case "$OPTARG" in */*) fail 'The argument to -r must be a package name, or a glob pattern' ;; esac
 			find_glob_dirs $OPTARG
 			case $? in
-			1)	fail "$pdb/$OPTARG does not exist" ;;
