gnome3.updateScript: reuse gnome-update-script

This commit is contained in:
Jan Tojnar 2018-12-02 00:50:37 +01:00
parent 59a94b57f0
commit 30f090ff7b
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4

View file

@ -3,10 +3,14 @@
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"
''
updateScript = writeScript "gnome-update-script" ''
#!${stdenv.shell}
set -o errexit
package_name="$1"
attr_path="$2"
version_policy="$3"
PATH=${lib.makeBinPath [ common-updater-scripts coreutils gnugrep gnused python ]}
latest_tag=$(python "${./find-latest-version.py}" "$package_name" "$version_policy" "stable")
update-source-version "$attr_path" "$latest_tag"
'';
in [ updateScript packageName attrPath versionPolicy ]