Commit 6403eb8f authored by Jan Tojnar's avatar Jan Tojnar
Browse files

_experimental-update-script-combinators.sequence: Loosen attrPath constraint

We only allow a single value for `attrPath` across all sequenced update scripts.
But previously `null` (representing `passthru.updateScript.attrPath` not being defined) was counted as one value.
This would prevent us from explicitly specifying `attrPath` in `gnome.updateScript` in the next commit.

Let’s ignore update scripts without specified `attrPath` attribute for the purpose of this check.
parent f54d20c3
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -169,9 +169,11 @@ rec {

    assert lib.assertMsg (lib.all validateFeatures scripts)
      "Combining update scripts with features enabled (other than “silent” scripts and an optional single script with “commit”) is currently unsupported.";

    assert lib.assertMsg (
      builtins.length (
        lib.unique (
          builtins.filter (attrPath: attrPath != null) (
            builtins.map (
              {
                attrPath ? null,
@@ -180,7 +182,8 @@ rec {
              attrPath
            ) scripts
          )
      ) == 1
        )
      ) <= 1
    ) "Combining update scripts with different attr paths is currently unsupported.";

    {