Commit Graph

154 Commits

Author SHA1 Message Date
Maxim Cournoyer
2a7f031ca9
gnu-maintenance: Support URI list of mixed mirrors, HTTP URLs.
This reinstate commit a5b5df7f7f with a fix to
the inner expand-uri procedure.
2023-09-11 23:39:13 -04:00
Maxim Cournoyer
a9d5d1d9dd
Revert "gnu-maintenance: Support URI list of mixed mirrors, HTTP URLs."
This reverts commit a5b5df7f7f.  Pushed too
early.
2023-09-11 23:30:43 -04:00
Maxim Cournoyer
a5b5df7f7f
gnu-maintenance: Support URI list of mixed mirrors, HTTP URLs.
Fixes <https://issues.guix.gnu.org/58697>.

* guix/gnu-maintenance.scm (import-html-updatable-release): Update doc.
<expand-uri>: New nested procedure.  Apply it to the origin URI.

Reported-by: kiasoc5 <kiasoc5@disroot.org>
2023-09-11 22:53:38 -04:00
Maxim Cournoyer
87dab3e36b
gnu-maintenance: Do not error when there are no candidates.
Fixes <https://issues.guix.gnu.org/65773>.

* guix/gnu-maintenance.scm (rewrite-url): Do not error when there are no
candidates.  This may well be possible, depending on the site.
2023-09-06 01:03:27 -04:00
Maxim Cournoyer
fd09e7b053
gnu-maintenance: Do not crash on refresh when origin URI is a list.
Updating the simh package would fail with:

  ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure
  string-prefix?: Wrong type argument in position 2 (expecting
  string): ("http://simh.trailing-edge.com/sources/simhv312-4.zip"
  "http://simh.trailing-edge.com/sources/archive/simhv312-4.zip")

This is because it expects a scalar value, but lists are allowed for URIs.

* guix/gnu-maintenance.scm (import-html-updatable-release): Check that URI is
a string before checking if it has the mirror:// prefix.
2023-09-05 19:52:19 -04:00
Maxim Cournoyer
1dce887776
gnu-maintenance: Consider Qt source tarballs as "release files".
* guix/gnu-maintenance.scm (release-file?): Use positive logic in doc.
Add a special case for Qt source archives.
* tests/gnu-maintenance.scm ("release-file?"): Update test.
2023-08-26 11:38:56 -04:00
Maxim Cournoyer
bdaef69556
gnu-maintenance: Allow mirror URLs to fallback to the generic HTML updater.
* guix/gnu-maintenance.scm (http-url?): Extract from html-updatable-package?,
modify to return the HTTP URL, and support the mirror:// scheme.
(%disallowed-hosting-sites): New variable, extracted from
html-updatable-package.
(html-updatable-package?): Rewrite a mirror:// URL to an HTTP or HTTPS one.
* guix/download.scm (%mirrors): Update comment.
2023-08-26 11:38:56 -04:00
Maxim Cournoyer
6953fb9241
gnu-maintenance: Add support to rewrite version in URL path.
Fixes <https://issues.guix.gnu.org/64015>.
Fixes <https://issues.guix.gnu.org/65304>.

Previously, the generic HTML updater would only look for the list of files
found at the parent of its current source URL, ignoring that the URL may embed
the version elsewhere in its path.  This could cause 'guix refresh' to report
no updates available, while in fact there were, such as for 'libuv'.

* guix/gnu-maintenance.scm (strip-trailing-slash): New procedure.
(%version-rx): New variable.
(rewrite-url): New procedure.
(import-html-release): New rewrite-url? argument.  When true, use the above
procedure.
(import-html-updatable-release): Call import-html-release with #:rewrite-url
set to #t.
* tests/gnu-maintenance.scm ("rewrite-url, to-version specified")
("rewrite-url, without to-version"): New tests.
2023-08-26 11:38:56 -04:00
Maxim Cournoyer
6fb8cc312d
gnu-maintenance: Extract 'canonicalize-url' from 'import-html-release'.
* guix/gnu-maintenance.scm
(canonicalize-url): New procedure, extracted from...
(import-html-release): ... here.  Use it.  Rename inner PACKAGE variable to
NAME, to explicit it is a string and not a package object.
2023-08-26 11:38:56 -04:00
Maxim Cournoyer
2654232660
gnu-maintenance: Document nested procedures in 'import-html-release'.
* guix/gnu-maintenance.scm (import-html-release): Add docstring to the
'file->signature/guess' and 'url->release' nested procedures.
2023-08-26 11:38:56 -04:00
Maxim Cournoyer
c6b5eeac92
gnu-maintenance: Accept package object in 'import-html-release' procedure.
This is in preparation for a new URL rewriting feature, which will need to
have the current version information available.

* guix/gnu-maintenance.scm (import-html-release): Update doc.  Adjust default
value of the DIRECTORY argument.  Bind PACKAGE in lexical scope so that its
value there is unchanged.
(import-savannah-release, import-kernel.org-release)
(import-html-updatable-release): Adjust accordingly.
2023-08-26 11:38:56 -04:00
Maxim Cournoyer
a5e67dec2a
gnu-maintenance: Fix indentation.
* guix/gnu-maintenance.scm: Re-indent file.
2023-08-26 11:38:55 -04:00
Maxim Cournoyer
f6cfc993ac
gnu-maintenance: Extract url->links procedure.
* guix/gnu-maintenance.scm (url->links): New procedure.
(import-html-release): Use it.
2023-08-26 11:38:55 -04:00
Maxim Cournoyer
610d0e30e0
gnu-maintenance: Fix docstring.
* guix/gnu-maintenance.scm (import-kernel.org-release): Fix docstring.
2023-08-26 11:38:55 -04:00
Maxim Cournoyer
4110cc4f75
gnu-maintenance: Make base-url argument of import-html-release required.
It doesn't make sense to have it default to something like
"https://kernel.org/pub"; it should always be provided explicitly.

* guix/gnu-maintenance.scm (import-html-release) <#:base-url>: Turn keyword
argument into a positional argument.  Update doc.
* guix/gnu-maintenance.scm (import-savannah-release): Adjust call accordingly.
(import-kernel.org-release): Likewise.
(import-html-updatable-release): Likewise.
2023-08-26 11:38:55 -04:00
Maxim Cournoyer
c655231b72
gnu-maintenance: Improve check for disabled host names.
Found while investigating <https://issues.guix.gnu.org/65304>.

* guix/gnu-maintenance.scm (html-updatable-package?): Tighten predicate.

Reviewed-by: Ludovic Courtès <ludo@gnu.org>
2023-08-22 12:38:50 -04:00
Ludovic Courtès
ae587c2ef0
guix: Strip #:use-module lists.
This was obtained by setting up this environment:

  guix shell -D guix --with-input=guile@3.0.9=guile-next \
    --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2
    -- make -j5

then adding 'unused-module' to (@@ (guix build compiler) %warnings),
building, and checking all the "unused module" warnings and removing
those that were definitely unused.
2023-03-13 15:08:33 +01:00
Ludovic Courtès
472dd29f37
gnu-maintenance: 'gnu' and 'gnu-ftp' predicates catch networking errors.
Previously, in a networking-less environment such as 'guix shell -C -D
guix', 'guix refresh --list-updaters' would crash due to a
'gettaddrinfo-error' exception in these predicates.

* guix/gnu-maintenance.scm (%gnu-updater)[pred]: Wrap in
'false-if-networking-error'.
(%gnu-ftp-updater)[pred]: Likewise.
2023-01-08 16:11:45 +01:00
Ludovic Courtès
f3edf29c67
gnu-maintenance: Factorize 'false-if-networking-failure'.
* guix/import/utils.scm (call-with-networking-exception-handler): New
procedure.
(false-if-networking-error): New macro.
* guix/gnu-maintenance.scm (import-html-updatable-release): Use it
instead of inline code.
2023-01-08 16:11:45 +01:00
Hartmut Goebel
53af560543
gnu-maintenance: Allow updating to a specific version.
* guix/gnu-maintenance.scm
  (latest-ftp-release): Rename to … (import-ftp-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-html-release): Rename to … (import-html-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-gnu-release): Rename to … (import-gnu-release) … this,
  add #:version argument. Refactor to first select archives for
  respective package, the find the requested or latest version, then create
  the upstream-source.
  (latest-release): Rename to … (import-release) … this,
  add #:version argument, pass on to … (import-ftp-release) … this.
  (import-release*): Rename to … (import-release*) … this,
  add #:version argument, pass on to … (latest-release) … this.
  (latest-savannah-release): Rename to … (import-savannah-release) … this,
  add keword-argument version, pass on to … (import-html-release) … this.
  (latest-xorg-release): Rename to … (import-xorg-release) … this,
  add keword-argument version, pass on to … (import-ftp-release) … this.
  (latest-kernel.org-release): Rename to … (import-kernel.org-release) … this,
  add #:version argument, pass on to … (import-html-release) … this.
  (latest-html-updatable-release): Rename to … (import-html-updatable-release)
  … this, add #:version argument, pass on to … (import-html-release) … this.
* guix/import/gnu.scm(gnu->guix-package): Adjust function call.
2022-12-26 17:38:03 +01:00
Hartmut Goebel
abc72eeac0
import: sourceforge: Issue error-message if version is given.
Due to the complicated directory structure at sourceforce,
enabling the  sourceforge importer to update to a specific version
is very complicated to implement. Since only 2.0% of the
packages in guix are covered by this updater I dedided to not
implement this.

* guix/gnu-maintenance.scm (latest-sourceforge-release): Add #:version
  argument.  Issue error-message if version is given.
2022-12-26 17:15:07 +01:00
Hartmut Goebel
a274a6a1ac
upstream-updater: Rename record field.
The next commits will make the functions, which are currently importing the
latest version of a package, change into importing the latest or a given
version of the package (for those updaters supporting specifying a version).
Thus the name ‘latest‘ is no longer appropriate.

* guix/upstream.scm (upstream-updater) Rename field [latest] to
  [import]. (lookup-updater, package-latest-release) Adjust fieldname
  accordingly.
* guix/gnu-maintenance.scm (%gnu-updater, %gnu-ftp-updater,
  %savannah-updater, %sourceforge-updater, %xorg-updater,
  %kernel.org-updater, %generic-html-updater),
  guix/import/cpan.scm (%cpan-updater),
  guix/import/cran.scm (%cran-updater, %bioconductor-updater),
  guix/import/crate.scm (%crate-updater),
  guix/import/egg.scm (%egg-updater),
  guix/import/elpa.scm (%elpa-updater),
  guix/import/gem.scm (%gem-updater),
  guix/import/git.scm (%generic-git-updater),
  guix/import/github.scm (%github-updater),
  guix/import/gnome.scm (%gnome-updater),
  guix/import/hackage.scm (%hackage-updater),
  guix/import/hexpm.scm (%hexpm-updater),
  guix/import/kde.scm (%kde-updater),
  guix/import/launchpad.scm (%launchpad-updater),
  guix/import/minetest.scm (%minetest-updater),
  guix/import/opam.scm (%opam-updater),
  guix/import/pypi.scm (%pypi-updater),
  guix/import/stackage.scm (%stackage-updater),
  tests/import-github.scm (found-sexp)
  tests/transformations.scm ("options->transformation, with-latest"):
  Adjust fieldname accordingly.
2022-12-26 17:15:06 +01:00
Ludovic Courtès
c370998f01
gnu-maintenance: 'generic-html' updater ignores invalid host names.
Previously "guix refresh xkbset" for example would crash with a
getaddrinfo-error because the domain name is invalid.  Now it reports
failure to update.

Reported by Tyler Wolf <tyler@twolf.io>
in <https://issues.guix.gnu.org/59598>.

* guix/gnu-maintenance.scm (latest-html-updatable-release): Return #f
upon 'getaddrinfo-error' as well.
2022-12-08 13:07:45 +01:00
Tobias Geerinckx-Rice
0081807e16
guix: Replace defective freemirror.org.
This ‘mirror’ is particularly problematic because it's the only one checked
by ‘guix refresh’.

* guix/gnu-maintenance.scm (%savannah-base): Substitute freedif.org.
* guix/download.scm (%mirrors): Likewise.

Reported by sash-kan on #guix.
2022-11-13 01:00:07 +01:00
Ludovic Courtès
c6cb7243fb
gnu-maintenance: 'release-file?' excludes "valgrind-3.20.0.RC1.tar.bz2".
* guix/gnu-maintenance.scm (%alpha-tarball-rx): Add "." before
"(alpha|beta|...)".
* tests/gnu-maintenance.scm ("release-file?"): Add test for Valgrind.
2022-11-11 23:17:43 +01:00
Ludovic Courtès
9a35e4c5bd
gnu-maintenance: 'gnu' updater prefers tarball with same compression.
Fixes <https://issues.guix.gnu.org/59168>.

Previously 'guix build make --with-latest=make' would pick ".tar.lz",
rather than "tar.gz", because "tar.lz" happened to come first in the
<upstream-source> 'urls' field.

* guix/gnu-maintenance.scm (latest-gnu-release)[archive-type]
[better-tarball?]: New variables.
Sort TARBALLS according to BETTER-TARBALL?.
2022-11-11 23:17:43 +01:00
Maxim Cournoyer
9945f9419d
gnu-maintenance: Remove retired 'gforge.inria.fr' site.
* guix/gnu-maintenance.scm (html-updatable-package?): Remove "gforge.inria.fr".
2022-10-03 11:16:13 -04:00
Maxime Devos
55d4200002
gnu-maintenance: Remove unused procedures.
* guix/gnu-maintenance.scm (url-prefix-rewrite, adjusted-upstream-source):
Remove.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-26 23:29:37 +02:00
Maxime Devos
d9b8169a9f
gnu-maintenance: Simplify latest-kernel.org-release.
As latest-html-release now produces mirror:// URIs where possible,
the additional post-processing is not necessary anymore.

As a test, revert the dtc package back to 1.6.0 and try updating 'gash',
the mirror:// URI remains.

* gnu-maintenance.scm (latest-kernel.org-release): Do not call
adjusted-upstream-source on the result.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-26 23:29:37 +02:00
Maxime Devos
e96f380fd4
gnu-maintenance: Simplify latest-savannah-release.
As latest-html-release now produces mirror:// URIs where possible,
the additional post-processing is not necessary anymore.

As a test, try updating 'gash', the mirror:// URI remains.

* gnu-maintenance.scm (latest-savannah-release): Do not call
adjusted-upstream-source on the result.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-26 23:29:36 +02:00
Maxime Devos
11ec14ff0e
gnu-maintenance: Produce mirror:// URIs in latest-html-release.
Partially fixes <https://issues.guix.gnu.org/57477>.

I'm not aware of a package using both latest-html-release and mirrors, so it
has not been completely tested.  However, updating "yt-dlp" appears to work
(except for git-fetch not being supported yet).  The expression for the
signature-urls field had to be tweaked to not call uri-mirror-rewrite on #false.

* guix/gnu-maintenance.scm (latest-html-release)[url->research]{urls,signature-urls}:
Call uri-mirror-rewrite on the URLs.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-09-26 23:29:36 +02:00
Maxime Devos
d877dc098b
gnu-maintenance: Produce mirror:// URIs in latest-ftp-release.
Partially fixes <https://issues.guix.gnu.org/57477>.

As a test, try updating gnupg.  Before the patch, a ftp:// URL was produced,
now the mirror:// is preserved.

* guix/gnu-maintenance.scm (latest-ftp-release)[file->source]{urls,signature-urls}:
Call uri-mirror-rewrite on the URLs.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-09-26 23:29:36 +02:00
Maxime Devos
fc5c4ce4ec
lint: Extract logic of 'check-mirror-url'.
It will be useful for fixing <https://issues.guix.gnu.org/57477>.

* guix/lint.scm (check-mirror-url): Extract mirror://-constructing code to ...
* guix/gnu-maintenance.scm (uri-mirror-rewrite): ... here, tweaking the API
and implementation in anticipation of future users.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-09-26 23:29:36 +02:00
Maxime Devos
c967d1153c
gnu-maintenance: Support // URLs in latest-html-release.
This makes "./pre-inst-env guix refresh -u" download the release tarball from
the right place -- previously, it downloaded from

https://www.libreoffice.org//download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1

whereas it should download from

https://download.documentfoundation.org/libreoffice/src/7.4.0/libreoffice-7.4.0.3.tar.xz?idx=1

instead.

* guix/gnu-maintenance.scm (latest-html-release)[url-release]: Adjust
computation in the case of an absolute URI-reference without a scheme.
* tests/gnu-maintenance.scm ("latest-html-release, scheme-less URIs"):
Test it.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2022-09-17 19:09:45 +02:00
Ludovic Courtès
1e8ebb16c9
gnu-maintenance: 'generic-html' computes the right source URL.
Fixes a regression introduced in
84f8bae0f8, whereby the URL computed for
the new ffmpeg (for instance) would be:

  https://ffmpeg.org/ffmpeg-4.4.tar.xz

instead of:

  https://ffmpeg.org/releases/ffmpeg-4.4.tar.xz

Reported by Maxim Cournoyer.

* guix/gnu-maintenance.scm (latest-html-release)[url->release]: Adjust
computation in the case of a URI-reference with a relative path.
2021-06-03 13:04:20 +02:00
Ludovic Courtès
84f8bae0f8
gnu-maintenance: 'generic-html' correctly handles relative release URLs.
* guix/gnu-maintenance.scm (latest-html-release)[url->release]: Fix
source URL construction in cases where URL is a possibly relative path.
2021-05-28 23:04:44 +02:00
Ludovic Courtès
d7c356edb9
gnu-maintenance: 'release-file?' accepts 'v' prefix as in "PKG-v1.2.tgz".
* guix/gnu-maintenance.scm (%tarball-rx, %package-name-rx): Accept 'v'
and 'V' prefixes.  Accept ".tgz" extension.
* tests/gnu-maintenance.scm ("release-file?"): Add test.
2021-05-28 23:04:44 +02:00
Ludovic Courtès
eb6ac483a5
gnu-maintenance: 'sourceforge' updater reuses the same connection.
* guix/gnu-maintenance.scm (latest-sourceforge-release): Call
'open-socket-for-uri' upfront.  Pass #:port and #:keep-alive? to
'http-head'.  Wrap body in 'dynamic-wind' and call 'close-port' upon
exit.
2021-04-08 23:27:41 +02:00
Ludovic Courtès
b92cfc322d
gnu-maintenance: Add 'sourceforge' updater.
This updater currently covers 2.4% of the packages.

* guix/gnu-maintenance.scm (latest-sourceforge-release): New procedure.
(%sourceforge-updater): New variable.
* doc/guix.texi (Invoking guix refresh): Document it.
2021-04-06 23:59:46 +02:00
Ludovic Courtès
ceeea60bbc
gnu-maintenance: Recognize more source tarball naming schemes.
* guix/gnu-maintenance.scm (%package-name-rx): Add ".src" and ".orig"
suffixes.
* tests/gnu-maintenance.scm ("release-file?"): Add mpg321 and bvi
examples.
("tarball->version"): New test.
2021-04-05 12:03:09 +02:00
Ludovic Courtès
e917027d1f
gnu-maintenance: Remove unused procedure.
* guix/gnu-maintenance.scm (savannah-package?): Remove.
2021-04-05 12:03:08 +02:00
Ludovic Courtès
b3679f2d10
gnu-maintenance: 'generic-html' updates packages with the right property.
* guix/gnu-maintenance.scm (html-updatable-package?): Return true for
packages with a 'release-monitoring-url' property.  This allows us to
cater for packages with source fetched over, say, FTP, but with an HTML
page to monitor.
2021-04-05 12:03:08 +02:00
Ludovic Courtès
1575da6062
gnu-maintenance: Recognize "-source" tarball suffix.
Fixes <https://bugs.gnu.org/47398>.
Reported by Léo Le Bouter <lle-bout@zaclys.net>.

* guix/gnu-maintenance.scm (%tarball-rx): Add "-[Ss]ource" suffix.
* tests/gnu-maintenance.scm ("release-file?"): Add exiv2 example.
2021-03-29 23:33:40 +02:00
Ludovic Courtès
cab1831528
gnu-maintenance: Exclude GNU Radio from the 'gnu-ftp' updater predicate.
'gnu-ftp' would only list old GNU Radio releases since new releases are
no longer uploaded to ftp.gnu.org.  With this change, 'generic-html' is
picked up instead.

* guix/gnu-maintenance.scm (pure-gnu-package?): Return #f for GNU Radio.
2021-03-21 23:41:02 +01:00
Ludovic Courtès
1710e8cb59
gnu-maintenance: Accept underscores as package/version separators.
Fixes <https://bugs.gnu.org/47256>.
Reported by Léo Le Bouter <lle-bout@zaclys.net>.

* guix/gnu-maintenance.scm (%tarball-rx, %package-name-rx): Accept
underscore as the package/version separator in tarball names.
* tests/gnu-maintenance.scm ("release-file?"): Add "mediainfo" test.
2021-03-20 22:29:14 +01:00
Ludovic Courtès
a0f83602f8
gnu-maintenance: Better handle empty #:directory for 'latest-html-release'.
In particular, this makes sure we don't add a trailing slash when the
user specified a 'release-monitoring-url' property for the
'generic-html' updater.

* guix/gnu-maintenance.scm (latest-html-release): When DIRECTORY is
empty, do not append it.
2021-03-19 13:23:26 +01:00
Ludovic Courtès
728c90862e
gnu-maintenance: Add a timeout on FTP connection establishment.
* guix/gnu-maintenance.scm (latest-ftp-release): Pass #:timeout to
'ftp-open'.
2021-03-17 12:03:25 +01:00
Ludovic Courtès
29330b57e2
gnu-maintenance: Remove unused parameters of 'latest-ftp-release'.
* guix/gnu-maintenance.scm (latest-ftp-release): Remove #:ftp-open, #:ftp-close,
and #:keep-file?.
2021-03-17 12:03:25 +01:00
Ludovic Courtès
af9af2180e
gnu-maintenance: Add 'generic-html' updater.
This brings total updater coverage, as reported by 'guix refresh
--list-updaters', from 78% to 88.3%.  Among many other things, it covers
freedesktop.org packages.

* guix/gnu-maintenance.scm (html-updatable-package?)
(latest-html-updatable-release): New procedures.
(%generic-html-updater): New variable.
* doc/guix.texi (Invoking guix refresh): Document it.
2021-03-17 12:03:24 +01:00
Ludovic Courtès
1d5a946ce5
gnu-maintenance: 'latest-html-release' better computes version number.
* guix/gnu-maintenance.scm (latest-html-release): Use 'tarball->version'
rather than 'package-name->name+version' to extract the version number.
This fixes problems with packages like 'netsurf' and 'libdom' that have
"-src" in their tarball name, where "src" would be taken as the new
version number.
2021-03-17 12:03:24 +01:00