gnome.updateScript: Use experimental support for custom commit messages
This commit is contained in:
@@ -147,7 +147,7 @@ let
|
|||||||
|
|
||||||
to run update script for specific package, or
|
to run update script for specific package, or
|
||||||
|
|
||||||
% nix-shell maintainers/scripts/update.nix --arg predicate '(path: pkg: builtins.isList pkg.updateScript && builtins.length pkg.updateScript >= 1 && (let script = builtins.head pkg.updateScript; in builtins.isAttrs script && script.name == "gnome-update-script"))'
|
% nix-shell maintainers/scripts/update.nix --arg predicate '(path: pkg: pkg.updateScript.name or null == "gnome-update-script")'
|
||||||
|
|
||||||
to run update script for all packages matching given predicate, or
|
to run update script for all packages matching given predicate, or
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
python = python3.withPackages (p: [ p.requests p.libversion ]);
|
python = python3.withPackages (p: [ p.requests p.libversion ]);
|
||||||
|
package = lib.attrByPath (lib.splitString "." attrPath) (throw "Cannot find attribute ‘${attrPath}’.") pkgs;
|
||||||
|
packageVersion = lib.getVersion package;
|
||||||
upperBoundFlag =
|
upperBoundFlag =
|
||||||
let
|
let
|
||||||
package = lib.attrByPath (lib.splitString "." attrPath) (throw "Cannot find attribute ‘${attrPath}’.") pkgs;
|
|
||||||
packageVersion = lib.getVersion package;
|
|
||||||
versionComponents = lib.versions.splitVersion packageVersion;
|
versionComponents = lib.versions.splitVersion packageVersion;
|
||||||
minorVersion = lib.versions.minor packageVersion;
|
minorVersion = lib.versions.minor packageVersion;
|
||||||
minorAvailable = builtins.length versionComponents > 1 && builtins.match "[0-9]+" minorVersion != null;
|
minorAvailable = builtins.length versionComponents > 1 && builtins.match "[0-9]+" minorVersion != null;
|
||||||
@@ -16,11 +16,19 @@ let
|
|||||||
updateScript = writeScript "gnome-update-script" ''
|
updateScript = writeScript "gnome-update-script" ''
|
||||||
#!${stdenv.shell}
|
#!${stdenv.shell}
|
||||||
set -o errexit
|
set -o errexit
|
||||||
package_name="$1"
|
attr_path="$1"
|
||||||
attr_path="$2"
|
package_name="$2"
|
||||||
version_policy="$3"
|
package_version="$3"
|
||||||
|
version_policy="$4"
|
||||||
PATH=${lib.makeBinPath [ common-updater-scripts python ]}
|
PATH=${lib.makeBinPath [ common-updater-scripts python ]}
|
||||||
latest_tag=$(python "${./find-latest-version.py}" "$package_name" "$version_policy" "stable" ${upperBoundFlag})
|
latest_tag=$(python "${./find-latest-version.py}" "$package_name" "$version_policy" "stable" ${upperBoundFlag})
|
||||||
update-source-version "$attr_path" "$latest_tag"
|
update-source-version "$attr_path" "$latest_tag"
|
||||||
|
echo '[ { "commitBody": "https://gitlab.gnome.org/GNOME/'$package_name'/-/compare/'$package_version'...'$latest_tag'" } ]'
|
||||||
'';
|
'';
|
||||||
in [ updateScript packageName attrPath versionPolicy ]
|
in {
|
||||||
|
name = "gnome-update-script";
|
||||||
|
command = [ updateScript attrPath packageName packageVersion versionPolicy ];
|
||||||
|
supportedFeatures = [
|
||||||
|
"commit"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user