Skip to content

Commit

Permalink
Provide a .tar.zst in addition to the .tar.xz
Browse files Browse the repository at this point in the history
So people can stop using xz if they want.
  • Loading branch information
lazka committed Apr 5, 2024
1 parent 97d7bf5 commit 51f436b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
mv msys2-base-x86_64-[0-9]*.sfx.exe msys2-base-x86_64-latest.sfx.exe
mv msys2-x86_64-[0-9]*.exe msys2-x86_64-latest.exe
mv msys2-*.tar.xz msys2-base-x86_64-latest.tar.xz
mv msys2-*.tar.zst msys2-base-x86_64-latest.tar.zst
mv msys2-*.packages.txt msys2-base-x86_64-latest.packages.txt
sha256sum.exe msys2-*
sha256sum.exe msys2-* > msys2-checksums.txt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
_cache
*.exe
*.xz
*.zst
_build
22 changes: 16 additions & 6 deletions make-msys2-installer
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,21 @@ create_installer_archive() {
popd > /dev/null
}

create_archive() {
echo "[Creating archive...]"

create_archives() {
echo "[Creating tarball...]"
pushd "${_newmsysbase}" > /dev/null
export XZ_OPT="-9T0"
/usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cJf "${_thisdir}/msys2-base-x86_64-${_date}.tar.xz" msys64
/usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cf "${_thisdir}/msys2-base-x86_64-${_date}.tar" msys64
popd > /dev/null

echo "[Creating xz archive...]"
xz -9 --keep --verbose --force --compress --threads=0 "${_thisdir}/msys2-base-x86_64-${_date}.tar"
xz --test "${_thisdir}/msys2-base-x86_64-${_date}.tar.xz"

echo "[Creating zstd archive...]"
zstd -T0 -22 --ultra --force "${_thisdir}/msys2-base-x86_64-${_date}.tar" -o "${_thisdir}/msys2-base-x86_64-${_date}.tar.zst"
zstd --test "${_thisdir}/msys2-base-x86_64-${_date}.tar.zst"

rm "${_thisdir}/msys2-base-x86_64-${_date}.tar"
}

create_sfx() {
Expand Down Expand Up @@ -80,6 +88,8 @@ main() {
pacman -S --noconfirm --needed \
"${MINGW_PACKAGE_PREFIX}-qt-installer-framework" \
"${MINGW_PACKAGE_PREFIX}-7zip" \
"${MINGW_PACKAGE_PREFIX}-xz" \
"${MINGW_PACKAGE_PREFIX}-zstd" \
"tar"

create_chroot_system
Expand All @@ -88,7 +98,7 @@ main() {
create_installer_archive
create_installer

create_archive
create_archives
create_sfx
}

Expand Down

0 comments on commit 51f436b

Please sign in to comment.