maintainers/scripts/update.nix: allow updating package collections

+16 -1
+16 -1
maintainers/scripts/update.nix
··· 1 1 { package ? null 2 2 , maintainer ? null 3 + , path ? null 3 4 }: 4 5 5 6 # TODO: add assert statements ··· 49 50 (name: pkg: pkg) 50 51 pkgs; 51 52 53 + packagesWithUpdateScript = path: 54 + let 55 + attrSet = pkgs.lib.attrByPath (pkgs.lib.splitString "." path) null pkgs; 56 + in 57 + packagesWith (name: pkg: builtins.hasAttr "updateScript" pkg) 58 + (name: pkg: pkg) 59 + attrSet; 60 + 52 61 packageByName = name: 53 62 let 54 63 package = pkgs.lib.attrByPath (pkgs.lib.splitString "." name) null pkgs; ··· 65 74 [ (packageByName package) ] 66 75 else if maintainer != null then 67 76 packagesWithUpdateScriptAndMaintainer maintainer 77 + else if path != null then 78 + packagesWithUpdateScript path 68 79 else 69 80 builtins.throw "No arguments provided.\n\n${helpText}"; 70 81 ··· 78 89 79 90 % nix-shell maintainers/scripts/update.nix --argstr package garbas 80 91 81 - to run update script for specific package. 92 + to run update script for specific package, or 93 + 94 + % nix-shell maintainers/scripts/update.nix --argstr path gnome3 95 + 96 + to run update script for all package under an attribute path. 82 97 ''; 83 98 84 99 runUpdateScript = package: ''