svn commit: r216290 - user/dougb/portmaster
Doug Barton
dougb at FreeBSD.org
Wed Dec 8 08:01:27 UTC 2010
Author: dougb
Date: Wed Dec 8 08:01:27 2010
New Revision: 216290
URL: http://svn.freebsd.org/changeset/base/216290
Log:
Add a -y option to answer "Yes" to all dialogs that pose a yes/no question
Begin implementation of this feature, and enhanced support for -n in the
--check-depends feature.
Modified:
user/dougb/portmaster/portmaster
Modified: user/dougb/portmaster/portmaster
==============================================================================
--- user/dougb/portmaster/portmaster Wed Dec 8 07:32:17 2010 (r216289)
+++ user/dougb/portmaster/portmaster Wed Dec 8 08:01:27 2010 (r216290)
@@ -528,7 +528,7 @@ set -- $newopts
unset var newopts
# Save switches for potential child processes
-while getopts 'BCDFGHKLPRabde:fghilm:nop:r:stuvwx:' COMMAND_LINE_ARGUMENT ; do
+while getopts 'BCDFGHKLPRabde:fghilm:nop:r:stuvwx:y' COMMAND_LINE_ARGUMENT ; do
case "${COMMAND_LINE_ARGUMENT}" in
B) NO_BACKUP=Bopt; ARGS="-B $ARGS" ;;
C) DONT_PRE_CLEAN=Copt; ARGS="-C $ARGS" ;;
@@ -576,6 +576,7 @@ while getopts 'BCDFGHKLPRabde:fghilm:nop
-*) fail 'The -x option requires an argument' ;;
esac
PM_EXCL="${PM_EXCL}`globstrip ${OPTARG}` " ;;
+ y) PM_YES=yopt; ARGS="-y $ARGS" ;;
*) echo '' ; echo "===>>> Try ${0##*/} --help"; exit 1 ;;
esac
done
@@ -870,10 +871,19 @@ IFS='
echo " ===>>> but there is no installed version"
echo ''
if [ -n "$CHECK_DEPENDS" ]; then
- echo -n " ===>>> Delete this dependency data? y/n [n] "
- read answer
+ if [ -z "$PM_YES" -a -z "$NO_ACTION" ]; then
+ echo -n " ===>>> Delete this dependency data? y/n [n] "
+ read answer
+ echo ''
+ else
+ if [ -n "$PM_YES" ]; then
+ answer=y
+ elif [ -n "$NO_ACTION" ]; then
+ answer=n
+ fi
+ fi
case "$answer" in
- [yY]) unset prev_line line ; echo '' ; continue ;;
+ [yY]) unset prev_line line ; continue ;;
esac
else
echo " ===>>> Try ${0##*/} --check-depends"
More information about the svn-src-user
mailing list