Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 May 2011 06:14:51 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r221313 - user/dougb/portmaster
Message-ID:  <201105020614.p426Ep87024667@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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*}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105020614.p426Ep87024667>