xfstests: fix updateScript for git.kernel.org

Replace nix-update-script with a custom updateScript that uses
git ls-remote --tags --refs to detect the latest version from
git.kernel.org, since nix-update cannot auto-detect versions from
this host (it only supports GitHub/GitLab/PyPI/npm etc.).

The custom script follows the same pattern used by the mailcap
package for its pagure.io hosting.
This commit is contained in:
Bet4
2026-07-07 16:52:31 +08:00
parent e1ccc765c9
commit 0718945029
+21 -2
View File
@@ -29,8 +29,10 @@
util-linux,
which,
writeScript,
writeShellScript,
xfsprogs,
nix-update-script,
gitMinimal,
nix-update,
runtimeShell,
}:
@@ -157,7 +159,24 @@ stdenv.mkDerivation (finalAttrs: {
}:$PATH
exec ./check "$@"
'';
passthru.updateScript = nix-update-script { };
passthru.updateScript = writeShellScript "update-xfstests" ''
set -euo pipefail
export PATH=${
lib.makeBinPath [
coreutils
gitMinimal
gawk
nix-update
]
}:$PATH
VERSION="$(git ls-remote --tags --refs https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git \
| awk '{ print $2 }' \
| grep '^refs/tags/v' \
| sed 's|^refs/tags/v||' \
| sort -V \
| tail -n1)"
exec nix-update --version "$VERSION" xfstests "$@"
'';
meta = {
description = "Torture test suite for filesystems";