about summary refs log tree commit diff
path: root/nixpkgs/maintainers/scripts/update.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/maintainers/scripts/update.nix')
-rwxr-xr-xnixpkgs/maintainers/scripts/update.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/nixpkgs/maintainers/scripts/update.nix b/nixpkgs/maintainers/scripts/update.nix
index 1a2f06c73a2c..3aff32caf581 100755
--- a/nixpkgs/maintainers/scripts/update.nix
+++ b/nixpkgs/maintainers/scripts/update.nix
@@ -1,3 +1,10 @@
+/*
+  To run:
+
+      nix-shell maintainers/scripts/update.nix
+
+  See https://nixos.org/manual/nixpkgs/unstable/#var-passthru-updateScript
+*/
 { package ? null
 , maintainer ? null
 , predicate ? null
@@ -8,8 +15,6 @@
 , commit ? null
 }:
 
-# TODO: add assert statements
-
 let
   pkgs = import ./../../default.nix (
     if include-overlays == false then
@@ -48,7 +53,17 @@ let
         let
           result = builtins.tryEval pathContent;
 
-          dedupResults = lst: nubOn ({ package, attrPath }: package.updateScript) (lib.concatLists lst);
+          somewhatUniqueRepresentant =
+            { package, attrPath }: {
+              inherit (package) updateScript;
+              # Some updaters use the same `updateScript` value for all packages.
+              # Also compare `meta.description`.
+              position = package.meta.position or null;
+              # We cannot always use `meta.position` since it might not be available
+              # or it might be shared among multiple packages.
+            };
+
+          dedupResults = lst: nubOn somewhatUniqueRepresentant (lib.concatLists lst);
         in
           if result.success then
             let