Module Name:    src
Committed By:   apb
Date:           Sat Sep 12 11:01:55 UTC 2009

Modified Files:
        src/distrib/sets: Makefile maketars

Log Message:
If there are errors in creating a ${set}.tgz tar file, then don't
just press on regardless.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/distrib/sets/Makefile \
    src/distrib/sets/maketars

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/Makefile
diff -u src/distrib/sets/Makefile:1.68 src/distrib/sets/Makefile:1.69
--- src/distrib/sets/Makefile:1.68	Sun Jul 12 12:30:31 2009
+++ src/distrib/sets/Makefile	Sat Sep 12 11:01:55 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.68 2009/07/12 12:30:31 apb Exp $
+#	$NetBSD: Makefile,v 1.69 2009/09/12 11:01:55 apb Exp $
 
 # The `all' target must appear before bsd.own.mk is pulled in.
 all:
@@ -177,7 +177,7 @@
 	${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} ${MAKETARS_FLAGS} \
 	    ${METALOG.unpriv} \
 	    -N ${NETBSDSRCDIR}/etc -t ${TARDIR} ${tar} \
-	|| rm -f ${TARDIR}/${tar}.tgz
+	|| { rm -f ${TARDIR}/${tar}.tgz; false; }
 .endfor
 
 
Index: src/distrib/sets/maketars
diff -u src/distrib/sets/maketars:1.68 src/distrib/sets/maketars:1.69
--- src/distrib/sets/maketars:1.68	Sat Apr 11 15:09:32 2009
+++ src/distrib/sets/maketars	Sat Sep 12 11:01:55 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: maketars,v 1.68 2009/04/11 15:09:32 apb Exp $
+# $NetBSD: maketars,v 1.69 2009/09/12 11:01:55 apb Exp $
 #
 # Make release tar files for some or all lists.  Usage:
 # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@@ -140,24 +140,28 @@
 
 for setname in ${lists}; do
 	${HOST_SH} "${setsdir}/makeflist" -a "${MACHINE_ARCH}" -m "${MACHINE}" \
-	    -s "${setsdir}" "${setname}" > "${SDIR}/flist.${setname}"
+	    -s "${setsdir}" "${setname}" > "${SDIR}/flist.${setname}" \
+	    || exit 1
 	if [ -n "${metalog}" ]; then
 		${setfilesonly} && msg "Creating ${setlistdir}/set.${setname}"
 		${AWK} -f "${rundir}/getdirs.awk" "${SDIR}/flist.${setname}" \
-		    > "${SDIR}/flist.${setname}.full"
+		    > "${SDIR}/flist.${setname}.full" \
+		    || exit 1
 		(
 			echo "/set uname=root gname=wheel"
 			${AWK} -f "${rundir}/join.awk" \
 				"${SDIR}/flist.${setname}.full" "${metalog}"
 			echo "./etc/mtree/set.${setname} type=file mode=0444"
 		) | ${MTREE} -CS -k all -R time -N "${etcdir}" \
-		    > "${setlistdir}/set.${setname}"
+		    > "${setlistdir}/set.${setname}" \
+		    || exit 1
 		# We deliberately do not add set.${setname} to ${metalog},
 		# because we depend on it as an input.
 	elif ! cmp -s "${SDIR}/flist.${setname}" \
 			"${setlistdir}/set.${setname}" >/dev/null 2>&1; then
 		rm -f "${setlistdir}/set.${setname}"
-		cp "${SDIR}/flist.${setname}" "${setlistdir}/set.${setname}"
+		cp "${SDIR}/flist.${setname}" "${setlistdir}/set.${setname}" \
+		    || exit 1
 	fi
 done
 if ${setfilesonly}; then		# exit after creating the set lists

Reply via email to