summaryrefslogtreecommitdiffstats
path: root/Modules/CPack.STGZ_Header.sh.in
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2017-01-22 21:04:42 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2017-01-22 21:06:59 (GMT)
commit1c93eb683b182b1f0bbdcbd39fc50ad48cc57739 (patch)
tree8f8e1831895cb16646225fca698a1a329dfa5dba /Modules/CPack.STGZ_Header.sh.in
parentf5fae345e4a0f9f54b69424552f7d85aa85ba907 (diff)
downloadCMake-1c93eb683b182b1f0bbdcbd39fc50ad48cc57739.zip
CMake-1c93eb683b182b1f0bbdcbd39fc50ad48cc57739.tar.gz
CMake-1c93eb683b182b1f0bbdcbd39fc50ad48cc57739.tar.bz2
CPack/STGZ prefer pax for extraction
pax is part of POSIX while tar requires GNU extensions that are not part of some UNIX distros
Diffstat (limited to 'Modules/CPack.STGZ_Header.sh.in')
-rwxr-xr-xModules/CPack.STGZ_Header.sh.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/CPack.STGZ_Header.sh.in b/Modules/CPack.STGZ_Header.sh.in
index dee576f..c615851 100755
--- a/Modules/CPack.STGZ_Header.sh.in
+++ b/Modules/CPack.STGZ_Header.sh.in
@@ -130,7 +130,10 @@ echo ""
use_new_tail_syntax="-n"
tail $use_new_tail_syntax +1 "$0" > /dev/null 2> /dev/null || use_new_tail_syntax=""
-tail $use_new_tail_syntax +###CPACK_HEADER_LENGTH### "$0" | gunzip | (cd "${toplevel}" && tar xf -) || cpack_echo_exit "Problem unpacking the @CPACK_PACKAGE_FILE_NAME@"
+extractor="pax -r"
+command -v pax > /dev/null 2> /dev/null || extractor="tar xf -"
+
+tail $use_new_tail_syntax +###CPACK_HEADER_LENGTH### "$0" | gunzip | (cd "${toplevel}" && ${extractor}) || cpack_echo_exit "Problem unpacking the @CPACK_PACKAGE_FILE_NAME@"
echo "Unpacking finished successfully"