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.
This commit is contained in:
Wolfgang Walther
2025-10-17 16:37:04 +02:00
parent 79029e39a4
commit 7c865ddd46
+2 -2
View File
@@ -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)