forked from mirrors/nixpkgs
To make updating large attribute sets faster, the update scripts are now run in parallel. Please note the following changes in semantics: - The string passed to updateScript needs to be a path to an executable file. - The updateScript can also be a list: the tail elements will then be passed to the head as command line arguments.
13 lines
539 B
Nix
13 lines
539 B
Nix
{ stdenv, lib, writeScript, python3, common-updater-scripts, coreutils, gnugrep, gnused }:
|
|
{ packageName, attrPath ? packageName, versionPolicy ? "odd-unstable" }:
|
|
|
|
let
|
|
python = python3.withPackages (p: [ p.requests ]);
|
|
in writeScript "update-${packageName}" ''
|
|
#!${stdenv.shell}
|
|
set -o errexit
|
|
PATH=${lib.makeBinPath [ common-updater-scripts coreutils gnugrep gnused python ]}
|
|
latest_tag=$(python "${./find-latest-version.py}" "${packageName}" "${versionPolicy}" "stable")
|
|
update-source-version "${attrPath}" "$latest_tag"
|
|
''
|