Unverified Commit 7c865ddd authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

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.
parent 79029e39
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)