Date: Fri, 15 Jul 2022 22:18:05 GMT From: Jessica Clarke <jrtc27@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: fcf120815897 - main - Makefile.inc1 release bsd.own.mk: Introduce and use TAR_CMD Message-ID: <202207152218.26FMI5FS099927@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=fcf1208158973279c6410c1d24233ae8dfaedf91 commit fcf1208158973279c6410c1d24233ae8dfaedf91 Author: Jessica Clarke <jrtc27@FreeBSD.org> AuthorDate: 2022-07-15 22:04:34 +0000 Commit: Jessica Clarke <jrtc27@FreeBSD.org> CommitDate: 2022-07-15 22:04:34 +0000 Makefile.inc1 release bsd.own.mk: Introduce and use TAR_CMD Our uses of tar rely on BSDisms, and so do not work in environments where GNU tar is the default tar. Providing a TAR_CMD variable like some other commands allows it to be overridden to use bsdtar in such cases. Reviewed by: brooks, delphij, gjb Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D35813 --- Makefile.inc1 | 24 ++++++++++++------------ release/Makefile | 4 ++-- share/mk/bsd.own.mk | 2 ++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index b9691017a1ab..98cb357946f7 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1491,12 +1491,12 @@ packageworld: .PHONY .for dist in base ${EXTRA_DISTRIBUTIONS} .if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvf - --exclude usr/lib/debug \ + ${TAR_CMD} cvf - --exclude usr/lib/debug \ @${DESTDIR}/${DISTDIR}/${dist}.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz .else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvf - --exclude usr/lib/debug . | \ + ${TAR_CMD} cvf - --exclude usr/lib/debug . | \ ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz .endif .endfor @@ -1504,11 +1504,11 @@ packageworld: .PHONY .for dist in ${DEBUG_DISTRIBUTIONS} . if defined(NO_ROOT) ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \ + ${TAR_CMD} cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz . else ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ - tar cvLf - usr/lib/debug | \ + ${TAR_CMD} cvLf - usr/lib/debug | \ ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz . endif .endfor @@ -1827,25 +1827,25 @@ packagekernel: .PHONY .if defined(NO_ROOT) .if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - --exclude '*.debug' \ + ${TAR_CMD} cvf - --exclude '*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif .if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - --include '*/*/*.debug' \ + ${TAR_CMD} cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - --exclude '*.debug' \ + ${TAR_CMD} cvf - --exclude '*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz .if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - --include '*/*/*.debug' \ + ${TAR_CMD} cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz .endif @@ -1854,22 +1854,22 @@ packagekernel: .PHONY .else .if !defined(NO_INSTALLKERNEL) cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - --exclude '*.debug' . | \ + ${TAR_CMD} cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif .if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel; \ - tar cvf - --include '*/*/*.debug' $$(eval find .) | \ + ${TAR_CMD} cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - --exclude '*.debug' . | \ + ${TAR_CMD} cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz .if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ - tar cvf - --include '*/*/*.debug' $$(eval find .) | \ + ${TAR_CMD} cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz .endif .endfor diff --git a/release/Makefile b/release/Makefile index db9cc6b22cbe..6f250e0fc9ca 100644 --- a/release/Makefile +++ b/release/Makefile @@ -138,14 +138,14 @@ kernel.txz: src.txz: mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src - cd ${DISTDIR} && tar cLvf - --exclude .svn --exclude .zfs \ + cd ${DISTDIR} && ${TAR_CMD} cLvf - --exclude .svn --exclude .zfs \ --exclude .git --exclude @ --exclude usr/src/release/dist usr/src | \ ${XZ_CMD} > ${.OBJDIR}/src.txz ports.txz: mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports - cd ${DISTDIR} && tar cLvf - \ + cd ${DISTDIR} && ${TAR_CMD} cLvf - \ --exclude .git --exclude .svn \ --exclude usr/ports/distfiles --exclude usr/ports/packages \ --exclude 'usr/ports/INDEX*' --exclude work usr/ports | \ diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 09d7dfbd25c8..a4a407ac8b6a 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -265,6 +265,8 @@ INSTALL_RSYMLINK?= ${INSTALL} ${RSYMLINK} STRIP?= -s .endif +TAR_CMD?= tar + COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207152218.26FMI5FS099927>