Add '-q' to maketars and makesrctars, to quieten them.

Improve MAKEVERBOSE support.
This commit is contained in:
lukem 2008-03-16 07:02:22 +00:00
parent 1e8f8a64e7
commit 6c8d08d4c7
3 changed files with 48 additions and 17 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.56 2007/03/10 20:34:57 apb Exp $
# $NetBSD: Makefile,v 1.57 2008/03/16 07:02:22 lukem Exp $
# The `all' target must appear before bsd.own.mk is pulled in.
all:
@ -22,6 +22,7 @@ SETSCMD= cd ${.CURDIR} && \
TSORT=${TSORT:Q} \
${HOST_SH}
MAKETARS_FLAGS=
.if ${MKX11} != "no"
MAKEFLIST_FLAGS= -b
MAKESRCTARS_FLAGS= -x ${X11SRCDIR} -N ${NETBSDSRCDIR}/etc
@ -30,6 +31,11 @@ MAKEFLIST_FLAGS=
MAKESRCTARS_FLAGS= -N ${NETBSDSRCDIR}/etc
.endif
.if ${MAKEVERBOSE} != 2
MAKETARS_FLAGS+= -q
MAKESRCTARS_FLAGS+= -q
.endif
.if !defined(MAKETARSETS)
MAKETARSETS!= ${SETSCMD} ./makeflist -l ${MAKEFLIST_FLAGS}
.endif
@ -125,11 +131,13 @@ maketarsetup: .EXEC
makesetfiles: .PHONY
${_MKMSG_CREATE} "set lists"
${SETSCMD} ./maketars -S -d ${DESTDIR:S,^$,/,} ${METALOG.unpriv} \
${MAKETARS_FLAGS} \
-N ${NETBSDSRCDIR}/etc ${MAKEFLIST_FLAGS} -t ${TARDIR}
.for tar in ${MAKETARSETS}
do-${tar}: .PHONY sanitise_METALOG
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} \
${_MKMSG_CREATE} "${tar}.tgz"
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} ${MAKETARS_FLAGS} \
${METALOG.sanitised.unpriv} \
-N ${NETBSDSRCDIR}/etc -t ${TARDIR} ${tar} \
|| rm -f ${TARDIR}/${tar}.tgz
@ -137,6 +145,7 @@ do-${tar}: .PHONY sanitise_METALOG
makesrctars: .PRECIOUS .PHONY check_RELEASEDIR
${_MKMSG_CREATE} "source tar files"
mkdir -p ${SOURCETARDIR}
${SETSCMD} ./makesrctars ${MAKESRCTARS_FLAGS} \
${NETBSDSRCDIR} ${SOURCETARDIR}
@ -150,6 +159,7 @@ makesums: .PRECIOUS .PHONY check_RELEASEDIR .WAIT \
.for tar in ${MAKETARSETS}
do-sum-${tar}: .PHONY do-${tar}
${_MKMSG_CREATE} "${tar} checksums"
${MAKESUMS} -t ${TARDIR} ${tar}.tgz
for i in BSDSUM CKSUM MD5 SHA512 SYSVSUM; do \
${TOOL_CAT} ${TARDIR}/$$i >> ${TARDIR}/$$i.tmp; \
@ -163,7 +173,7 @@ installsets: .PHONY check_DESTDIR sanitise_METALOG
@echo "setenv INSTALLDIR before doing that!"
@false
.endif
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} \
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} ${MAKETARS_FLAGS} \
${METALOG.sanitised.unpriv} -N ${NETBSDSRCDIR}/etc \
${MAKEFLIST_FLAGS} -i ${INSTALLDIR} ${INSTALLSETS}

View File

@ -1,6 +1,6 @@
#! /bin/sh
#
# $NetBSD: makesrctars,v 1.33 2007/03/23 02:57:30 jnemeth Exp $
# $NetBSD: makesrctars,v 1.34 2008/03/16 07:02:22 lukem Exp $
#
# makesrctars srcdir setdir
# Create source tarballs in setdir from the source under srcdir.
@ -12,6 +12,7 @@ rundir="$(dirname "$0")" # ${0%/*} isn't good enough when there's no "/"
# set defaults
xsrcdir=
quiet=false
GZIP=-9
export GZIP
@ -19,9 +20,10 @@ export GZIP
usage()
{
cat 1>&2 <<USAGE
Usage: ${prog} [-N password/group dir] [-x xsrcdir] srcdir setdir
Usage: ${prog} [-N password/group dir] [-q] [-x xsrcdir] srcdir setdir
-N dir location which contains master.passwd and group files
(defaults to \${srcdir}/etc)
-q quiet operation
-x xsrcdir build xsrc.tgz from xsrcdir
srcdir location of sources
setdir where to write the .tgz files to
@ -29,9 +31,18 @@ USAGE
exit 1
}
msg()
{
$quiet || echo $*
}
# handle args
while getopts N:x: ch; do
while getopts N:qx: ch; do
case ${ch} in
q)
quiet=true
;;
x)
xsrcdir="${OPTARG}"
;;
@ -53,7 +64,7 @@ setdir="$2"
: ${PASSWD:="${srcdir}/etc"}
if [ ! -d "${setdir}" ]; then
echo "${setdir} is not a directory"
echo >&2 "${prog}: ${setdir} is not a directory"
exit 1
fi
@ -64,7 +75,7 @@ makeset()
dir="$1"
shift
intmp="/tmp/in$$"
echo "Creating ${set}"
msg "Creating ${set}"
if [ "${dir}" != "." ]; then
cd "${dir}"
srcprefix="${srcprefix}/${dir}"
@ -93,7 +104,7 @@ makeset()
#
if ! cd "${srcdir}"; then
echo "Can't chdir to ${srcdir}"
echo >&2 "${prog}: can't chdir to ${srcdir}"
exit 1
fi
@ -113,7 +124,7 @@ makeset sharesrc share
#
if [ -n "${xsrcdir}" ]; then
if ! cd "${xsrcdir}"; then
echo "Can't chdir to ${xsrcdir}"
echo >&2 "${prog}: can't chdir to ${xsrcdir}"
exit 1
fi
srcprefix=usr/xsrc
@ -121,7 +132,7 @@ if [ -n "${xsrcdir}" ]; then
fi
echo "Creating checksum files"
msg "Creating checksum files"
(cd "${setdir}"
${CKSUM} -o1 *.tgz > BSDSUM
${CKSUM} *.tgz > CKSUM

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: maketars,v 1.63 2008/03/16 04:39:19 lukem Exp $
# $NetBSD: maketars,v 1.64 2008/03/16 07:02:22 lukem Exp $
#
# Make release tar files for some or all lists. Usage:
# maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@ -26,6 +26,7 @@ metalog=
installdir=
etcdir=
setfilesonly=false
quiet=false
usage()
{
@ -38,6 +39,7 @@ Usage: ${prog} [-b] [-x] [-i idir] [-a arch] [-m machine] [-s setsdir] [-S]
-i idir Install sets to idir instead of creating tar files
-a arch Set arch (e.g, m68k, mipseb, mipsel, powerpc) [${MACHINE_ARCH}]
-m machine Set machine (e.g, amiga, i386, macppc) [${MACHINE}]
-q Quiet operation
-s setsdir Directory to find sets [${setsdir}]
-S Exit after creating set files ${dest}/etc/mtree/set.*
-M metalog metalog file
@ -49,8 +51,13 @@ USAGE
exit 1
}
msg()
{
$quiet || echo $*
}
# handle args
while getopts bxi:a:m:s:SM:N:d:t: ch; do
while getopts bxi:a:m:qs:SM:N:d:t: ch; do
case ${ch} in
b)
lists="${nlists} ${xlists}"
@ -68,6 +75,9 @@ while getopts bxi:a:m:s:SM:N:d:t: ch; do
m)
MACHINE="${OPTARG}"
;;
q)
quiet=true
;;
s)
setsdir="${OPTARG}"
;;
@ -132,7 +142,7 @@ for setname in ${lists}; do
${HOST_SH} "${setsdir}/makeflist" -a "${MACHINE_ARCH}" -m "${MACHINE}" \
-s "${setsdir}" "${setname}" > "${SDIR}/flist.${setname}"
if [ -n "${metalog}" ]; then
${setfilesonly} && echo "Creating ${setlistdir}/set.${setname}"
${setfilesonly} && msg "Creating ${setlistdir}/set.${setname}"
${AWK} -f "${rundir}/getdirs.awk" "${SDIR}/flist.${setname}" \
| ${SORT} -u > "${SDIR}/flist.${setname}.full"
(
@ -163,17 +173,17 @@ es=0
for setname in ${lists}; do
out="${setname}.tgz"
if [ -n "${installdir}" ]; then
echo "Copying set ${setname}"
msg "Copying set ${setname}"
( cd "${dest}"; \
${PAX} -O -rwpe -d -N"${etcdir}" ${metalog:+-M} \
"${installdir}" < "${setlistdir}/set.${setname}" )
else
if [ -n "${metalog}" -a "${tars}/${out}" -nt "${metalog}" ]
then
echo "${out} is up to date"
msg "${out} is up to date"
continue
fi
echo "Creating ${out}"
msg "Creating ${out}"
rm -f "${tars}/${out}"
TMPFILES="${TMPFILES} ${tars}/${out}.tmp"
( cd "${dest}"; \