diff options
author | spz <spz> | 2010-07-21 12:29:46 +0000 |
---|---|---|
committer | spz <spz> | 2010-07-21 12:29:46 +0000 |
commit | 05eec14c1a64247024d8c7d95474dd384ad2dbdb (patch) | |
tree | 1ea21ee3f033b32ed3a37c1905234ca71356558e /mk/scripts | |
parent | fc65bce2097c46c3dd9cb7c72c385d32ef5b25ea (diff) | |
download | pkgsrc-05eec14c1a64247024d8c7d95474dd384ad2dbdb.tar.gz |
give the readme creation scripts the option to be a lot less talkative,
by optionally disabling progress report type output.
This will make the daily pkgmastr mail a lot smaller without dropping
useful information.
Diffstat (limited to 'mk/scripts')
-rwxr-xr-x | mk/scripts/binpkg-cache | 12 | ||||
-rwxr-xr-x | mk/scripts/genreadme.awk | 19 | ||||
-rwxr-xr-x | mk/scripts/mkreadme | 31 |
3 files changed, 42 insertions, 20 deletions
diff --git a/mk/scripts/binpkg-cache b/mk/scripts/binpkg-cache index a594507d796..9983fc54a3c 100755 --- a/mk/scripts/binpkg-cache +++ b/mk/scripts/binpkg-cache @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: binpkg-cache,v 1.20 2010/03/13 11:45:16 spz Exp $ +# $NetBSD: binpkg-cache,v 1.21 2010/07/21 12:29:46 spz Exp $ # # Script for generating a cache file with information about # all binary packages contained in a directory. @@ -198,7 +198,7 @@ process_binpkg_dir(){ echo "Need version ${cacheversion} but the file has" ${GREP} "^pkgcache_version " ${d}/${cachefile} else - echo "${tab}Cache file ${d}/${cachefile} is up to date." + $if_verbose echo "${tab}Cache file ${d}/${cachefile} is up to date." fi fi @@ -326,7 +326,7 @@ process_cache_files(){ ###################################################################### if_debug=: # either ":" or "" -verbose=no +if_verbose=: # either ":" or "" force=no build_summary=no @@ -338,7 +338,7 @@ do # Turn on debugging -d|--debug) if_debug="" - verbose=yes + if_verbose="" shift ;; @@ -373,7 +373,7 @@ do # Turn on verbose output, but not as noisy as debug -v|--verbose) - verbose=yes + if_verbose="" shift ;; @@ -431,7 +431,7 @@ for d in `${AWK} '{print $1}' ${all_dirs}` ; do fi done if test "X${is_pkg_dir}" = "Xyes" ; then - echo "${prompt}Checking cache in ${d}" + $if_verbose echo "${prompt}Checking cache in ${d}" process_binpkg_dir else $if_debug echo "${prompt}no binary packages in ${d}" diff --git a/mk/scripts/genreadme.awk b/mk/scripts/genreadme.awk index df335e99803..96ae1f3aead 100755 --- a/mk/scripts/genreadme.awk +++ b/mk/scripts/genreadme.awk @@ -1,5 +1,5 @@ #!/usr/bin/awk -f -# $NetBSD: genreadme.awk,v 1.33 2008/08/03 16:24:53 tnn Exp $ +# $NetBSD: genreadme.awk,v 1.34 2010/07/21 12:29:46 spz Exp $ # # Copyright (c) 2002, 2003, 2005, 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -201,8 +201,13 @@ END { if ( builddependsfile == "" ) builddependsfile = "/dev/stdout"; printf("Making sure binary package cache file is up to date...\n"); - cmd = sprintf("%s AWK=%s CMP=%s FIND=%s GREP=%s GZIP_CMD=\"%s\" PKG_INFO=\"%s\" PKG_SUFX=%s SED=%s SORT=%s %s/mk/scripts/binpkg-cache %s --packages %s", + if ( quiet == "yes" ){ + cmd = sprintf("%s AWK=%s CMP=%s FIND=%s GREP=%s GZIP_CMD=\"%s\" PKG_INFO=\"%s\" PKG_SUFX=%s SED=%s SORT=%s %s/mk/scripts/binpkg-cache %s --packages %s", SETENV, AWK, CMP, FIND, GREP, GZIP_CMD, PKG_INFO, PKG_SUFX, SED, SORT, PKGSRCDIR, summary, PACKAGES); + } else { + cmd = sprintf("%s AWK=%s CMP=%s FIND=%s GREP=%s GZIP_CMD=\"%s\" PKG_INFO=\"%s\" PKG_SUFX=%s SED=%s SORT=%s %s/mk/scripts/binpkg-cache %s --packages %s --verbose", + SETENV, AWK, CMP, FIND, GREP, GZIP_CMD, PKG_INFO, PKG_SUFX, SED, SORT, PKGSRCDIR, summary, PACKAGES); + } if (debug) printf("\nExecute: %s\n",cmd); rc = system(cmd); @@ -281,9 +286,11 @@ END { if (debug) printf("Creating %s for %s\n", readme, readmenew); - printf("."); - if ((pkgcnt % 100) == 0) { - printf("\n%d\n", pkgcnt); + if (quiet != "yes") { + printf("."); + if ((pkgcnt % 100) == 0) { + printf("\n%d\n", pkgcnt); + } } printf("") > readme; htmldeps = ""; @@ -779,7 +786,7 @@ function copy_readme(old, new, cmd, rc) { function load_cache_file( file, pkgfile, opsys, osver, march, wk, rx ) { - printf(" * %s\n", file); + if ( quiet != "yes" ) printf(" * %s\n", file); fatal_check_file( file ); # read the cache file diff --git a/mk/scripts/mkreadme b/mk/scripts/mkreadme index f084c44d986..e93ccf95060 100755 --- a/mk/scripts/mkreadme +++ b/mk/scripts/mkreadme @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: mkreadme,v 1.24 2010/07/15 05:25:30 spz Exp $ +# $NetBSD: mkreadme,v 1.25 2010/07/21 12:29:46 spz Exp $ # # Script for README.html generation # @@ -59,6 +59,7 @@ BMAKE=${BMAKE:-${makeprog}} usage(){ echo "$prog - Generates README.html files for a pkgsrc tree" echo "Usage: $prog [-c|--cdrom] [-C|--prune] [-d|--debug] [-f|--ftp] " + echo " [-q|--quiet] " echo " [-p|--pkgsrc directory] " echo " [-P|--packages directory] [-r|--restart] " echo " [-s|--summary]" @@ -81,6 +82,8 @@ usage(){ echo " " echo " -h|--help Displays this help message" echo " " + echo " -q|--quiet Does not give progress output" + echo " " echo " -p|--pkgsrc dir Specifies the pkgsrc directory. Defaults to" echo " the value of the PKGSRCDIR environment variable" echo " if set or /usr/pkgsrc otherwise." @@ -130,6 +133,7 @@ prune=no DEBUG=no save=no pv=default +quiet=no summary="" @@ -170,6 +174,12 @@ do exit 0 ;; + # be less talkative + -q|--quiet) + quiet=yes + shift + ;; + # Specify pkgsrc directory -p|--pkgsrc) PKGSRCDIR=$2 @@ -356,8 +366,10 @@ if [ "x$restart" = "xno" ] ; then echo "WARNING: The category directory ${c} does not seem to" > /dev/stderr echo " exist under ${PKGSRCDIR}" > /dev/stderr else - echo " " - echo "Extracting data for category ${c}" + if [ "x$quiet" = "xno" ]; then + echo " " + echo "Extracting data for category ${c}" + fi cd ${PKGSRCDIR}/${c} list=`${BMAKE} show-subdir-var VARNAME=SUBDIR` for pkgdir in $list ; do @@ -381,11 +393,13 @@ if [ "x$restart" = "xno" ] ; then echo "$l" >> $DATABASEFILE fi fi - ${ECHO} -n "." - if [ `${EXPR} $npkg % 100 = 0` -eq 1 ]; then - echo " " - echo "$npkg" - fi + if [ "x$quiet" = "xno" ]; then + ${ECHO} -n "." + if [ `${EXPR} $npkg % 100 = 0` -eq 1 ]; then + echo " " + echo "$npkg" + fi + fi npkg=`${EXPR} $npkg + 1` cd ${PKGSRCDIR} done @@ -424,6 +438,7 @@ fi ${AWK} -f ${PKGSRCDIR}/mk/scripts/genreadme.awk \ builddependsfile=${TMPDIR}/pkgsrc.builddepends.debug \ debug=$debug \ + quiet=$quiet \ dependsfile=${TMPDIR}/pkgsrc.depends.debug \ summary=${summary} \ AWK=$AWK \ |