Source-Changes-HG archive

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

[src/trunk]: src/distrib/sets - use dest instead of DESTDIR



details:   https://anonhg.NetBSD.org/src/rev/e0dd76c5ba29
branches:  trunk
changeset: 784710:e0dd76c5ba29
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Feb 07 01:07:41 2013 +0000

description:
- use dest instead of DESTDIR
- factor out pax usage, and make it use only the first word from the sets

diffstat:

 distrib/sets/maketars |  22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diffs (59 lines):

diff -r cac4c8051094 -r e0dd76c5ba29 distrib/sets/maketars
--- a/distrib/sets/maketars     Wed Feb 06 20:39:03 2013 +0000
+++ b/distrib/sets/maketars     Thu Feb 07 01:07:41 2013 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: maketars,v 1.77 2013/02/06 01:01:12 christos Exp $
+# $NetBSD: maketars,v 1.78 2013/02/07 01:07:41 christos Exp $
 #
 # Make release tar files for some or all lists.  Usage:
 # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@@ -183,7 +183,7 @@
                # We deliberately do not add set.${setname} to ${metalog},
                # because we depend on it as an input.
        else
-               ${MTREE} -c -p "${DESTDIR}" -k all -R "${skipkeys}" \
+               ${MTREE} -c -p "${dest}" -k all -R "${skipkeys}" \
                    -O "${SDIR}/flist.${setname}" | ${MTREE} -C -k all > \
                    "${setlistdir}/set.${setname}"
        fi
@@ -192,6 +192,13 @@
        exit 0
 fi
 
+runpax() {
+       local s="$1"
+       shift
+       (cd "${dest}" && cut -d " " -f 1 "${setlistdir}/set.${s}" | 
+           ${PAX} -Ow -N"${etcdir}" ${metalog:+-M} "$@")
+}
+
 #
 # now build the tarfiles
 #
@@ -203,9 +210,7 @@
        out="${setname}.tgz"
        if [ -n "${installdir}" ]; then
                msg "Copying set ${setname}"
-               ( cd "${dest}"; \
-                   ${PAX} -O -rwpe -d -N"${etcdir}" ${metalog:+-M} \
-                       "${installdir}" < "${setlistdir}/set.${setname}" )
+               runpax "${setname}" -rpe "${installdir}"
        else
                if [ -n "${metalog}" -a "${tars}/${out}" -nt "${metalog}" ]
                then
@@ -215,11 +220,8 @@
                msg "Creating ${out}"
                rm -f "${tars}/${out}"
                TMPFILES="${TMPFILES} ${tars}/${out}.tmp"
-               ( cd "${dest}"; \
-                   ${PAX} -O -w -d -z -N"${etcdir}" ${metalog:+-M} \
-                       --use-compress-program ${COMPRESS_PROGRAM} \
-                       < "${setlistdir}/set.${setname}" ) \
-                       > "${tars}/${out}.tmp" &&
+               runpax "${setname}" -dz --use-compress-program \
+                   ${COMPRESS_PROGRAM} > "${tars}/${out}.tmp" &&
                mv "${tars}/${out}.tmp" "${tars}/${out}"
        fi
        es=$((${es} + $?))



Home | Main Index | Thread Index | Old Index