From bdcb49f2a3e0a4dc00ee8229ce8514f909c25d8f Mon Sep 17 00:00:00 2001 From: slakmagik Date: Mon, 7 Mar 2011 01:27:10 +0000 Subject: [PATCH] allow -Rp combo to page through all READMEs This modifies list_packages() to call view_readmes() if VIEW_READMES is set (and that variable was changed from PREVIEW_READMES). And it documents it in the manual, help output, and NEWS. --- src/usr/doc/NEWS | 3 +++ src/usr/man/man8/sbopkg.8 | 16 +++++++++++++--- src/usr/sbin/sbopkg | 17 ++++++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/usr/doc/NEWS b/src/usr/doc/NEWS index 825656a..5757457 100644 --- a/src/usr/doc/NEWS +++ b/src/usr/doc/NEWS @@ -8,6 +8,9 @@ sbopkg xxxVERSIONxxx (xxxDATExxx) main menu's list/uninstall item. (Selection state will also now be remembered.) Thanks to dmotaleite for the RFE. + * Similarly, the -R and -p flags can now be combined to page + through the READMEs of all installed packages. + MODIFICATIONS * Updated French man pages. Thanks to Marie-Claude Collilieux. diff --git a/src/usr/man/man8/sbopkg.8 b/src/usr/man/man8/sbopkg.8 index 18323eb..2f0c5f9 100644 --- a/src/usr/man/man8/sbopkg.8 +++ b/src/usr/man/man8/sbopkg.8 @@ -362,10 +362,20 @@ options is minimized. .\"--------------------------------------------------------------------- .TP .B \-R -Show all the +When combined with +.B -b +or +.BR -i , +view the .I README -files of the queued packages before starting the build. -This is useful when the user wants to make a final check. +files of the packages to be built/installed before starting the build +process. +This is useful for making a final check. +When combined with +.BR -p , +view the +.I README +files of all installed packages from the active repo. .\"--------------------------------------------------------------------- .TP .B \-r diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index fa8fb43..381a147 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -517,7 +517,11 @@ list_packages() { esac done else - $PAGER $PKG_LIST + if [[ $VIEW_READMES ]]; then + view_readmes "Installed packages:" $README_LIST + else + $PAGER $PKG_LIST + fi fi else if [[ $DIAG ]]; then @@ -4418,7 +4422,7 @@ unset ALLOW_MULTI # If set, allow more that one instance of sbopkg running unset BUILDLIST # List of packages to build/install (from CLI) unset BUILD BFLAG IFLAG CHK_UPDATES GENSEARCH CHANGELOG OBSOLETESRC GETPKGS -unset RSYNC SEARCH UPDATE VERSION CUSTOMVER SKIP_INSTALLED PREVIEW_READMES +unset RSYNC SEARCH UPDATE VERSION CUSTOMVER SKIP_INSTALLED VIEW_READMES unset UNINSTPKG SCRIPT=${0##*/} @@ -4522,7 +4526,7 @@ while getopts ":b:cd:e:f:g:hi:kloPpqrRs:uV:v" OPT; do unset DIAG ;; R ) # Preview the READMEs before building - PREVIEW_READMES=1 + VIEW_READMES=1 unset DIAG ;; s ) # Name search @@ -4564,7 +4568,10 @@ Options are: -q Quiet some of the command-line output. -r Sync the remote repository with the local mirror and then quit. - -R Preview the READMEs before starting the build process. + -R When combined with -b or -i, preview the READMEs of the + packages to be built/installed before starting the build + process. When combined with -p, show the READMEs of all + installed packages from the active repo. -s package(s) Specific search by specific package and, if found, display package information. -u Check for an update to sbopkg. @@ -4733,7 +4740,7 @@ else uncheck_installed $TMPQUEUE fi # Preview READMEs - if [[ $PREVIEW_READMES ]]; then + if [[ $VIEW_READMES ]]; then view_readmes "The active queue is:" $TMPQUEUE echo while :; do