2019-06-02 08:40:55 +01:00
|
|
|
{ stdenv, lib, writeScript, python3, common-updater-scripts }:
|
2017-12-25 09:46:52 +00:00
|
|
|
{ packageName, attrPath ? packageName, versionPolicy ? "odd-unstable" }:
|
|
|
|
|
|
|
|
let
|
|
|
|
python = python3.withPackages (p: [ p.requests ]);
|
2018-12-01 23:50:37 +00:00
|
|
|
updateScript = writeScript "gnome-update-script" ''
|
|
|
|
#!${stdenv.shell}
|
|
|
|
set -o errexit
|
|
|
|
package_name="$1"
|
|
|
|
attr_path="$2"
|
|
|
|
version_policy="$3"
|
2019-06-02 08:40:55 +01:00
|
|
|
PATH=${lib.makeBinPath [ common-updater-scripts python ]}
|
2018-12-01 23:50:37 +00:00
|
|
|
latest_tag=$(python "${./find-latest-version.py}" "$package_name" "$version_policy" "stable")
|
|
|
|
update-source-version "$attr_path" "$latest_tag"
|
|
|
|
'';
|
|
|
|
in [ updateScript packageName attrPath versionPolicy ]
|