summary refs log tree commit diff
path: root/maintainers/scripts/update.py
AgeCommit message (Collapse)AuthorFilesLines
2022-09-26maintainers/scripts/update.nix: make package name, pname and old version ↵José Romildo1-1/+11
available to the update script
2022-09-20maintainers/scripts/update.nix: exit with nonzero exit code when script failsWinter1-2/+10
2022-02-21maintainers/scripts/update.nix: Add experimental support for customizing ↵Jan Tojnar1-0/+4
commit message
2021-10-31maintainers/scripts/update.nix: Support committing with nix-update-scriptJan Tojnar1-1/+1
When updating a package using nix-update-script with `--argstr commit true`, update.nix would not detect the changes because nix-update would stage them and `git diff` would be empty. We now detect both staged and unstaged changes to handle this use case.
2021-05-05maintainers/scripts/update.nix: Ensure the worktree is cleanJan Tojnar1-0/+3
When an update script fails, it might still modify the source tree. These changes would then be committed in the next update attempt. Let’s make sure the worktree is clean before updating to avoid that.
2020-09-20maintainers/scripts/update.nix: Run update scripts from the worktreeJan Tojnar1-5/+15
`update.nix` extracts `passthru.updateScript` attributes in the main repo and when they are relative paths (e.g. `./update.sh`), Nix will resolve them to absolute paths in the main repo. Update scripts can use $(dirname $0) to get the location of files they should update but that would point to the main repo. We want them to modify the appropriate git worktree instead so we replace the prefix accordingly. `git rev-parse --show-toplevel` will resolve symlinks but, fortunately, Nix will do that as well, so the path will match: https://github.com/NixOS/nixpkgs/pull/98304#issuecomment-695761754
2020-09-20maintainers/scripts/update.nix: run update script with UPDATE_NIX_ATTR_PATHJan Tojnar1-1/+1
The environment variable will contain the attribute path the script is supposed to update.
2020-09-20maintainers/scripts/update.nix: auto-detect attrPathJan Tojnar1-2/+2
2020-09-20maintainers/scripts/update.nix: mention when there were no changes committedJan Tojnar1-2/+6
2020-09-20maintainers/scripts/update.nix: support filling in auto-commit attributesJan Tojnar1-19/+31
We can determine all of them when attrPath is present so we might jsut as well do it.
2020-09-20maintainers/scripts/update.nix: support auto-committing by passing attrPathJan Tojnar1-4/+25
Instead of having the updateScript support returning JSON object, it should be sufficient to specify attrPath in passthru.updateScript. It is much easier to use. The former is now considered experimental.
2020-09-20maintainers/scripts/update.nix: switch to asyncioJan Tojnar1-67/+113
This will make it cleaner and also better respect SIGTERM.
2020-09-20maintainers/scripts/update.nix: refactoringJan Tojnar1-38/+47
Get rid of some globals, split main into smaller functions, rename some variables, add typehints.
2020-09-20maintainers/scripts/update.nix: Add support for auto-commiting changesJan Tojnar1-7/+48
Update scripts can now declare features using passthru.updateScript = { command = [ ../../update.sh pname ]; supportedFeatures = [ "commit" ]; }; A `commit` feature means that when the update script finishes successfully, it will print a JSON list like the following: [ { "attrPath": "volume_key", "oldVersion": "0.3.11", "newVersion": "0.3.12", "files": [ "/path/to/nixpkgs/pkgs/development/libraries/volume-key/default.nix" ] } ] and data from that will be used when update.nix is run with --argstr commit true to create commits. We will create a new git worktree for each thread in the pool and run the update script there. Then we will commit the change and cherry pick it in the main repo, releasing the worktree for a next change.
2020-09-18update.nix: use ThreadPoolExecutorJan Tojnar1-1/+1
Not sure why I chose ProcessPoolExecutor in the first place.
2018-12-01update.nix: Run update scripts in parallelJan Tojnar1-0/+79
To make updating large attribute sets faster, the update scripts are now run in parallel. Please note the following changes in semantics: - The string passed to updateScript needs to be a path to an executable file. - The updateScript can also be a list: the tail elements will then be passed to the head as command line arguments.