Commit Graph

106 Commits

Author SHA1 Message Date
Anderson Torres
23c316282e nix-update-script: migrate to nix-update package 2024-09-17 16:49:04 -03:00
Jan Tojnar
69adf156ef common-updater-scripts: Fix u-s-v updating npmDeps
`buildNpmDeps` pass `npmDepsHash` as `hash` to `fetchNpmDeps` so `npmDeps` does not contain `outputHashAlgo` attribute.

This would cause the program fail as follows:

    $ update-source-version zx --ignore-same-version --source-key=npmDeps
    error: attribute 'outputHashAlgo' in selection path 'zx.npmDeps.drvAttrs.outputHashAlgo' not found
    update-source-version: error: Couldn't evaluate old source hash from 'zx.npmDeps'!
2024-07-13 15:48:29 +02:00
Jan Tojnar
3c78e0ce04 _experimental-update-script-combinators.sequence: Terminate on failure
Before:

    nix-repl> (_experimental-update-script-combinators.sequence [["false"] ["echo" "work"]]).command
    [ "sh" "-c" "'false';'echo' 'work'" ]

After:

    nix-repl> (_experimental-update-script-combinators.sequence [["false"] ["echo" "work"]]).command
    [ "sh" "-ec" "'false';'echo' 'work'" ]
2024-07-13 15:47:27 +02:00
Ryan Hendrickson
b639a50d15 common-updater-scripts: add allowedVersions parameter
By providing a regex in allowedVersions, users of genericUpdater,
gitUpdater, directoryListingUpdater, or httpTwoLevelsUpdater can exclude
versions that don't match the regex. This can be simpler to express than
constructing the complement regex in ignoredVersions.
2024-06-25 17:44:44 -04:00
h7x4
e6951ae025
Merge pull request #304059 from midchildan/fix/generic-updater/ignored-versions
genericUpdater: fix ignoredVersions
2024-06-24 12:41:41 +02:00
Cosima Neidahl
b60ebf54c1
Merge pull request #316264 from OPNA2608/fix/unstableGitUpdater-hardcodeZeroVersion-comment
unstableGitUpdater: Remove bitrotten comment about hardcodeZeroVersion on tag-less projects
2024-06-16 11:39:57 +02:00
Jan Tojnar
4627e4849e common-updater-scripts/u-s-v: allow omitting version with --ignore-same-version
This is useful when wanting to update secondary hashes like `cargoDeps`.
2024-06-09 20:33:23 +02:00
Jan Tojnar
bcb2f57f18 common-updater-scripts/u-s-v: support --ignore-same-version
This is useful when updating multiple source attributes for a single version.
2024-06-09 20:17:56 +02:00
OPNA2608
456ba8dec9 unstableGitUpdater: Remove bitrotten comment about hardcodeZeroVersion on tag-less projects
The behaviour this refers to was changed since then, unstableGitUpdater now automatically falls back to 0 when there are no previous tags.
2024-05-31 23:26:24 +02:00
John Titor
14676392cd
unstableGitUpdater: document actual use procedure 2024-05-13 22:42:41 +05:30
midchildan
a87dd78cdd
genericUpdater: fix ignoredVersions
ignoredVersions silently failed if GNU grep was not in `PATH`.
2024-04-15 00:46:41 +09:00
OPNA2608
c4019f81b7 unstableGitUpdater: Move copy-pasted git describe call into reusable function 2024-03-25 12:50:47 +01:00
OPNA2608
ce3a2f648e unstableGitUpdater: Drop --bare cloning
It messes with tags
2024-03-03 18:58:58 +01:00
OPNA2608
ce91e3572b unstableGitUpdater: Address review feedback 2024-03-03 18:58:58 +01:00
OPNA2608
e30288bced unstableGitUpdater: Add option to apply a pattern to found tags, to ignore non-matching tags 2024-03-03 18:58:58 +01:00
OPNA2608
c145f59d48 unstableGitUpdater: Add option to run the tag through a converter program 2024-03-03 18:58:58 +01:00
OPNA2608
3cd4a35e71 unstableGitUpdater: Try full history if failed to find any tags in shallow clone 2024-03-03 18:58:58 +01:00
OPNA2608
460374eb04 unstableGitUpdater: Support non-shallow clones in tag search 2024-03-03 18:58:57 +01:00
OPNA2608
222da55eef unstableGitUpdater: Use stableVersion, update to new format, offer hardcoded 0 version 2024-03-03 18:58:57 +01:00
Jan Tojnar
d81eeb426b genericUpdater: Add support for commit protocol
This will allow it to work with _experimental-update-script-combinators.sequence.
2024-01-14 19:24:11 +01:00
Peder Bergebakken Sundt
dc2ce0af94 nix-update: set meta.mainProgram 2023-11-16 21:42:13 +01:00
Jacob Moody
5dde2776d3 unstableGitUpdater: add deepClone argument for non shallow clones 2023-07-23 13:16:28 -05:00
linsui
b6c2a01ecd list-git-tags: fix for tags with / in the tag name 2023-02-10 18:29:52 +08:00
Martin Weinelt
e75f5e8efa python37: drop
The package set hasn't been working for a long time now, due to infinite
recursions, that nobody was going to fix.

The release is going to go EOL in 2023/06 and we don't want to ship it
in NixOS 23.05 anyway.
2023-01-05 13:20:49 +01:00
figsoda
cb219cb6d7 nix-update-script: make attrPath optional 2022-12-25 11:31:33 -05:00
Francesco Gazzetta
19e4b53b09 common-updater-scripts,directoryListingUpdater: add extraRegex parameter 2022-12-10 17:02:13 +01:00
Francesco Gazzetta
c1188a559b common-updater-scripts: list-directory-versions: scan for absolute urls too 2022-12-10 17:01:56 +01:00
K900
06624cd934 qt5: drop 5.12, 5.14 2022-12-03 10:49:53 +03:00
schnusch
f5d62d419e nix-update-script: add extraArgs to pass custom arguments to nix-update 2022-11-28 00:29:19 +01:00
José Romildo
a15e083372 httpTwoLevelsUpdater: fix variable default value 2022-10-01 12:27:09 -03:00
José Romildo
0b9c39e819 gitUpdater: fix variable default value 2022-10-01 12:27:09 -03:00
José Romildo
19a4717846 directoryListingUpdater: init
Update a package looking for available versions in an html page
2022-10-01 12:27:09 -03:00
José Romildo Malaquias
e78c23cf5b
Merge pull request #193248 from romildo/upd.generic-updater
generic-updater: more flexible with name, pname, version and attr path, and cleanups
2022-09-30 09:19:21 -03:00
José Romildo
f15117a874 generic-updater: more flexible with name, pname, version and attr path
- This information is availabe from environment variables defined by
maintainers/scripts/update.nix

- Renamed the shell script to generic-update-script.sh

- Add a new optional argument (representing the package name) to the
shell script

- The version lister is called with a new optional
argument (representing the package attribute path)
2022-09-27 23:41:53 -03:00
Jan Tojnar
e628b43a9c common-updater-scripts: fix silent error on 404
When TOFU was unable to download the file, there would be no hash
in the fetch log, causing the grep to fail. Since the script
is set to errexit, it would terminate the processing without
any output. Let’s instead print the fetch log.
2022-09-27 02:19:25 +02:00
Jan Tojnar
31c2154465 common-updater-scripts: Use custom fake temporary hash
Some update scripts (e.g. sublime4) already use all-zeroes hashes
for resetting a version when updating multiple sources.
When `update-source-version "${attrPath}" 0 "${lib.fakeSha256}"`
was executed, u-s-v would not be able to detect that the hash
changed and would fail with the following message:

    Failed to replace temporary source hash of '…' to the final source hash!

The update script worked when we tested it because change detection itself
was broken until recently: https://github.com/NixOS/nixpkgs/pull/190554
2022-09-16 18:36:01 +02:00
Jan Tojnar
ee1795cc87 common-updater-scripts: Only look for URL when replacing it
This would do a pointless slow `nix-instantiate` call for a feature
that is rarely used – initially, it was added for Firefox updates
186de9ca9e
but now not even that uses it.

Additionally, this would break stuff like `cargoDeps`,
which lack the url attributes.
2022-09-09 22:31:28 +02:00
Jan Tojnar
17bc96df08 common-updater-scripts: Fix replacement failure detections
Previously, we only made `sed` back up the version replacement.
This meant that `cmp` would already recognize the files
as changed before replacing hash and the other values,
and the error would not be printed.

Let’s always make the `sed` create a backup so that we can
detect success of each situation. This will no longer
allow us to revert to the original version on failure
but the updated file should be tracked in git anyway.
2022-09-09 22:31:28 +02:00
Jan Tojnar
9137e671a2 update-script-combinators.copyAttrOutputToFile: init
Useful for storing generated files into Nixpkgs repo as a part of an update script to avoid a build time dependency.
2022-09-07 14:23:28 +02:00
Jan Tojnar
7d6b5d171a update-script-combinators: experimental init
The sequence combinator will be useful for updating packages consisting of multiple sources.
2022-09-07 14:23:28 +02:00
Alyssa Ross
88441f3e44 unstableGitUpdater: fix inaccurate comments
It used to use src.url, but when that was changed the comments weren't
updated.

Fixes: 7aae279ad9 ("unstableGitUpdater: fix updating fetchzip-based sources")
2022-09-04 08:59:51 +00:00
OPNA2608
0276d2fcbb common-updater-scripts/update-source-version: Add flag required for nix-command 2022-07-07 23:01:35 +02:00
José Romildo
cb9a33497f generic-updater: fix nix edit command line
Recently `nix edit` works only with `--extra-experimental-features nix-command`
2022-07-02 08:17:00 -03:00
Jan Tojnar
7aae279ad9 unstableGitUpdater: fix updating fetchzip-based sources
a67950f20b added `url` attribute
from `fetchurl` and therefore also from `fetchzip`.
We previously relied on `url` from fetchgit-based fetchers
to find the repo URL but now it will just return tarballs
in the case of `fetchFrom{GitHub,GitLab}`.

Let’s add an attribute to `fetch{git,FromGitHub,FromGitLab}`
to expose a repo URL consistently.
2022-05-24 19:12:12 +02:00
Kira Bruneau
f14a57c95b gitUpdater: update comment for url 2022-04-23 15:30:56 -04:00
Kira Bruneau
ef57e2fb8d common-updater-scripts/list-git-tags: prefer src.meta.homepage 2022-04-23 15:30:56 -04:00
Sergei Trofimovich
219ca58452 gitUpdater: add explicit url parameter to specify a git tree for tags
That way gitUpdater could be used to extract most recent published
releases for .nix files that don't use git directly to define builds.

An example is iproute2 package which does not have a single place
to lookup most recent release.
2022-04-01 18:10:45 +01:00
José Romildo
005ac63a19 httpTwoLevelsUpdater: init 2022-02-21 13:01:49 -03:00
José Romildo
ba59355e81 gitUpdater: init
- Add the 'gitUpdater' helper function to update git based packages, using the
'genericUpdater' function.
- Rework argument passing to the `list-git-tags' and 'list-archive-two-level-versions' scripts.
- Replace 'genericUpdater' plus 'list-git-tags' by 'gitUpdater'
2022-02-21 13:01:49 -03:00
Jan Tojnar
97276fe650 unstableGitUpdater: Allow using stable versions
It is important to keep the version as parsed by `builtins.parseDrvName`
monotonic for packages that often switch between stable and unstable versions,
for nix-env to be able to update them reliably.

Let’s optionally use the version format described by RFC 107:
https://github.com/NixOS/rfcs/pull/107
The downside is that it requires fetching
more commits to be able to determine the latest tag.
2022-02-18 17:26:46 +01:00