From 07189450298cb4959e92c29dfaad45f0a285f2d2 Mon Sep 17 00:00:00 2001 From: Bet4 <0xbet4@gmail.com> Date: Tue, 7 Jul 2026 16:52:31 +0800 Subject: [PATCH] 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. --- pkgs/by-name/xf/xfstests/package.nix | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/xf/xfstests/package.nix b/pkgs/by-name/xf/xfstests/package.nix index 4e44bce33c87..6e18aa424a10 100644 --- a/pkgs/by-name/xf/xfstests/package.nix +++ b/pkgs/by-name/xf/xfstests/package.nix @@ -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";