-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xfce: add update script #84292
xfce: add update script #84292
Conversation
The script does not work yet because it fails to correctly find the file (usually |
nix-shell maintainers/scripts/update.nix --argstr path xfce.thunar
|
@romildo This isn't optimal, we should really make diff --git a/pkgs/desktops/xfce/mkXfceDerivation.nix b/pkgs/desktops/xfce/mkXfceDerivation.nix
index b7dc8322569..3f38ecedb53 100644
--- a/pkgs/desktops/xfce/mkXfceDerivation.nix
+++ b/pkgs/desktops/xfce/mkXfceDerivation.nix
@@ -31,6 +31,7 @@ let
homepage = "https://git.xfce.org/${category}/${pname}/about";
license = licenses.gpl2; # some libraries are under LGPLv2+
platforms = platforms.linux;
+ pos = builtins.unsafeGetAttrPos "pname" args;
};
};
|
It should probably make nixpkgs-update work as well. |
The update script is functional now. It is able to update packages from the xfce git server, from github, and from the xfce archive site. All Xfce packages has an update script, except the following:
|
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.
Currently running update.nix will generate a .drv per package. That isn't very fast.
If you make update.nix
return a list we can avoid this.
Look how gnome3's update script takes all the arguments the nix expression needs:
package_name="$1"
and then puts them into a list:
nixpkgs/pkgs/desktops/gnome-3/update.nix
Line 16 in e41a9d2
in [ updateScript packageName attrPath versionPolicy ]
now it will just have a list of commands to run.
Done. |
This updater can be made general enough to work for several other packages. It basically does the following:
Arguments may be used to parameterize the updater with options that would allow for instance choosing the method of collecting source versions, transforming the version, or checking if a version is unstable. The updater could be moved to @worldofpeace what is your opinion on this? |
The update scripts have been moved to |
With this changes one can use Besides changing the nix expressions, it will output the file $ cat update-git-commits.txt
|
@romildo I think in nixpkgs and the esosystem alone there's a lot of updaters in nixpkgs and outside it. And new one's being written https://github.com/Mic92/nix-update (I even have one for the packages I maintain https://github.com/NixOS/nixpkgs/tree/master/pkgs/desktops/pantheon/nixpkgs_github_update). So I'm a bit disillusioned by how many there are, I personally wish I didn't make "yet another". Though I do think if there was something documented in the manual for a "default" updateScript that nixpkgs contributors could use, it would be a good improvement. |
Would you want to add that file to git's ignores? |
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.
Everything seems fine to me. But I'm not sure about adding updateScript
to all-packages.nix
only because it feels a bit "forcing" to me. I feel like a separate PR would be a better place for that.
@worldofpeace do you mean a separate PR only for the changes in |
- updateScript: A nix expression that can be used in passThrough to update a package - list-git-tags: A shell script to list available tags in a git repository - list-archive-two-level-versions: A shell script to list available versions in a web site in two levels: there is a page listing the available major.minor versions, and for each of them there is another page listings the patch level versions major.minor.patch. It is suitable for Xfce packages for instance. How the updater works: 1. collect the available versions from the source repository (using a script given as argument) 2. print the collected versions (for debugging) 3. (optionally) apply some transformation to the collected versions to make them compatible with the versions used in nixpkgs (for instance, tags in the Xfce git repository may be prefixed with the package name, and the prefix need to be removed) 4. sort the available versions in decreasing order 5. choose the first version that pass validation: - check if the version may be a development version - if the version IS unstable, skip it and give a warning about skipping a development version (for debugging) - if the version COULD BE unstable, take it and give a warning about taking a potential development version (for debugging) - if the version IS stable, take it 6. update the package version and checksum in its nix expression 7. print the git commands for adding the modified files and for committing the changes
It is generated by common-updater/update-script.nix
This PR is not adding |
Motivation for this change
Do not merge yet. This is a working in progress.Add an update script to Xfce.
Fixes #81568.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)