diff options
| author | Maxime Devos <maximedevos@telenet.be> | 2022-09-11 16:23:37 +0200 |
|---|---|---|
| committer | Christopher Baines <mail@cbaines.net> | 2022-09-17 19:09:45 +0200 |
| commit | c967d1153cae419e4acbe0dbed8f558d95ced0e3 (patch) | |
| tree | 6fcb5746d4352226e0695aa8718c141a433341c8 /tests | |
| parent | c00e1c87f219ab9947204af53afff6ccf812fa91 (diff) | |
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>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gnu-maintenance.scm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/gnu-maintenance.scm b/tests/gnu-maintenance.scm index c04d8ba7339..89b0684c253 100644 --- a/tests/gnu-maintenance.scm +++ b/tests/gnu-maintenance.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015, 2021 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2015, 2021 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -18,6 +19,10 @@ | |||
| 18 | 19 | ||
| 19 | (define-module (test-gnu-maintenance) | 20 | (define-module (test-gnu-maintenance) |
| 20 | #:use-module (guix gnu-maintenance) | 21 | #:use-module (guix gnu-maintenance) |
| 22 | #:use-module (guix tests) | ||
| 23 | #:use-module (guix tests http) | ||
| 24 | #:use-module (guix upstream) | ||
| 25 | #:use-module (guix utils) | ||
| 21 | #:use-module (srfi srfi-1) | 26 | #:use-module (srfi srfi-1) |
| 22 | #:use-module (srfi srfi-64) | 27 | #:use-module (srfi srfi-64) |
| 23 | #:use-module (ice-9 match)) | 28 | #:use-module (ice-9 match)) |
| @@ -55,4 +60,28 @@ | |||
| 55 | ("mpg321_0.3.2.orig.tar.gz" "0.3.2") | 60 | ("mpg321_0.3.2.orig.tar.gz" "0.3.2") |
| 56 | ("bvi-1.4.1.src.tar.gz" "1.4.1"))))) | 61 | ("bvi-1.4.1.src.tar.gz" "1.4.1"))))) |
| 57 | 62 | ||
| 63 | (test-assert "latest-html-release, scheme-less URIs" | ||
| 64 | (with-http-server | ||
| 65 | `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\"> | ||
| 66 | <head> | ||
| 67 | <title>Releases (on another domain)!</title> | ||
| 68 | </head> | ||
| 69 | <body | ||
| 70 | <a href=\"//another-site/foo-2.tar.gz\">version 1</a> | ||
| 71 | </body> | ||
| 72 | </html>")) | ||
| 73 | (let () | ||
| 74 | (define package | ||
| 75 | (dummy-package "foo" | ||
| 76 | (source | ||
| 77 | (dummy-origin | ||
| 78 | (uri (string-append (%local-url) "/foo-1.tar.gz")))) | ||
| 79 | (properties | ||
| 80 | `((release-monitoring-url . ,(%local-url)))))) | ||
| 81 | (define update ((upstream-updater-latest %generic-html-updater) package)) | ||
| 82 | (define expected-new-url "http://another-site/foo-2.tar.gz") | ||
| 83 | (and (pk 'u update) | ||
| 84 | (equal? (upstream-source-version update) "2") | ||
| 85 | (equal? (list expected-new-url) (upstream-source-urls update)))))) | ||
| 86 | |||
| 58 | (test-end) | 87 | (test-end) |
