diff options
Diffstat (limited to 'source/a/pkgtools/scripts')
-rw-r--r-- | source/a/pkgtools/scripts/installpkg | 8 | ||||
-rw-r--r-- | source/a/pkgtools/scripts/makepkg | 26 |
2 files changed, 20 insertions, 14 deletions
diff --git a/source/a/pkgtools/scripts/installpkg b/source/a/pkgtools/scripts/installpkg index ee76cf134..64791afc6 100644 --- a/source/a/pkgtools/scripts/installpkg +++ b/source/a/pkgtools/scripts/installpkg @@ -268,8 +268,6 @@ while [ 0 ]; do elif [ "$1" = "-threads" -o "$1" = "--threads" ]; then THREADS="$2" shift 2 - # xz has not yet implemented multi-threaded decompression. - # Who knows if or how well it will work... XZ_THREADS_FORCED=yes elif [ "$1" = "-priority" -o "$1" = "--priority" ]; then if [ "$2" = "" ]; then @@ -365,7 +363,8 @@ if [ "$MODE" = "warn" ]; then if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then packagecompression="xz --threads=${THREADS}" else - packagecompression="xz --threads=2" + # Let xz determine how many threads to use: + packagecompression="xz --threads=0" fi ;; esac @@ -453,7 +452,8 @@ for package in $* ; do if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then packagecompression="xz --threads=${THREADS}" else - packagecompression="xz --threads=2" + # Let xz determine how many threads to use: + packagecompression="xz --threads=0" fi ;; esac diff --git a/source/a/pkgtools/scripts/makepkg b/source/a/pkgtools/scripts/makepkg index ddced779e..72746fa84 100644 --- a/source/a/pkgtools/scripts/makepkg +++ b/source/a/pkgtools/scripts/makepkg @@ -146,8 +146,6 @@ while [ 0 ]; do elif [ "$1" = "-threads" -o "$1" = "--threads" ]; then THREADS="$2" shift 2 - # xz has memory issues with threads it seems, so we'll use two threads by - # default unless we see that something else was user-selected: XZ_THREADS_FORCED=yes elif [ "$1" = "-compress" -o "$1" = "--compress" ]; then COMPRESS_OPTION="$2" @@ -253,10 +251,14 @@ elif [ ! "$(basename $PACKAGE_NAME .tar.lzma)" = "$PACKAGE_NAME" ]; then elif [ ! "$(basename $PACKAGE_NAME .txz)" = "$PACKAGE_NAME" ]; then EXTENSION="txz" if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then - # Two threads by default with xz due to memory failures on 32-bit. Not that - # it matters much... if upstream ever gets around to implementing multi- - # threaded decompression we'll revisit this default. :-D - COMPRESSOR="xz ${COMPRESS_OPTION} --threads=2 -c" + # TODO: Add ARM 64-bit $ARCHes to this test: + if [ "$(uname -m)" = "x86_64" ]; then + # Allow xz to determine how many threads to use: + COMPRESSOR="xz ${COMPRESS_OPTION} --threads=0 -c" + else + # Default to 2 threads on 32-bit platforms: + COMPRESSOR="xz ${COMPRESS_OPTION} --threads=2 -c" + fi else COMPRESSOR="xz ${COMPRESS_OPTION} --threads=${THREADS} -c" fi @@ -267,10 +269,14 @@ elif [ ! "$(basename $PACKAGE_NAME .txz)" = "$PACKAGE_NAME" ]; then elif [ ! "$(basename $PACKAGE_NAME .tar.xz)" = "$PACKAGE_NAME" ]; then EXTENSION="tar.xz" if [ ! "$XZ_THREADS_FORCED" = "yes" ]; then - # Two threads by default with xz due to memory failures on 32-bit. Not that - # it matters much... if upstream ever gets around to implementing multi- - # threaded decompression we'll revisit this default. :-D - COMPRESSOR="xz ${COMPRESS_OPTION} --threads=2 -c" + # TODO: Add ARM 64-bit $ARCHes to this test: + if [ "$(uname -m)" = "x86_64" ]; then + # Allow xz to determine how many threads to use: + COMPRESSOR="xz ${COMPRESS_OPTION} --threads=0 -c" + else + # Default to 2 threads on 32-bit platforms: + COMPRESSOR="xz ${COMPRESS_OPTION} --threads=2 -c" + fi else COMPRESSOR="xz ${COMPRESS_OPTION} --threads=${THREADS} -c" fi |