Skip to content

common-updater: add update script to all-packages #85304

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

Merged
merged 2 commits into from
Apr 16, 2020
Merged

common-updater: add update script to all-packages #85304

merged 2 commits into from
Apr 16, 2020

Conversation

romildo
Copy link
Contributor

@romildo romildo commented Apr 15, 2020

Motivation for this change
  • common-updater: add update script to all-packages
  • xfce: use updateScript from pkgs

See also #84292.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@ofborg ofborg bot added 6.topic: xfce The Xfce Desktop Environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Apr 15, 2020
@jtojnar
Copy link
Member

jtojnar commented Apr 15, 2020

Why not just use common-updater-scripts?

@romildo
Copy link
Contributor Author

romildo commented Apr 15, 2020

Why not just use common-updater-scripts?

common-updater-script is lower level. It does not help looking for newer versions at upstream. The new version should be passed as a command line argument.

update-script.nix is capable of searching for available versions upstream. Internally it calls common-updater-script, though.

It can be used in a derivation like this:

  passthru.updateScript = pkgs.updateScript {
    inherit pname version;
    attrPath = "xfce.${pname}";
    versionLister = xfce.archiveLister category pname;
  };
  passthru.updateScript = pkgs.updateScript {
    inherit pname version;
    attrPath = "xfce.thunar-dropbox-plugin";
    versionLister = xfce.gitLister src.meta.homepage;
  };
  passthru.updateScript = pkgs.updateScript {
    inherit pname version;
    versionLister = "${pkgs.common-updater-scripts}/bin/list-git-tags ${sr.meta.homepage}";
    odd-unstable = true;
  };

@jtojnar
Copy link
Member

jtojnar commented Apr 15, 2020

That is very nice. Though maybe a name like genericUpdateScript or genericUpdater might be better to avoid name clashes.

romildo added 2 commits April 15, 2020 23:02

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@romildo
Copy link
Contributor Author

romildo commented Apr 16, 2020

That is very nice. Though maybe a name like genericUpdateScript or genericUpdater might be better to avoid name clashes.

Changed the name to genericUpdater.

@romildo romildo merged commit 4b596ca into NixOS:master Apr 16, 2020
@romildo romildo deleted the common-updater branch April 16, 2020 11:05
@jtojnar jtojnar mentioned this pull request Aug 28, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: xfce The Xfce Desktop Environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants