Skip to content
Permalink
Browse files

Update git tarball instead of writing a new one

The archive tarball created by git has a pax header comment referencing
the sha1 of the commit it was created for (see `git get-tar-commit-id`).
This would be lost when moving everything to a new tarball. In the rare
case that the submodule command did not actually create any new tarball
content, this will now leave the original git tarball unmodified.
  • Loading branch information
raimue committed Nov 17, 2016
1 parent bd7dd7e commit 5593e149164cd0b50d13f2e18cef2eba2a06cccd
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/port1.0/portfetch.tcl
@@ -527,20 +527,17 @@ proc portfetch::gitfetch {args} {
set xz [findBinary xz ${portutil::autoconf::xz_path}]
# TODO: add dependency on libarchive, if /usr/bin/tar is not bsdtar
set tar [findBinary bsdtar tar]
set tartmp [join [list [mktemp "/tmp/macports.portfetch.${name}.XXXXXXXX"] ".tar"] ""]
# determine tmppath again in shell, as the real path might be different
# due to symlinks (/tmp vs. /private/tmp), pass it as MPTOPDIR in
# environment
set cmdstring [join [list \
"MPTOPDIR=\$PWD " \
"${git.cmd} submodule -q foreach --recursive '" \
"${git.cmd} archive --format=tar --prefix=\"${git.file_prefix}/\${PWD#\$MPTOPDIR/}/\" \$sha1 " \
"| tar -cf ${tartmp} @- @${tardst} " \
"&& mv ${tartmp} ${tardst}" \
"| tar -uf ${tardst} @-" \
"' 2>&1"] ""]
if {[catch {system -W $tmppath $cmdstring} result]} {
delete $tardst
delete $tartmp
return -code error [msgcat::mc "Git submodule archive creation failed"]
}
}

0 comments on commit 5593e14

Please sign in to comment.
You can’t perform that action at this time.