diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2018-11-23 18:03:19 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2018-12-01 19:17:13 +0100 |
commit | 59a94b57f07594f4544896dd90c71a948d1ea089 (patch) | |
tree | ec17df5cba0961e72295e3c38c1a75a95f6f838f /doc/stdenv.xml | |
parent | 7a9acea944d96de52f8c08faab75582af9f27a61 (diff) |
update.nix: Run update scripts in parallel
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.
Diffstat (limited to 'doc/stdenv.xml')
-rw-r--r-- | doc/stdenv.xml | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 208b5e9cf3029..a90a377b3f26c 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -671,6 +671,43 @@ passthru = { </para> </listitem> </varlistentry> + <varlistentry> + <term> + <varname>passthru.updateScript</varname> + </term> + <listitem> + <para> + A script to be run by <filename>maintainers/scripts/update.nix</filename> when + the package is matched. It needs to be an executable file, either on the file + system: +<programlisting> +passthru.updateScript = ./update.sh; +</programlisting> + or inside the expression itself: +<programlisting> +passthru.updateScript = writeScript "update-zoom-us" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl pcre common-updater-scripts + + set -eu -o pipefail + + version="$(curl -sI https://zoom.us/client/latest/zoom_x86_64.tar.xz | grep -Fi 'Location:' | pcregrep -o1 '/(([0-9]\.?)+)/')" + update-source-version zoom-us "$version" +''; +</programlisting> + The attribute can also contain a list, a script followed by arguments to be passed to it: +<programlisting> +passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]; +</programlisting> + Note that the update scripts will be run in parallel by default; you should avoid running <command>git commit</command> or any other commands that cannot handle that. + </para> + + <para> + For information about how to run the updates, execute + <cmdsynopsis><command>nix-shell</command> <arg>maintainers/scripts/update.nix</arg></cmdsynopsis>. + </para> + </listitem> + </varlistentry> </variablelist> </section> <section xml:id="sec-stdenv-phases"> |