]> Sergey Matveev's repositories - bass.git/commitdiff
DRY Git-based targets
authorSergey Matveev <stargrave@stargrave.org>
Wed, 11 Mar 2026 10:54:33 +0000 (13:54 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 11 Mar 2026 10:54:33 +0000 (13:54 +0300)
41 files changed:
build/distfiles/dl/age-v1.3.0.tar.zst.do
build/distfiles/dl/b2sum-20190724-12-ged1974e.tar.zst.do
build/distfiles/dl/bfs-4.0.7.tar.zst.do
build/distfiles/dl/dav1d-1.5.2.tar.zst.do
build/distfiles/dl/dq-20240101.tar.zst.do
build/distfiles/dl/ffmpeg-n8.1-dev-1980-gde3f99d74b.tar.zst.do
build/distfiles/dl/gcc-4-compile-with-gcc-5.patch.do
build/distfiles/dl/girara-0.4.5.tar.zst.do
build/distfiles/dl/iniparser-v4.2.2.tar.zst.do
build/distfiles/dl/jimtcl-0.81.tar.zst.do
build/distfiles/dl/jimtcl-0.83-94-g912c167.tar.zst.do
build/distfiles/dl/libargparse-81998ffafb9c2ac8cf488d31e536a2e6fd6b3fdf.tar.zst.do
build/distfiles/dl/libavif-v1.3.0-137-g3126181b.tar.zst.do
build/distfiles/dl/libde265-v1.0.15-17-g01bb88b7.tar.zst.do
build/distfiles/dl/libheif-v1.19.5-49-g1630460f.tar.zst.do
build/distfiles/dl/libjxl-v0.11.2.tar.zst.do
build/distfiles/dl/libopusenc-v0.3.tar.zst.do
build/distfiles/dl/libplacebo-v6.338.0-117-g5c1e6da2.tar.zst.do
build/distfiles/dl/libtap-0.1.0-44-gb53e4ef.tar.zst.do
build/distfiles/dl/libtorrent-v2.0.10-41-g2ab8fedab.tar.zst.do
build/distfiles/dl/libvpx-v1.14.1-303-gd6ae3ea465.tar.zst.do
build/distfiles/dl/libyuv-2024-06-22.tar.zst.do
build/distfiles/dl/mod_tile-v0.7.0-58-gc3453bc.tar.zst.do
build/distfiles/dl/mpv-v0.40.0-445-g7815181b19.tar.zst.do
build/distfiles/dl/mupdf-1.27.2.tar.zst.do
build/distfiles/dl/nfdump-v1.7.6-62-g96ebd8f.tar.zst.do
build/distfiles/dl/ninja-v1.12.1.tar.zst.do
build/distfiles/dl/nsxiv-v32-11-g420a0a2.tar.zst.do
build/distfiles/dl/oneTBB-v2022.0.0.tar.zst.do
build/distfiles/dl/oniguruma-v6.9.9.tar.zst.do
build/distfiles/dl/sdcv-0.5.5.tar.zst.do
build/distfiles/dl/shared-mime-info-2.2.tar.zst.do
build/distfiles/dl/svt-av1-v4.0.1.tar.zst.do
build/distfiles/dl/sxhkd-0.6.2-5-gb0923b6.tar.zst.do
build/distfiles/dl/vim-v9.2.0078.tar.zst.do
build/distfiles/dl/voxtral.c-20260208.tar.zst.do
build/distfiles/dl/whisper.cpp-1.8.3.tar.zst.do
build/distfiles/dl/x264-2024-05-12.tar.zst.do
build/distfiles/dl/zimg-3.0.5-207-g0e56801.tar.zst.do
build/distfiles/utils/git-to-tarball [new file with mode: 0755]
build/distfiles/utils/git-with-submodules-to-tarball [new file with mode: 0755]

index c3690a1c49c0382da176324bd295ab3b924982a7fdf291597f5a0a5c1b5292ad..3a55c1545179b3a9c144bfe98e2c700b9f7d45cdf93e4c2d13956dc519dd8600 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/age.git ] ||
-git clone --depth 1 --bare https://github.com/FiloSottile/age.git "$DISTFILES"/repo/age.git >&2
-cd "$DISTFILES"/repo/age.git
-commit=6a8065f2da1cc3e00a1b4cb39bef5fbdf4c48960
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball age \
+    https://github.com/FiloSottile/age.git \
+    6a8065f2da1cc3e00a1b4cb39bef5fbdf4c48960 \
+    ${1%.tar.zst}
index 8d2bd67c9520e272c54d13d23494ee1bae9cf9aac0dde62b9f3470c0101f5f20..60d0bd6821e2851900f4a473fce5f2d98f52bfc9c861da46773f189e24c3a4d0 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/BLAKE2.git ] ||
-git clone --depth 1 --bare https://github.com/BLAKE2/BLAKE2.git "$DISTFILES"/repo/BLAKE2.git >&2
-cd "$DISTFILES"/repo/BLAKE2.git
-commit=ed1974ea83433eba7b2d95c5dcd9ac33cb847913
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball BLAKE2 \
+    https://github.com/BLAKE2/BLAKE2.git \
+    ed1974ea83433eba7b2d95c5dcd9ac33cb847913 \
+    ${1%.tar.zst}
index 157863e291bea81b2e29a8c7e83b9671b69fcca1db4bd4b03cdcf34168fc32ea..5e42d81f0c04b770258ea85c76caa51a992fe5ca46848729fd734794572ff970 100644 (file)
@@ -1,7 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/bfs.git ] || git clone --depth 1 --bare https://github.com/tavianator/bfs.git "$DISTFILES"/repo/bfs.git >&2
-cd "$DISTFILES"/repo/bfs.git
-commit=8d5472c2ec6312569c177ccce3adc05414d8bb40
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball bfs \
+    https://github.com/tavianator/bfs.git  \
+    8d5472c2ec6312569c177ccce3adc05414d8bb40 \
+    ${1%.tar.zst}
index b78a8711421f016c0d7c83c3e30bb9cc08f1c15279f430dcf8b1d76d32fe1305..11acad4a7b4fc9345f696b1e6091da6ee4fbaa1b3289c2d323b61694c380a9b0 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/dav1d.git ] ||
-git clone --depth 1 --bare https://code.videolan.org/videolan/dav1d.git "$DISTFILES"/repo/dav1d.git >&2
-cd "$DISTFILES"/repo/dav1d.git
-commit=c720f4d3556a01916324aea155555d3efba842e8
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball dav1d \
+    https://code.videolan.org/videolan/dav1d.git \
+    c720f4d3556a01916324aea155555d3efba842e8 \
+    ${1%.tar.zst}
index ae2c2829651c9c38c59aed8d4868974e670eba6573687ec4d8fd8d62212c9c3b..2aafb8cf7e64a4ed48eab653b0a6238fd41773232022c80c8d7a69e44ebb97e7 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/dq.git ] ||
-git clone --depth 1 --bare https://github.com/janmojzis/dq.git "$DISTFILES"/repo/dq.git >&2
-cd "$DISTFILES"/repo/dq.git
-commit=5b585015f2772b8e258bbb6441b8bf5a4b2861af
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball dq \
+    https://github.com/janmojzis/dq.git \
+    5b585015f2772b8e258bbb6441b8bf5a4b2861af \
+    ${1%.tar.zst}
index e90608960eac709785d66fd712c389f1e0b3aaae3e702f19c6df418cffc06c79..47b38648c040eb00b028efe7214e7470af7e4e952d1fec64683bc43e4cce9acf 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/ffmpeg.git ] ||
-git clone --depth 1 --bare https://github.com/FFmpeg/FFmpeg.git ffmpeg.git "$DISTFILES"/repo/ffmpeg.git >&2
-cd "$DISTFILES"/repo/ffmpeg.git
-commit=de3f99d74b916ea8363f2c81ca343980844f6031
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball ffmpeg \
+    https://github.com/FFmpeg/FFmpeg.git \
+    de3f99d74b916ea8363f2c81ca343980844f6031 \
+    ${1%.tar.zst}
index e5274be2e89c3e2b3892b64fee3bdccc41129bf928975ab1e73b8d737ece7d1d..f674e15904255406ec89132c446733f028e969b28b6367a6e062a81c8d6ff5d2 100644 (file)
@@ -1,7 +1,8 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/guix.git ] ||
-git clone --depth 1 --bare https://git.savannah.gnu.org/git/guix.git "$DISTFILES"/repo/guix.git >&2
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball guix \
+    https://git.savannah.gnu.org/git/guix.git \
+    749a73cacad30fd9e149d9086c7e4e4a0b86834b \
+    v1.5.0 >/dev/null
 p=gnu/packages/patches/gcc-4-compile-with-gcc-5.patch
-( cd "$DISTFILES"/repo/guix.git ; git archive @ $p | tar xfO - $p ) >$3
+( cd ../repo/guix.git ; git archive @ $p | tar xfO - $p ) >$3
 meta4ra-check -pipe $1.meta4 $1 <$3 >/dev/null
index 112dfbea88758466976899e8353d4a40fe1e93eee496f7bb4e5184a4fe09f89e..e7de23242797a585ad03eba9484ed1ea839151d6b9036f95cda0966a625cb9d8 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/girara.git ] ||
-git clone --depth 1 --bare https://github.com/pwmt/girara.git "$DISTFILES"/repo/girara.git >&2
-cd "$DISTFILES"/repo/girara.git
-commit=5be5b1f7afd3bd61666babdd04f4015b931c990c
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball girara \
+    https://github.com/pwmt/girara.git \
+    5be5b1f7afd3bd61666babdd04f4015b931c990c \
+    ${1%.tar.zst}
index c8001a5518fa46e71cd63dfca1de4e1cb0b9a2c0a0553060a09d661bda2d7410..8042900bc4337352530a5a42cb9d91e3b13c3448b4e8592651fbc23347dc9af3 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/iniparser.git ] ||
-git clone --depth 1 --bare "$DISTFILES"/repo/iniparser.git https://gitlab.com/iniparser/iniparser.git
-cd "$DISTFILES"/repo/iniparser.git
-commit=762715ca6cdba9dcf31a5af9297b444f3b5b8c00
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball iniparser \
+    https://gitlab.com/iniparser/iniparser.git \
+    762715ca6cdba9dcf31a5af9297b444f3b5b8c00 \
+    ${1%.tar.zst}
index b7f5089499c58757c32138c6b8a7bc5f632e2efb8afdd606c943a6fcad012e76..e48a5fca34d27e871ddab1a8f597752274080d454e174eaa463061a99ebca72b 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/jimtcl.git ] ||
-git clone --depth 1 --bare https://github.com/msteveb/jimtcl.git "$DISTFILES"/repo/jimtcl.git >&2
-cd "$DISTFILES"/repo/jimtcl.git
-commit=2553e31de2a0ab6ca5ae1de9f3bff3858e37701a
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball jimtcl \
+    https://github.com/msteveb/jimtcl.git \
+    2553e31de2a0ab6ca5ae1de9f3bff3858e37701a \
+    ${1%.tar.zst}
index 0d3543065887f098a93683dbe2716c68ed325c5620ded8eed8b1dc8c40356da7..385a341eb10524635cd7f81d771f65cf2de10307c4fbe308c58c9cc2ddb432ad 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/jimtcl.git ] ||
-git clone --depth 1 --bare https://github.com/msteveb/jimtcl.git "$DISTFILES"/repo/jimtcl.git >&2
-cd "$DISTFILES"/repo/jimtcl.git
-commit=912c167ed6dc5c2cb30bd57e20f10954503438e2
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball jimtcl \
+    https://github.com/msteveb/jimtcl.git \
+    912c167ed6dc5c2cb30bd57e20f10954503438e2 \
+    ${1%.tar.zst}
index 583bb5666b62e948dc638455fcb46f5cf9dac9ad8b54b7cc6017bb674a643bed..a71082ba1361adfb7540f6364ff53da3e1d842addd6eef5d6fa090990251724b 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libargparse.git ] ||
-git clone --depth 1 --bare https://github.com/maryla-uc/libargparse.git "$DISTFILES"/repo/libargparse.git >&2
-cd "$DISTFILES"/repo/libargparse.git
-commit=81998ffafb9c2ac8cf488d31e536a2e6fd6b3fdf
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libargparse \
+    https://github.com/maryla-uc/libargparse.git \
+    81998ffafb9c2ac8cf488d31e536a2e6fd6b3fdf \
+    ${1%.tar.zst}
index b3d885f9913ac86eb5a11433c926411d72cfc3ac1fc99b685efaf299fdb2d274..46a1f99fb1f4a2915105196189e460c41b4382f3ebd7f6f13026d2a4a5ed3b5b 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libavif.git ] ||
-git clone --depth 1 --bare https://github.com/AOMediaCodec/libavif.git "$DISTFILES"/repo/libavif.git >&2
-cd "$DISTFILES"/repo/libavif.git
-commit=3126181bed01a79a5716d18869b00b7ed3024708
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libavif \
+    https://github.com/AOMediaCodec/libavif.git \
+    3126181bed01a79a5716d18869b00b7ed3024708 \
+    ${1%.tar.zst}
index f7aead72138c309470865de99a6d1ad4a3c38c08899845a6fc0d6093c933d963..50b92e794b91ad2f81dbb3ee8fcd08fe266d3c3da321f051bf8b101914cc915e 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libde265.git ] ||
-git clone --depth 1 --bare https://github.com/strukturag/libde265.git "$DISTFILES"/repo/libde265.git >&2
-cd "$DISTFILES"/repo/libde265.git
-commit=01bb88b7a518bedec28b9c9229ee7ee83d436832
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libde265 \
+    https://github.com/strukturag/libde265.git \
+    01bb88b7a518bedec28b9c9229ee7ee83d436832 \
+    ${1%.tar.zst}
index d0686f490045968f990ec5c6a74168ef3af271522667ebe10d4dd04f220f6063..63d9aec429955da498f6395abade8cc3d55a4c7286dc15bf5310b2bc9785db43 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libheif.git ] ||
-git clone --depth 1 --bare https://github.com/strukturag/libheif.git "$DISTFILES"/repo/libheif.git >&2
-cd "$DISTFILES"/repo/libheif.git
-commit=1630460fdb747f2d3c803e9ce38c22469eeadc83
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libheif \
+    https://github.com/strukturag/libheif.git \
+    1630460fdb747f2d3c803e9ce38c22469eeadc83 \
+    ${1%.tar.zst}
index bf5472db6c1a6bffafe4d451bc339bf6c9219957a6a79aacf1f40f55f513cdc5..5c33068ca3cd4a152a7ca28867c56120b47d9179d7f1fe59d2ca635afbe64eba 100644 (file)
@@ -1,14 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libjxl ] ||
-git clone --depth 1 https://github.com/libjxl/libjxl.git "$DISTFILES"/repo/libjxl >&2
-cd "$DISTFILES"/repo/libjxl
-commit=332feb17d17311c748445f7ee75c4fb55cc38530
-git fetch origin $commit >&2
-git checkout $commit >&2
-git submodule update --init --recursive >&2
-dir=${1%.tar.zst}
-{
-    git archive --prefix=$dir/ @
-    git submodule --quiet foreach 'git archive --prefix='$dir'/$sm_path/ @'
-} | $COMPRESSOR
+redo-ifchange ../utils/git-with-submodules-to-tarball
+../utils/git-with-submodules-to-tarball libjxl \
+    https://github.com/libjxl/libjxl.git \
+    332feb17d17311c748445f7ee75c4fb55cc38530 \
+    ${1%.tar.zst}
index a458b709fa082d1e6e4911639a6a502f20e59c888990aa244fe77c0164c00c16..7bad8fc898c9bc3a4d3c86483d26aada42667f3dc0d39041e5d80f84325635b4 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libopusenc.git ] ||
-git clone --depth 1 --bare https://github.com/xiph/libopusenc.git "$DISTFILES"/repo/libopusenc.git >&2
-cd "$DISTFILES"/repo/libopusenc.git
-commit=0dba1bea736ab8bb811409dce80c994a00a2ced9
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libopusenc \
+    https://github.com/xiph/libopusenc.git \
+    0dba1bea736ab8bb811409dce80c994a00a2ced9 \
+    ${1%.tar.zst}
index 04bfbbd4fc6fe2a3ca724359beacd278377dfa167c15a50755c4fa833c4c021b..080a7f448938b27fbd5f4591f9b23e93021d151862c26c97e433c62ebe5b7231 100644 (file)
@@ -1,14 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libplacebo ] ||
-git clone --depth 1 https://code.videolan.org/videolan/libplacebo.git "$DISTFILES"/repo/libplacebo >&2
-cd "$DISTFILES"/repo/libplacebo
-commit=5c1e6da21f108a27b11fad97fd491ddee06ede3c
-git fetch origin $commit >&2
-git checkout $commit >&2
-git submodule update --init --recursive >&2
-dir=${1%.tar.zst}
-{
-    git archive --prefix=$dir/ @
-    git submodule --quiet foreach 'git archive --prefix='$dir'/$sm_path/ @'
-} | $COMPRESSOR
+redo-ifchange ../utils/git-with-submodules-to-tarball
+../utils/git-with-submodules-to-tarball libplacebo \
+    https://code.videolan.org/videolan/libplacebo.git \
+    5c1e6da21f108a27b11fad97fd491ddee06ede3c \
+    ${1%.tar.zst}
index e13d54aeb391278757198279c3a4e1e674f5a3b7b1e384c64cce9a9e5bac0d18..6fa71c5370e116c0a7b42102a0951c2972126f51c7f1b27a02bdff13c763b661 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libtap.git ] ||
-git clone --depth 1 --bare "$DISTFILES"/repo/libtap.git https://github.com/zorgnax/libtap.git
-cd "$DISTFILES"/repo/libtap.git
-commit=b53e4ef5257f80e881762b6143834d8aae29da1a
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libtap \
+    https://github.com/zorgnax/libtap.git \
+    b53e4ef5257f80e881762b6143834d8aae29da1a \
+    ${1%.tar.zst}
index efc1b48df0bfb8a3e85b150d1860437f5210a6522278822cdaab37af7794a702..396390d0d136c4afd023e0a8c54a8f0ab0c9d3ccff8972d90eeb14af9a3518c9 100644 (file)
@@ -1,14 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libtorrent ] ||
-git clone --depth 1 https://github.com/arvidn/libtorrent.git "$DISTFILES"/repo/libtorrent >&2
-cd "$DISTFILES"/repo/libtorrent
-commit=2ab8fedabb7716947edc77958da6d0b5e1040df9
-git fetch origin $commit >&2
-git checkout $commit >&2
-git submodule update --init --recursive >&2
-dir=${1%.tar.zst}
-{
-    git archive --prefix=$dir/ @
-    git submodule --quiet foreach 'git archive --prefix='$dir'/$sm_path/ @'
-} | $COMPRESSOR
+redo-ifchange ../utils/git-with-submodules-to-tarball
+../utils/git-with-submodules-to-tarball libtorrent \
+    https://github.com/arvidn/libtorrent.git \
+    2ab8fedabb7716947edc77958da6d0b5e1040df9 \
+    ${1%.tar.zst}
index 4c61470d6d6e9357a0410422a804a39e5ea21d04cb29eb1f0898c171db1c5fe0..7b38e922455fa6742002f282e306fde179a8c78d3c782713c04a9f2035b4c919 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libvpx.git ] ||
-git clone --depth 1 --bare https://chromium.googlesource.com/webm/libvpx "$DISTFILES"/repo/libvpx.git >&2
-cd "$DISTFILES"/repo/libvpx.git
-commit=d6ae3ea465d32ea16a4814513f43022b88c5bdfe
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libvpx \
+    https://chromium.googlesource.com/webm/libvpx \
+    d6ae3ea465d32ea16a4814513f43022b88c5bdfe \
+    ${1%.tar.zst}
index 677e2c252d751d04ce63c725a069ba8915274afdd06cb2471688dbcc543988aa..e0e4c1ec20886b61789b13f591cceab419038ba83d52909dade804da72afa84c 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/libyuv.git ] ||
-git clone --depth 1 --bare https://chromium.googlesource.com/libyuv/libyuv.git "$DISTFILES"/repo/libyuv.git >&2
-cd "$DISTFILES"/repo/libyuv.git
-commit=efd164d64ee4aab463e00f69e0de7f53ca91865d
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball libyuv \
+    https://chromium.googlesource.com/libyuv/libyuv.git \
+    efd164d64ee4aab463e00f69e0de7f53ca91865d \
+    ${1%.tar.zst}
index 88871e317c454592fadc318320dc8b765233ad64482c13105b0aa2a210356933..08e94696dbb8d4873d48fd0d636902e9312dc6768e9c94be2f4f8777ad47d966 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/mod_tile.git ] ||
-git clone --depth 1 --bare "$DISTFILES"/repo/mod_tile.git https://github.com/openstreetmap/mod_tile.git
-cd "$DISTFILES"/repo/mod_tile.git
-commit=c3453bc1e19247c145b0e87742710d5e076e338e
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball mod_tile \
+    https://github.com/openstreetmap/mod_tile.git \
+    c3453bc1e19247c145b0e87742710d5e076e338e \
+    ${1%.tar.zst}
index ad69dbb8e023e48d249f83d95449f3a69955a98721d291403ce19ea2e8cc0d94..a6c4de7ec0db55480431c858638e792f8a724be220fb749b166bc69a0c40e415 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/mpv.git ] ||
-git clone --depth 1 --bare https://github.com/mpv-player/mpv.git "$DISTFILES"/repo/mpv.git >&2
-cd "$DISTFILES"/repo/mpv.git
-commit=7815181b19e29a887a7105330768b9078e99a42e
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball mpv \
+    https://github.com/mpv-player/mpv.git \
+    7815181b19e29a887a7105330768b9078e99a42e \
+    ${1%.tar.zst}
index 5fd0d75e20d8caef3649fdf5cae1f2d762fb7e1bbb02dcf04decd201fedc88a5..6a3a911b099d2bb8915983c261bb2e66212bd79a8955acaac3878f109d7f5ea5 100644 (file)
@@ -1,14 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/mupdf ] ||
-git clone --depth 1 https://github.com/ArtifexSoftware/mupdf.git "$DISTFILES"/repo/mupdf >&2
-cd "$DISTFILES"/repo/mupdf
-commit=73d3100d46d8a9ad634f6ef035bbe78f0f947886
-git fetch origin $commit >&2
-git checkout $commit >&2
-git submodule update --init --recursive >&2
-dir=${1%.tar.zst}
-{
-    git archive --prefix=$dir/ @
-    git submodule --quiet foreach 'git archive --prefix='$dir'/$sm_path/ @'
-} | $COMPRESSOR
+redo-ifchange ../utils/git-with-submodules-to-tarball
+../utils/git-with-submodules-to-tarball mupdf \
+    https://github.com/ArtifexSoftware/mupdf.git \
+    73d3100d46d8a9ad634f6ef035bbe78f0f947886 \
+    ${1%.tar.zst}
index 2cdbf7cc1cc447f10d4de591cfb850c90514b44aa59f46798ed072053f77b8cf..8a93bb75623c6b8309196230a34883ed4e86931b0d3f50452ce3923f9f94c630 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/nfdump.git ] ||
-git clone --depth 1 --bare https://github.com/phaag/nfdump.git "$DISTFILES"/repo/nfdump.git >&2
-cd "$DISTFILES"/repo/nfdump.git
-commit=96ebd8f30862162a97978861634bd55eec30c5ba
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball nfdump \
+    https://github.com/phaag/nfdump.git \
+    96ebd8f30862162a97978861634bd55eec30c5ba \
+    ${1%.tar.zst}
index 7505aa73e7b7c3e0d6e337cdc5ab06f8fe70e47e5d6c25c3167afd62df6c5c52..a2edbd7c8f669310bd4f5b864eb15c9f1d0bc2bfd945f8be232a18ee51213ef2 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/ninja.git ] ||
-git clone --depth 1 --bare https://github.com/ninja-build/ninja.git "$DISTFILES"/repo/ninja.git >&2
-cd "$DISTFILES"/repo/ninja.git
-commit=2daa09ba270b0a43e1929d29b073348aa985dfaa
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball ninja \
+    https://github.com/ninja-build/ninja.git \
+    2daa09ba270b0a43e1929d29b073348aa985dfaa \
+    ${1%.tar.zst}
index 87755243f73d90d86a8cc187ba7ca9762a2f3d3813ba1dc99b652236f8f4cdac..953667670976ffb202e29e94f52ad4934affe89cccdf4b1f190a4870aa0975ad 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/nsxiv.git ] ||
-git clone --depth 1 --bare https://github.com/nsxiv/nsxiv.git "$DISTFILES"/repo/nsxiv.git >&2
-cd "$DISTFILES"/repo/nsxiv.git
-commit=420a0a245591ea73f86ebfb90de207a8e67e6cca
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball nsxiv \
+    https://github.com/nsxiv/nsxiv.git \
+    420a0a245591ea73f86ebfb90de207a8e67e6cca \
+    ${1%.tar.zst}
index 5b83014e1b068f8bb899dfb5823324ced5f569dd70f15af4ffc30ee14df3f3a4..e5d33cb0b14e7c937f06c081f60492d80f8a8294862a51dba24f43626b0ed3e9 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/oneTBB.git ] ||
-git clone --depth 1 --bare https://github.com/uxlfoundation/oneTBB.git "$DISTFILES"/repo/oneTBB.git >&2
-cd "$DISTFILES"/repo/oneTBB.git
-commit=0c0ff192a2304e114bc9e6557582dfba101360ff
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball oneTBB \
+    https://github.com/uxlfoundation/oneTBB.git \
+    0c0ff192a2304e114bc9e6557582dfba101360ff \
+    ${1%.tar.zst}
index ae1b02d8882e101111368861653fcdc038772231ddfd6d50c93584c771776fce..94ba9bdbea12fdc571fda8b638b0db1c5c128fbd77983e3d164d91b8a53acf96 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/oniguruma.git ] ||
-git clone --depth 1 --bare https://github.com/kkos/oniguruma.git "$DISTFILES"/repo/oniguruma.git >&2
-cd "$DISTFILES"/repo/oniguruma.git
-commit=e62a8e5ec123bb91651d297e6f72c84d53e3cff8
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball oniguruma \
+    https://github.com/kkos/oniguruma.git \
+    e62a8e5ec123bb91651d297e6f72c84d53e3cff8 \
+    ${1%.tar.zst}
index 5640580553b2fb694000f87b674e1f4142b77d7ab62e77200579144ce6aa6abd..77e3b81ffd38cc409143b646ab6002432a10e2e7d0b4ca2b3b782bea33c0a8f6 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/sdcv.git ] ||
-git clone --depth 1 --bare https://github.com/Dushistov/sdcv.git "$DISTFILES"/repo/sdcv.git >&2
-cd "$DISTFILES"/repo/sdcv.git
-commit=49c8094b53b7dd90efeabeaf276752a650a0f931
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball sdcv \
+    https://github.com/Dushistov/sdcv.git \
+    49c8094b53b7dd90efeabeaf276752a650a0f931 \
+    ${1%.tar.zst}
index 531821e6e087899a90a141474295dbf68a062654fd5e9bab56f4b53588601338..8a77eda5fc43335397ac73b3d1110a4acff6196bcc02bd635d74a46cb1960116 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/shared-mime-info.git ] ||
-git clone --depth 1 --bare https://gitlab.freedesktop.org/xdg/shared-mime-info.git "$DISTFILES"/repo/shared-mime-info.git >&2
-cd "$DISTFILES"/repo/shared-mime-info.git
-commit=13695c7225c2f525a435e72739c33ac32bbfbbb9
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball shared-mime-info \
+    https://gitlab.freedesktop.org/xdg/shared-mime-info.git \
+    13695c7225c2f525a435e72739c33ac32bbfbbb9 \
+    ${1%.tar.zst}
index 0ff11398bafb7933918d9a99896e8f779d67c152e6b3b2b2e933480987ef9586..b0bee78db839ec61fded14ba7fb2df22bf53e0b7dd6a76f6c582180b9c0abbc7 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/svt-av1.git ] ||
-git clone --depth 1 --bare https://gitlab.com/AOMediaCodec/SVT-AV1.git svt-av1.git "$DISTFILES"/repo/svt-av1.git >&2
-cd "$DISTFILES"/repo/svt-av1.git
-commit=4ae9272b588a05ee6e77a43e8dfdac05f54c4ff0
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball svt-av1 \
+    https://gitlab.com/AOMediaCodec/SVT-AV1.git \
+    4ae9272b588a05ee6e77a43e8dfdac05f54c4ff0 \
+    ${1%.tar.zst}
index 5706025327514cb03b355064288be94d6525429a0d116970fe5c44875628bd7e..6d5370064b5744900d238c9d5f7d96cfcab2d74efdc2cd26683218916a58cb7e 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/sxhkd.git ] ||
-git clone --depth 1 --bare https://github.com/baskerville/sxhkd.git "$DISTFILES"/repo/sxhkd.git >&2
-cd "$DISTFILES"/repo/sxhkd.git
-commit=b0923b6b3d5d85b1ff80a5bb286934b8721a7c08
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball sxhkd \
+    https://github.com/baskerville/sxhkd.git \
+    b0923b6b3d5d85b1ff80a5bb286934b8721a7c08 \
+    ${1%.tar.zst}
index 7e7ee7ea15eb0598313d246a29204d41d24a023958a4b25a0a9ef0c67bab348b..1d160aacffc439cc77c0b7f2b336319ca82daa9d0cf7cfd366fd7bf7adf092d5 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/vim.git ] ||
-git clone --depth 1 --bare https://github.com/vim/vim.git "$DISTFILES"/repo/vim.git >&2
-cd "$DISTFILES"/repo/vim.git
-commit=9b514fcc1edfaea20e05badd746f98dfb25ca1a7
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball vim \
+    https://github.com/vim/vim.git \
+    9b514fcc1edfaea20e05badd746f98dfb25ca1a7 \
+    ${1%.tar.zst}
index 97e4d59981a3430884d7d9b2eaf13c850a2dc82d627a53976e9ea1513ad7fa57..3512a9adae0c33139322972afe9bede10db1f588428e345f27078c2f26b095be 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/voxtral.c.git ] ||
-git clone --depth 1 --bare https://github.com/antirez/voxtral.c.git "$DISTFILES"/repo/voxtral.c.git >&2
-cd "$DISTFILES"/repo/voxtral.c.git
-commit=c9e8773a2042d67c637fc492c8a655c485354080
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball voxtral.c \
+    https://github.com/antirez/voxtral.c.git \
+    c9e8773a2042d67c637fc492c8a655c485354080 \
+    ${1%.tar.zst}
index ea584be1d7c314ed9c3910a15ea332d77ccf1c81ae84d250a0075d16fcc634da..de853f1f058fd1b554abfe0c36121213e43789c3dda916bcea0cb55a0743d36f 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/whisper.cpp.git ] ||
-git clone --depth 1 --bare https://github.com/ggerganov/whisper.cpp "$DISTFILES"/repo/whisper.cpp.git >&2
-cd "$DISTFILES"/repo/whisper.cpp.git
-commit=2eeeba56e9edd762b4b38467bab96c2517163158
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball whisper.cpp \
+    https://github.com/ggerganov/whisper.cpp \
+    2eeeba56e9edd762b4b38467bab96c2517163158 \
+    ${1%.tar.zst}
index 0325b23317920d63b8e8a976098983843b41d294b64805ed19a3751156b1388f..f2499013ea109746f6b80e1c23525039dbf18bcb3131e667f05dbe22ca40594b 100644 (file)
@@ -1,8 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/x264.git ] ||
-git clone --depth 1 --bare https://code.videolan.org/videolan/x264.git "$DISTFILES"/repo/x264.git >&2
-cd "$DISTFILES"/repo/x264.git
-commit=4613ac3c15fd75cebc4b9f65b7fb95e70a3acce1
-git fetch origin $commit >&2
-git archive --prefix=${1%.tar.zst}/ $commit | $COMPRESSOR
+redo-ifchange ../utils/git-to-tarball
+../utils/git-to-tarball x264 \
+    https://code.videolan.org/videolan/x264.git \
+    4613ac3c15fd75cebc4b9f65b7fb95e70a3acce1 \
+    ${1%.tar.zst}
index a5e1a6878ae71e19b873d17177491c3998692e3212325780a2b65f527adec9c6..76645893e81b13b5bd737d3677e290345c57f6a8fdbe931819ef07c0003bc59b 100644 (file)
@@ -1,14 +1,5 @@
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
-sname=$1.do . "$BASS_ROOT"/lib/rc
-[ -d "$DISTFILES"/repo/zimg ] ||
-git clone --depth 1 https://github.com/sekrit-twc/zimg.git "$DISTFILES"/repo/zimg >&2
-cd "$DISTFILES"/repo/zimg
-commit=0e56801f98db3e363c974fca794fa06022d40ee4
-git fetch origin $commit >&2
-git checkout $commit >&2
-git submodule update --init --recursive >&2
-dir=${1%.tar.zst}
-{
-    git archive --prefix=$dir/ @
-    git submodule --quiet foreach 'git archive --prefix='$dir'/$sm_path/ @'
-} | $COMPRESSOR
+redo-ifchange ../utils/git-with-submodules-to-tarball
+../utils/git-with-submodules-to-tarball zimg \
+    https://github.com/sekrit-twc/zimg.git \
+    0e56801f98db3e363c974fca794fa06022d40ee4 \
+    ${1%.tar.zst}
diff --git a/build/distfiles/utils/git-to-tarball b/build/distfiles/utils/git-to-tarball
new file mode 100755 (executable)
index 0000000..317016d
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+
+[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
+sname=$0 . "$BASS_ROOT"/lib/rc
+
+name=$1
+url=$2
+commit=$3
+prefix=$4
+[ -n "$name" ]
+[ -n "$url" ]
+[ -n "$commit" ]
+
+[ -d "$DISTFILES"/repo/$name.git ] ||
+git clone --depth 1 --bare $url "$DISTFILES"/repo/$name.git >&2
+cd "$DISTFILES"/repo/$name.git
+git cat-file -e $commit || git fetch origin $commit >&2
+git fsck $commit >&2
+git archive --prefix=$prefix/ $commit | $COMPRESSOR
diff --git a/build/distfiles/utils/git-with-submodules-to-tarball b/build/distfiles/utils/git-with-submodules-to-tarball
new file mode 100755 (executable)
index 0000000..2b1a236
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh -e
+
+[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
+sname=$0 . "$BASS_ROOT"/lib/rc
+
+name=$1
+url=$2
+commit=$3
+prefix=$4
+[ -n "$name" ]
+[ -n "$url" ]
+[ -n "$commit" ]
+
+[ -d "$DISTFILES"/repo/$name ] ||
+git clone --depth 1 $url "$DISTFILES"/repo/$name >&2
+cd "$DISTFILES"/repo/$name
+git cat-file -e $commit || git fetch origin $commit >&2
+git fsck $commit >&2
+git checkout --force $commit >&2
+git submodule update --init --recursive >&2
+{
+    git archive --prefix=$prefix/ @
+    git submodule --quiet foreach 'git archive --prefix='$prefix'/$sm_path/ @'
+} | $COMPRESSOR