Module Name:    src
Committed By:   christos
Date:           Thu Feb  7 01:07:41 UTC 2013

Modified Files:
        src/distrib/sets: maketars

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


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 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/maketars
diff -u src/distrib/sets/maketars:1.77 src/distrib/sets/maketars:1.78
--- src/distrib/sets/maketars:1.77	Tue Feb  5 20:01:12 2013
+++ src/distrib/sets/maketars	Wed Feb  6 20:07:41 2013
@@ -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 @@ for setname in ${lists}; do
 		# 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 @@ if ${setfilesonly}; then		# exit after c
 	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 @@ for setname in ${lists:-${nlists}}; do
 	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 @@ for setname in ${lists:-${nlists}}; do
 		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} + $?))

Reply via email to