maintainers/scripts/update.nix: allow updating package collections
This commit is contained in:
parent
f929f38d5e
commit
cb5c630db2
|
@ -1,5 +1,6 @@
|
||||||
{ package ? null
|
{ package ? null
|
||||||
, maintainer ? null
|
, maintainer ? null
|
||||||
|
, path ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# TODO: add assert statements
|
# TODO: add assert statements
|
||||||
|
@ -49,6 +50,14 @@ let
|
||||||
(name: pkg: pkg)
|
(name: pkg: pkg)
|
||||||
pkgs;
|
pkgs;
|
||||||
|
|
||||||
|
packagesWithUpdateScript = path:
|
||||||
|
let
|
||||||
|
attrSet = pkgs.lib.attrByPath (pkgs.lib.splitString "." path) null pkgs;
|
||||||
|
in
|
||||||
|
packagesWith (name: pkg: builtins.hasAttr "updateScript" pkg)
|
||||||
|
(name: pkg: pkg)
|
||||||
|
attrSet;
|
||||||
|
|
||||||
packageByName = name:
|
packageByName = name:
|
||||||
let
|
let
|
||||||
package = pkgs.lib.attrByPath (pkgs.lib.splitString "." name) null pkgs;
|
package = pkgs.lib.attrByPath (pkgs.lib.splitString "." name) null pkgs;
|
||||||
|
@ -65,6 +74,8 @@ let
|
||||||
[ (packageByName package) ]
|
[ (packageByName package) ]
|
||||||
else if maintainer != null then
|
else if maintainer != null then
|
||||||
packagesWithUpdateScriptAndMaintainer maintainer
|
packagesWithUpdateScriptAndMaintainer maintainer
|
||||||
|
else if path != null then
|
||||||
|
packagesWithUpdateScript path
|
||||||
else
|
else
|
||||||
builtins.throw "No arguments provided.\n\n${helpText}";
|
builtins.throw "No arguments provided.\n\n${helpText}";
|
||||||
|
|
||||||
|
@ -78,7 +89,11 @@ let
|
||||||
|
|
||||||
% nix-shell maintainers/scripts/update.nix --argstr package garbas
|
% nix-shell maintainers/scripts/update.nix --argstr package garbas
|
||||||
|
|
||||||
to run update script for specific package.
|
to run update script for specific package, or
|
||||||
|
|
||||||
|
% nix-shell maintainers/scripts/update.nix --argstr path gnome3
|
||||||
|
|
||||||
|
to run update script for all package under an attribute path.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
runUpdateScript = package: ''
|
runUpdateScript = package: ''
|
||||||
|
|
Loading…
Reference in a new issue