Prepare for .tar.xz sets

This commit is contained in:
martin 2018-09-28 15:04:20 +00:00
parent e407f0a09e
commit e918e5b057
4 changed files with 22 additions and 13 deletions

View File

@ -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 # Experimental RCS METALOG versioning
# (Needs host's rcs(1) commands) # (Needs host's rcs(1) commands)
@ -15,8 +15,15 @@ all:
.include <bsd.own.mk> .include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" .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} COMPRESS_PROGRAM=${TOOL_GZIP}
GZIP_FLAGS= ${GZIP_N_FLAG} GZIP_FLAGS= ${GZIP_N_FLAG}
TAR_SUFF=tgz
.endif
SETSENV= DESTDIR=${DESTDIR:Q} \ SETSENV= DESTDIR=${DESTDIR:Q} \
MACHINE=${MACHINE:Q} \ MACHINE=${MACHINE:Q} \
@ -32,6 +39,8 @@ SETSENV= DESTDIR=${DESTDIR:Q} \
PAX=${TOOL_PAX:Q} \ PAX=${TOOL_PAX:Q} \
COMPRESS_PROGRAM=${COMPRESS_PROGRAM:Q} \ COMPRESS_PROGRAM=${COMPRESS_PROGRAM:Q} \
GZIP=${GZIP_FLAGS:Q} \ GZIP=${GZIP_FLAGS:Q} \
XZ_OPT=${XZ_OPT:Q} \
TAR_SUFF=${TAR_SUFF:Q} \
PKG_CREATE=${TOOL_PKG_CREATE:Q} \ PKG_CREATE=${TOOL_PKG_CREATE:Q} \
SED=${TOOL_SED:Q} \ SED=${TOOL_SED:Q} \
TSORT=${TSORT:Q} TSORT=${TSORT:Q}
@ -232,11 +241,11 @@ makesetfiles: .PHONY sanitise_METALOG
.for tar in ${MAKETARSETS} .for tar in ${MAKETARSETS}
do-${tar}: .PHONY sanitise_METALOG do-${tar}: .PHONY sanitise_METALOG
${_MKMSG_CREATE} "${tar}.tgz" ${_MKMSG_CREATE} "${tar}.${TAR_SUFF}"
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} ${MAKETARS_FLAGS} \ ${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} ${MAKETARS_FLAGS} \
${METALOG.unpriv} \ ${METALOG.unpriv} \
-N ${NETBSDSRCDIR}/etc -t ${TARDIR} ${tar} \ -N ${NETBSDSRCDIR}/etc -t ${TARDIR} ${tar} \
|| { rm -f ${TARDIR}/${tar}.tgz; false; } || { rm -f ${TARDIR}/${tar}.${TAR_SUFF}; false; }
.endfor .endfor
@ -257,7 +266,7 @@ makesums: .PRECIOUS .PHONY check_RELEASEDIR .WAIT \
.for tar in ${MAKETARSETS} .for tar in ${MAKETARSETS}
do-sum-${tar}: .PHONY do-${tar} do-sum-${tar}: .PHONY do-${tar}
${_MKMSG_CREATE} "${tar} checksums" ${_MKMSG_CREATE} "${tar} checksums"
${MAKESUMS} -t ${TARDIR} ${tar}.tgz ${MAKESUMS} -t ${TARDIR} ${tar}.${TAR_SUFF}
for i in MD5 SHA512; do \ for i in MD5 SHA512; do \
${TOOL_CAT} ${TARDIR}/$$i >> ${TARDIR}/$$i.tmp; \ ${TOOL_CAT} ${TARDIR}/$$i >> ${TARDIR}/$$i.tmp; \
done done

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /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 # makesrctars srcdir setdir
# Create source tarballs in setdir from the source under srcdir. # Create source tarballs in setdir from the source under srcdir.
@ -150,7 +150,7 @@ fi
msg "Creating checksum files" msg "Creating checksum files"
(cd "${setdir}" (cd "${setdir}"
${CKSUM} -a md5 *.tgz > MD5 ${CKSUM} -a md5 *.tgz *.tar.xz > MD5
${CKSUM} -a sha512 *.tgz > SHA512 ${CKSUM} -a sha512 *.tgz *.tar.xz > SHA512
) )
exit 0 exit 0

View File

@ -1,13 +1,13 @@
#!/bin/sh #!/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: # Make checksum files for files in ``tardir''. Usage:
# makesums [-a] [-t tardir] [setname [...]] # makesums [-a] [-t tardir] [setname [...]]
# #
# If -t is omitted, RELEASEDIR must be set and not empty. # If -t is omitted, RELEASEDIR must be set and not empty.
# The ``setname'' arguments comprise a list of files to checksum, # 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. # If -A is given, then the checksum are appended to possibly existing files.
# NOTE: Don't use this when running parallel jobs # NOTE: Don't use this when running parallel jobs
# If -a is given, then the list of sets is ignored, and ``*'' is used. # If -a is given, then the list of sets is ignored, and ``*'' is used.
@ -35,7 +35,7 @@ Usage: ${prog} [-A] [-a] [-t targetdir] [setname [...]]
-A Append to possible existing checksum files -A Append to possible existing checksum files
-a checksum all plain files instead of [setname [...]] -a checksum all plain files instead of [setname [...]]
-t targetdir \${RELEASEDIR} [${targetdir}] -t targetdir \${RELEASEDIR} [${targetdir}]
setname [...] sets to checksum [*.tgz] setname [...] sets to checksum [*.tgz *.tar.xz]
USAGE USAGE
exit 1 exit 1
} }
@ -69,7 +69,7 @@ pat="$*"
if [ "${dash_all}" = yes ]; then if [ "${dash_all}" = yes ]; then
pat='*' pat='*'
elif [ -z "${pat}" ]; then elif [ -z "${pat}" ]; then
pat='*.tgz' pat='*.tgz *.tar.xz'
fi fi
lists="$(${FIND} ${pat} -prune \( -type f -o -type l \) \ lists="$(${FIND} ${pat} -prune \( -type f -o -type l \) \
\! -name '*SUM' \! -name MD5 \! -name SHA512 2>/dev/null)" \! -name '*SUM' \! -name MD5 \! -name SHA512 2>/dev/null)"

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/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: # Make release tar files for some or all lists. Usage:
# maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir] # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@ -226,7 +226,7 @@ export GZIP
es=0 es=0
for setname in ${lists:-${nlists}}; do for setname in ${lists:-${nlists}}; do
out="${setname}.tgz" out="${setname}.${TAR_SUFF:-tgz}"
if [ -n "${installdir}" ]; then if [ -n "${installdir}" ]; then
msg "Copying set ${setname}" msg "Copying set ${setname}"
runpax "${setname}" -r ${preserve} "${installdir}" runpax "${setname}" -r ${preserve} "${installdir}"