From 98c5a1f023808271833b3e285fa740f1afbda0ab Mon Sep 17 00:00:00 2001 From: "chess.griffin" Date: Mon, 9 Dec 2013 03:46:54 +0000 Subject: [PATCH] enable new -B flag to bulk-process the queue without prompting; this was inspired by Eric Pratt's original patch. --- src/usr/man/man8/sbopkg.8 | 4 ++++ src/usr/sbin/sbopkg | 41 +++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/usr/man/man8/sbopkg.8 b/src/usr/man/man8/sbopkg.8 index 512a69d..144e230 100644 --- a/src/usr/man/man8/sbopkg.8 +++ b/src/usr/man/man8/sbopkg.8 @@ -229,6 +229,10 @@ If a package is specified more than once, it gets queued only the first time it is encountered. .\"--------------------------------------------------------------------- .TP +.B \-B +Process the packages or queues without prompting for confirmation first. +.\"--------------------------------------------------------------------- +.TP .B \-c Display a list of installed SBo packages and potential updates. .\"--------------------------------------------------------------------- diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 443dbca..d40eeb4 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -3906,22 +3906,24 @@ process_queue() { echo echo "Pre-check complete." echo - crunch_fmt "Do you wish to proceed based on the search \ - results above? Packages not found will be skipped during \ - the process." - echo - while :; do - read $NFLAG -ep "(P)roceed or (Q)uit?: " - case $REPLY in - P|p) break ;; - Q|q) - rm -f $PKGPATH/$CHKBUILD.{info,SlackBuild}.build - rm -f $PKGPATH/options.build - return 0 - ;; - *) unknown_response ;; - esac - done + if [[ ! $BULK ]]; then + crunch_fmt "Do you wish to proceed based on the search \ + results above? Packages not found will be skipped during \ + the process." + echo + while :; do + read $NFLAG -ep "(P)roceed or (Q)uit?: " + case $REPLY in + P|p) break ;; + Q|q) + rm -f $PKGPATH/$CHKBUILD.{info,SlackBuild}.build + rm -f $PKGPATH/options.build + return 0 + ;; + *) unknown_response ;; + esac + done + fi echo fi if [[ $KEEPLOG ]]; then @@ -4547,13 +4549,17 @@ else fi # This is the command line options and help. -while getopts ":b:cD:d:e:f:g:hi:kloPpqRrs:uV:v" OPT; do +while getopts ":b:BcD:d:e:f:g:hi:kloPpqRrs:uV:v" OPT; do case $OPT in b ) # Download, build set_type build BUILDLIST+=("$OPTARG") unset DIAG ;; + B ) # Bulk process without confirmation + BULK=1 + unset DIAG + ;; c ) # Check for updates to installed SBo packages CHK_UPDATES=1 unset DIAG @@ -4637,6 +4643,7 @@ Usage: $SCRIPT [OPTIONS] Options are: -b pkg/queue(s) Build the specified package(s). If one or more queuefiles are specified, build the packages they refer to. + -B Bulk process the queue without confirmation. -c Check for updates to installed packages. -D localdir Location of local copy of the repositories. -d pkg/queue(s) Like '-b', but only download sources.