Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/sets If there are errors in creating a ${set}.tgz ta...



details:   https://anonhg.NetBSD.org/src/rev/38355dc735aa
branches:  trunk
changeset: 747362:38355dc735aa
user:      apb <apb%NetBSD.org@localhost>
date:      Sat Sep 12 11:01:55 2009 +0000

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

diffstat:

 distrib/sets/Makefile |   4 ++--
 distrib/sets/maketars |  14 +++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)

diffs (62 lines):

diff -r 6ee2a37c2079 -r 38355dc735aa distrib/sets/Makefile
--- a/distrib/sets/Makefile     Sat Sep 12 10:33:44 2009 +0000
+++ b/distrib/sets/Makefile     Sat Sep 12 11:01:55 2009 +0000
@@ -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
 
 
diff -r 6ee2a37c2079 -r 38355dc735aa distrib/sets/maketars
--- a/distrib/sets/maketars     Sat Sep 12 10:33:44 2009 +0000
+++ b/distrib/sets/maketars     Sat Sep 12 11:01:55 2009 +0000
@@ -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



Home | Main Index | Thread Index | Old Index