From 7c865ddd46df7fe8ad6c4d79d1a8373faeb04081 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 16 Oct 2025 13:07:18 +0200 Subject: [PATCH] ci/eval/compare/maintainers: refactor path matching The only reason for the additional `lib.hasSuffix` check was, that the `lib.removePrefix` was broken - it was never adjusted when porting this from ofborg, so the relative path was wrong and no prefix ever removed, since no packages are in `ci/`. This additionally strips the leading `/`, so that `relevantFilenames` will then have paths starting with `pkgs/...`, similar to how git reports those paths in the `changedpathsjson` file. This allows simple equality comparison. --- ci/eval/compare/maintainers.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/eval/compare/maintainers.nix b/ci/eval/compare/maintainers.nix index 31cadedcde7f..8aacf2f6d644 100644 --- a/ci/eval/compare/maintainers.nix +++ b/ci/eval/compare/maintainers.nix @@ -11,7 +11,7 @@ let changedpaths = lib.importJSON changedpathsjson; - anyMatchingFile = filename: lib.any (changed: lib.hasSuffix changed filename) changedpaths; + anyMatchingFile = filename: lib.any (changed: changed == filename) changedpaths; anyMatchingFiles = files: lib.any anyMatchingFile files; @@ -40,7 +40,7 @@ let relevantFilenames = drv: (lib.unique ( - map (pos: lib.removePrefix (toString ../..) pos.file) ( + map (pos: lib.removePrefix "${toString ../../..}/" pos.file) ( lib.filter (x: x != null) [ (drv.meta.maintainersPosition or null) (drv.meta.teamsPosition or null)