-
-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gnome3.updateScript: Add freeze functionality
On stable releases, we will want to change the freeze parameter in pkgs/desktops/gnome-3/update.nix to true to limit the gnome update script to only bump patch versions.
- Loading branch information
Showing
2 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
{ stdenv, lib, writeScript, python3, common-updater-scripts }: | ||
{ packageName, attrPath ? packageName, versionPolicy ? "odd-unstable" }: | ||
{ stdenv, pkgs, lib, writeScript, python3, common-updater-scripts }: | ||
{ packageName, attrPath ? packageName, versionPolicy ? "odd-unstable", freeze ? false }: | ||
|
||
let | ||
python = python3.withPackages (p: [ p.requests ]); | ||
upperBoundFlag = | ||
let | ||
package = lib.getAttrFromPath (lib.splitString "." attrPath) pkgs; | ||
packageVersion = lib.getVersion package; | ||
versionComponents = lib.versions.splitVersion packageVersion; | ||
minorVersion = lib.versions.minor packageVersion; | ||
minorAvailable = builtins.length versionComponents > 1 && builtins.match "[0-9]+" minorVersion != null; | ||
nextMinor = builtins.fromJSON minorVersion + 1; | ||
upperBound = "${lib.versions.major packageVersion}.${builtins.toString nextMinor}"; | ||
in lib.optionalString (minorAvailable && freeze) ''--upper-bound="${upperBound}"''; | ||
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 python ]} | ||
latest_tag=$(python "${./find-latest-version.py}" "$package_name" "$version_policy" "stable") | ||
latest_tag=$(python "${./find-latest-version.py}" "$package_name" "$version_policy" "stable" ${upperBoundFlag}) | ||
update-source-version "$attr_path" "$latest_tag" | ||
''; | ||
in [ updateScript packageName attrPath versionPolicy ] |
974f11c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes issues for the tarball job, as apparently multiple packages don't call this with correct
attrPath
. Example: https://hydra.nixos.org/build/117588120/nixlog/1/tail@jtojnar: I wonder, perhaps we don't want block on these, so instead let's only
throw
a message when theattrPath
doesn't exist?974f11c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, should be fixed in 03c0ab3 and f544c29.
974f11c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. I confirm the build is fixed now.