Module Name:    src
Committed By:   martin
Date:           Fri Sep 28 15:04:20 UTC 2018

Modified Files:
        src/distrib/sets: Makefile makesrctars makesums maketars

Log Message:
Prepare for .tar.xz sets


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/distrib/sets/Makefile
cvs rdiff -u -r1.41 -r1.42 src/distrib/sets/makesrctars
cvs rdiff -u -r1.16 -r1.17 src/distrib/sets/makesums
cvs rdiff -u -r1.88 -r1.89 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.103 src/distrib/sets/Makefile:1.104
--- src/distrib/sets/Makefile:1.103	Tue Aug 16 01:05:19 2016
+++ src/distrib/sets/Makefile	Fri Sep 28 15:04:20 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.103 2016/08/16 01:05:19 mrg Exp $
+#	$NetBSD: Makefile,v 1.104 2018/09/28 15:04:20 martin Exp $
 
 # Experimental RCS METALOG versioning
 # (Needs host's rcs(1) commands)
@@ -15,8 +15,15 @@ all:
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
+.if ${USE_XZ_SETS} != "no"
+COMPRESS_PROGRAM=${TOOL_XZ}
+XZ_OPT=-9
+TAR_SUFF=tar.xz
+.else
 COMPRESS_PROGRAM=${TOOL_GZIP}
 GZIP_FLAGS= ${GZIP_N_FLAG}
+TAR_SUFF=tgz
+.endif
 
 SETSENV=	DESTDIR=${DESTDIR:Q} \
 		MACHINE=${MACHINE:Q} \
@@ -32,6 +39,8 @@ SETSENV=	DESTDIR=${DESTDIR:Q} \
 		PAX=${TOOL_PAX:Q} \
 		COMPRESS_PROGRAM=${COMPRESS_PROGRAM:Q} \
 		GZIP=${GZIP_FLAGS:Q} \
+		XZ_OPT=${XZ_OPT:Q} \
+		TAR_SUFF=${TAR_SUFF:Q} \
 		PKG_CREATE=${TOOL_PKG_CREATE:Q} \
 		SED=${TOOL_SED:Q} \
 		TSORT=${TSORT:Q}
@@ -232,11 +241,11 @@ makesetfiles: .PHONY sanitise_METALOG
 
 .for tar in ${MAKETARSETS}
 do-${tar}: .PHONY sanitise_METALOG
-	${_MKMSG_CREATE} "${tar}.tgz"
+	${_MKMSG_CREATE} "${tar}.${TAR_SUFF}"
 	${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} ${MAKETARS_FLAGS} \
 	    ${METALOG.unpriv} \
 	    -N ${NETBSDSRCDIR}/etc -t ${TARDIR} ${tar} \
-	|| { rm -f ${TARDIR}/${tar}.tgz; false; }
+	|| { rm -f ${TARDIR}/${tar}.${TAR_SUFF}; false; }
 .endfor
 
 
@@ -257,7 +266,7 @@ makesums: .PRECIOUS .PHONY check_RELEASE
 .for tar in ${MAKETARSETS}
 do-sum-${tar}: .PHONY do-${tar}
 	${_MKMSG_CREATE} "${tar} checksums"
-	${MAKESUMS} -t ${TARDIR} ${tar}.tgz
+	${MAKESUMS} -t ${TARDIR} ${tar}.${TAR_SUFF}
 	for i in MD5 SHA512; do \
 		${TOOL_CAT} ${TARDIR}/$$i >> ${TARDIR}/$$i.tmp; \
 	done

Index: src/distrib/sets/makesrctars
diff -u src/distrib/sets/makesrctars:1.41 src/distrib/sets/makesrctars:1.42
--- src/distrib/sets/makesrctars:1.41	Wed Apr 12 17:29:49 2017
+++ src/distrib/sets/makesrctars	Fri Sep 28 15:04:20 2018
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: makesrctars,v 1.41 2017/04/12 17:29:49 christos Exp $
+#	$NetBSD: makesrctars,v 1.42 2018/09/28 15:04:20 martin Exp $
 #
 # makesrctars srcdir setdir
 #	Create source tarballs in setdir from the source under srcdir.
@@ -150,7 +150,7 @@ fi
 
 msg "Creating checksum files"
 (cd "${setdir}"
-	${CKSUM} -a md5  *.tgz > MD5
-	${CKSUM} -a sha512 *.tgz > SHA512
+	${CKSUM} -a md5  *.tgz *.tar.xz > MD5
+	${CKSUM} -a sha512 *.tgz *.tar.xz > SHA512
 )
 exit 0

Index: src/distrib/sets/makesums
diff -u src/distrib/sets/makesums:1.16 src/distrib/sets/makesums:1.17
--- src/distrib/sets/makesums:1.16	Sat Sep 19 07:09:54 2009
+++ src/distrib/sets/makesums	Fri Sep 28 15:04:20 2018
@@ -1,13 +1,13 @@
 #!/bin/sh
 #
-# $NetBSD: makesums,v 1.16 2009/09/19 07:09:54 snj Exp $
+# $NetBSD: makesums,v 1.17 2018/09/28 15:04:20 martin Exp $
 #
 # Make checksum files for files in ``tardir''.  Usage:
 # makesums [-a] [-t tardir] [setname [...]]
 #
 # If -t is omitted, RELEASEDIR must be set and not empty.
 # The ``setname'' arguments comprise a list of files to checksum,
-# and may be omitted (in which case ``*.tgz'' is used).
+# and may be omitted (in which case ``*.tgz *.tar.xz'' is used).
 # If -A is given, then the checksum are appended to possibly existing files.
 # NOTE: Don't use this when running parallel jobs
 # If -a is given, then the list of sets is ignored, and ``*'' is used.
@@ -35,7 +35,7 @@ Usage: ${prog} [-A] [-a] [-t targetdir] 
 	-A		Append to possible existing checksum files 
 	-a		checksum all plain files instead of [setname [...]]
 	-t targetdir	\${RELEASEDIR}		[${targetdir}]
-	setname [...]	sets to checksum 	[*.tgz]
+	setname [...]	sets to checksum 	[*.tgz *.tar.xz]
 USAGE
 	exit 1
 }
@@ -69,7 +69,7 @@ pat="$*"
 if [ "${dash_all}" = yes ]; then
 	pat='*'
 elif [ -z "${pat}" ]; then
-	pat='*.tgz'
+	pat='*.tgz *.tar.xz'
 fi
 lists="$(${FIND} ${pat} -prune \( -type f -o -type l \) \
 	\! -name '*SUM' \! -name MD5 \! -name SHA512 2>/dev/null)"

Index: src/distrib/sets/maketars
diff -u src/distrib/sets/maketars:1.88 src/distrib/sets/maketars:1.89
--- src/distrib/sets/maketars:1.88	Wed Sep 26 18:20:59 2018
+++ src/distrib/sets/maketars	Fri Sep 28 15:04:20 2018
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: maketars,v 1.88 2018/09/26 18:20:59 martin Exp $
+# $NetBSD: maketars,v 1.89 2018/09/28 15:04:20 martin Exp $
 #
 # Make release tar files for some or all lists.  Usage:
 # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@@ -226,7 +226,7 @@ export GZIP
 es=0
 
 for setname in ${lists:-${nlists}}; do
-	out="${setname}.tgz"
+	out="${setname}.${TAR_SUFF:-tgz}"
 	if [ -n "${installdir}" ]; then
 		msg "Copying set ${setname}"
 		runpax "${setname}" -r ${preserve} "${installdir}"

Reply via email to