svn commit: r221313 - user/dougb/portmaster

Doug Barton dougb at FreeBSD.org
Mon May 2 06:14:52 UTC 2011


Author: dougb
Date: Mon May  2 06:14:51 2011
New Revision: 221313
URL: http://svn.freebsd.org/changeset/base/221313

Log:
  If -F --packages-only and there is no package to fetch, give the user
  a menu of options

Modified:
  user/dougb/portmaster/portmaster

Modified: user/dougb/portmaster/portmaster
==============================================================================
--- user/dougb/portmaster/portmaster	Mon May  2 05:39:43 2011	(r221312)
+++ user/dougb/portmaster/portmaster	Mon May  2 06:14:51 2011	(r221313)
@@ -3464,7 +3464,29 @@ fetch_package () {
 		echo ''
 		echo "       Check the pkg_add(1) man page for information"
 		echo "       on setting the PACKAGESITE environment variable"
-		[ "$PM_PACKAGES" = only ] && fail $ponly_err
+		[ "$PM_PACKAGES" = only -a -z "$FETCH_ONLY" ] && fail $ponly_err
+		if [ -n "$FETCH_ONLY" ]; then
+			while [ -z "$continue" ]; do
+				echo -e "\n===>>> There is no valid package to install\n"
+				echo "===>>> Abort update         [a]"
+				echo "===>>> Retry fetch          [r]"
+				echo "===>>> Continue if possible [c]"
+				echo ''
+				echo -n "===>>> How would you like to proceed? [a] "
+				read answer ; echo ''
+
+				case "$answer" in
+				a|'')	fail "No package exists for $new_port" ;;
+				r)	if fetch_package $new_port try ; then
+						latest_pv=$new_port
+						continue=continue
+					fi ;;
+				c)	safe_exit ;;
+				*)	echo "	===>>> $answer is not a valid response" ;;
+				esac
+			done
+			unset continue answer
+		fi
 	else
 		latest_pv=${latest_pv#*href=\"}
 		latest_pv=${latest_pv%%\.tbz*}


More information about the svn-src-user mailing list