Sun Apr 28 18:07:33 2024 UTC (28d)
mk: pass --no-xattrs to tar by default

Slightly improve the GITHUB_SUBMODULES change which _always_ overrode
EXTRACT_OPTS_TAR.


(wiz)
diff -r1.21 -r1.22 pkgsrc/mk/extract/extract
diff -r1.44 -r1.45 pkgsrc/mk/extract/extract.mk

cvs diff -r1.21 -r1.22 pkgsrc/mk/extract/extract (expand / switch to unified diff)

--- pkgsrc/mk/extract/extract 2022/01/06 10:30:50 1.21
+++ pkgsrc/mk/extract/extract 2024/04/28 18:07:33 1.22
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# $NetBSD: extract,v 1.21 2022/01/06 10:30:50 schmonz Exp $ 3# $NetBSD: extract,v 1.22 2024/04/28 18:07:33 wiz Exp $
4# 4#
5# Copyright (c) 2006 The NetBSD Foundation, Inc. 5# Copyright (c) 2006 The NetBSD Foundation, Inc.
6# All rights reserved. 6# All rights reserved.
7# 7#
8# This code is derived from software contributed to The NetBSD Foundation 8# This code is derived from software contributed to The NetBSD Foundation
9# by Johnny C. Lam. 9# by Johnny C. Lam.
10# 10#
11# Redistribution and use in source and binary forms, with or without 11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions 12# modification, are permitted provided that the following conditions
13# are met: 13# are met:
14# 1. Redistributions of source code must retain the above copyright 14# 1. Redistributions of source code must retain the above copyright
15# notice, this list of conditions and the following disclaimer. 15# notice, this list of conditions and the following disclaimer.
16# 2. Redistributions in binary form must reproduce the above copyright 16# 2. Redistributions in binary form must reproduce the above copyright
@@ -248,27 +248,27 @@ tar) @@ -248,27 +248,27 @@ tar)
248 case "$extract_using" in 248 case "$extract_using" in
249 /*) paxprog="$extract_using" ;; 249 /*) paxprog="$extract_using" ;;
250 *) paxprog="${PAX}" ;; 250 *) paxprog="${PAX}" ;;
251 esac 251 esac
252 if ${TEST} -n "$exclude_file"; then 252 if ${TEST} -n "$exclude_file"; then
253 exclude=yes 253 exclude=yes
254 set -- dummy `${CAT} "$exclude_file"`; shift 254 set -- dummy `${CAT} "$exclude_file"`; shift
255 fi 255 fi
256 ${TEST} "$exclude" = no || exclude_flag="-c" 256 ${TEST} "$exclude" = no || exclude_flag="-c"
257 $decompress_cat "$distfile" | 257 $decompress_cat "$distfile" |
258 $paxprog ${EXTRACT_OPTS_PAX} $exclude_flag -O -r ${1+"$@"} 258 $paxprog ${EXTRACT_OPTS_PAX} $exclude_flag -O -r ${1+"$@"}
259 ;; 259 ;;
260 *tar) 260 *tar)
261 : ${EXTRACT_OPTS_TAR=} 261 : ${EXTRACT_OPTS_TAR=--no-xattrs}
262 case "$extract_using" in 262 case "$extract_using" in
263 /*) tarprog="$extract_using" ;; 263 /*) tarprog="$extract_using" ;;
264 *) tarprog="${TAR}" ;; 264 *) tarprog="${TAR}" ;;
265 esac 265 esac
266 tmpfile= 266 tmpfile=
267 if ${TEST} "$exclude" = "yes"; then 267 if ${TEST} "$exclude" = "yes"; then
268 tmpfile="${TMPDIR}/$self.$$" 268 tmpfile="${TMPDIR}/$self.$$"
269 ${RM} -f "$tmpfile" 269 ${RM} -f "$tmpfile"
270 trap "\${RM} -f \"\$tmpfile\"" 0 270 trap "\${RM} -f \"\$tmpfile\"" 0
271 for i in ${1+"$@"}; do 271 for i in ${1+"$@"}; do
272 ${ECHO} "$i" >> "$tmpfile" 272 ${ECHO} "$i" >> "$tmpfile"
273 done 273 done
274 exclude_file="$tmpfile" 274 exclude_file="$tmpfile"

cvs diff -r1.44 -r1.45 pkgsrc/mk/extract/extract.mk (expand / switch to unified diff)

--- pkgsrc/mk/extract/extract.mk 2022/11/23 13:30:38 1.44
+++ pkgsrc/mk/extract/extract.mk 2024/04/28 18:07:33 1.45
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: extract.mk,v 1.44 2022/11/23 13:30:38 jperkin Exp $ 1# $NetBSD: extract.mk,v 1.45 2024/04/28 18:07:33 wiz Exp $
2# 2#
3# The following variables may be set by the package Makefile and 3# The following variables may be set by the package Makefile and
4# specify how extraction happens: 4# specify how extraction happens:
5# 5#
6# EXTRACT_DIR 6# EXTRACT_DIR
7# The directory into which the files are extracted. 7# The directory into which the files are extracted.
8# 8#
9# Default value: ${WRKDIR} 9# Default value: ${WRKDIR}
10# 10#
11# EXTRACT_DIR.${file} 11# EXTRACT_DIR.${file}
12# The directory into which the file ${file} is extracted. 12# The directory into which the file ${file} is extracted.
13# 13#
14# Default: ${EXTRACT_DIR} 14# Default: ${EXTRACT_DIR}
@@ -210,26 +210,26 @@ EXTRACT_OPTS+= -t ${_EXTRACT_TAR} @@ -210,26 +210,26 @@ EXTRACT_OPTS+= -t ${_EXTRACT_TAR}
210EXTRACTOR= \ 210EXTRACTOR= \
211 ${PKGSRC_SETENV} ${_EXTRACT_ENV} ${SH} ${PKGSRCDIR}/mk/extract/extract 211 ${PKGSRC_SETENV} ${_EXTRACT_ENV} ${SH} ${PKGSRCDIR}/mk/extract/extract
212EXTRACT_CMD_DEFAULT= \ 212EXTRACT_CMD_DEFAULT= \
213 ${EXTRACTOR} ${EXTRACT_OPTS} ${DOWNLOADED_DISTFILE} ${EXTRACT_ELEMENTS} 213 ${EXTRACTOR} ${EXTRACT_OPTS} ${DOWNLOADED_DISTFILE} ${EXTRACT_ELEMENTS}
214 214
215EXTRACT_CMD?= ${EXTRACT_CMD_DEFAULT} 215EXTRACT_CMD?= ${EXTRACT_CMD_DEFAULT}
216 216
217DOWNLOADED_DISTFILE= "$${extract_file}" 217DOWNLOADED_DISTFILE= "$${extract_file}"
218 218
219.if !target(do-extract) 219.if !target(do-extract)
220do-extract: ${WRKDIR} 220do-extract: ${WRKDIR}
221. for f in ${EXTRACT_ONLY} 221. for f in ${EXTRACT_ONLY}
222 ${RUN} extract_file=${_DISTDIR:Q}/${f:Q}; export extract_file; \ 222 ${RUN} extract_file=${_DISTDIR:Q}/${f:Q}; export extract_file; \
223 EXTRACT_OPTS_TAR=${EXTRACT_OPTS_TAR.${f}}; export EXTRACT_OPTS_TAR; \ 223 if [ "" != "${EXTRACT_OPTS_TAR.${f}}" ]; then EXTRACT_OPTS_TAR=${EXTRACT_OPTS_TAR.${f}}; export EXTRACT_OPTS_TAR; fi; \
224 cd ${WRKDIR} && cd ${EXTRACT_DIR.${f}} && ${EXTRACT_CMD} 224 cd ${WRKDIR} && cd ${EXTRACT_DIR.${f}} && ${EXTRACT_CMD}
225. endfor 225. endfor
226.endif 226.endif
227 227
228.if !target(pre-extract) 228.if !target(pre-extract)
229pre-extract: 229pre-extract:
230 @${DO_NADA} 230 @${DO_NADA}
231.endif 231.endif
232.if !target(post-extract) 232.if !target(post-extract)
233post-extract: 233post-extract:
234 @${DO_NADA} 234 @${DO_NADA}
235.endif 235.endif