aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-gnu-maintenance)
  #:use-module (guix gnu-maintenance)
  #:use-module (guix tests)
  #:use-module (guix tests http)
  #:use-module (guix upstream)
  #:use-module (guix utils)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-64)
  #:use-module ((web client) #:select (current-http-proxy))
  #:use-module (ice-9 match))

(test-begin "gnu-maintenance")

(test-assert "release-file?"
  (and (every (lambda (project+file)
                (apply release-file? project+file))
              '(("gcc" "gcc-5.3.0.tar.bz2")
                ("texmacs" "TeXmacs-1.0.7.9-src.tar.gz")
                ("icecat" "icecat-38.4.0-gnu1.tar.bz2")
                ("mit-scheme" "mit-scheme-9.2.tar.gz")
                ("mediainfo" "mediainfo_20.09.tar.xz")
                ("exiv2" "exiv2-0.27.3-Source.tar.gz")
                ("mpg321" "mpg321_0.3.2.orig.tar.gz")
                ("bvi" "bvi-1.4.1.src.tar.gz")
                ("hostscope" "hostscope-V2.1.tgz")
                ("qtbase" "qtbase-everywhere-src-6.5.2.tar.xz")
                ("qtbase" "qtbase-everywhere-opensource-src-5.15.10.tar.xz")
                ("qt-creator" "qt-creator-opensource-src-11.0.1.tar.xz")))
       (every (lambda (project+file)
                (not (apply release-file? project+file)))
              '(("guile" "guile-www-1.1.1.tar.gz")
                ("guile" "guile-2.0.11.tar.gz.sig")
                ("mit-scheme" "mit-scheme-9.2-i386.tar.gz")
                ("mit-scheme" "mit-scheme-9.2-doc-pdf.tar.gz")
                ("gnutls" "gnutls-3.2.18-w32.zip")
                ("valgrind" "valgrind-3.20.0.RC1.tar.bz2")))))

(test-assert "tarball->version"
  (let ((tarball->version (@@ (guix gnu-maintenance) tarball->version)))
    (every (match-lambda
             ((file version)
              (equal? (tarball->version file) version)))
           '(("coreutils-8.32.tar.gz" "8.32")
             ("mediainfo_20.09.tar.xz" "20.09")
             ("exiv2-0.27.3-Source.tar.gz" "0.27.3")
             ("mpg321_0.3.2.orig.tar.gz" "0.3.2")
             ("bvi-1.4.1.src.tar.gz" "1.4.1")))))

(test-assert "latest-html-release, scheme-less URIs"
  (with-http-server
      `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<title>Releases (on another domain)!</title>
</head>
<body
<a href=\"//another-site/foo-2.tar.gz\">version 1</a>
</body>
</html>"))
    (let ()
      (define package
        (dummy-package "foo"
          (source
           (dummy-origin
            (uri (string-append (%local-url) "/foo-1.tar.gz"))))
          (properties
           `((release-monitoring-url . ,(%local-url))))))
      (define update ((upstream-updater-import %generic-html-updater) package))
      (define expected-new-url "http://another-site/foo-2.tar.gz")
      (and (pk 'u update)
           (equal? (upstream-source-version update) "2")
           (equal? (list expected-new-url) (upstream-source-urls update))))))

(test-assert "latest-html-release, no signature"
  (with-http-server
      `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<title>Releases!</title>
</head>
<body>
<a href=\"bar/foo-1.tar.gz\">version 1</a>
<a href=\"bar/foo-2.tar.gz\">version 2</a>
</body>
</html>"))
    (let ()
      (define package
        (dummy-package "foo"
          (source
           (dummy-origin
            (uri (string-append (%local-url) "/foo-1.tar.gz"))))
          (properties
           `((release-monitoring-url . ,(%local-url))))))
      (define update ((upstream-updater-import %generic-html-updater) package))
      (define expected-new-url
        (string-append (%local-url) "/foo-2.tar.gz"))
      (and (pk 'u update)
           (equal? (upstream-source-version update) "2")
           (equal? (list expected-new-url)
                   (upstream-source-urls update))
           (null? ;; both #false and the empty list are acceptable
            (or (upstream-source-signature-urls update) '()))))))

(test-assert "latest-html-release, signature"
  (with-http-server
      `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<title>Signed releases!</title>
</head>
<body>
<a href=\"bar/foo-1.tar.gz\">version 1</a>
<a href=\"bar/foo-2.tar.gz\">version 2</a>
<a href=\"bar/foo-1.tar.gz.sig\">version 1 signature</a>
<a href=\"bar/foo-2.tar.gz.sig\">version 2 signature</a>
</body>
</html>"))
    (let ()
      (define package
        (dummy-package "foo"
          (source
           (dummy-origin
            (uri (string-append (%local-url) "/foo-1.tar.gz"))))
          (properties
           `((release-monitoring-url . ,(%local-url))))))
      (define update ((upstream-updater-import %generic-html-updater) package))
      (define expected-new-url
        (string-append (%local-url) "/foo-2.tar.gz"))
      (define expected-signature-url
        (string-append (%local-url) "/foo-2.tar.gz.sig"))
      (and (pk 'u update)
           (equal? (upstream-source-version update) "2")
           (equal? (list expected-new-url)
                   (upstream-source-urls update))
           (equal? (list expected-signature-url)
                   (upstream-source-signature-urls update))))))

(test-equal "rewrite-url, to-version specified"
  "https://download.qt.io/official_releases/qt/6.5/6.5.2/\
submodules/qtbase-everywhere-src-6.5.2.tar.xz"
  (rewrite-url "https://download.qt.io/official_releases/qt/6.3/6.3.2/\
submodules/qtbase-everywhere-src-6.3.2.tar.xz" "6.3.2" #:to-version "6.5.2"))

(test-equal "rewrite-url, without to-version"
  "http://dist.libuv.example.org/dist/v1.46.0/libuv-v1.46.0.tar.gz"
  (with-http-server
      ;; First reply, crawling http://dist.libuv.example.org/dist/.
      `((200 "\
<!DOCTYPE html>
<html>
<head><title>Index of dist</title></head>
<body>
<a href=\"../\">../</a>
<a href=\"v1.44.0/\" title=\"v1.44.0/\">v1.44.0/</a>
<a href=\"v1.44.1/\" title=\"v1.44.1/\">v1.44.1/</a>
<a href=\"v1.44.2/\" title=\"v1.44.2/\">v1.44.2/</a>
<a href=\"v1.45.0/\" title=\"v1.45.0/\">v1.45.0/</a>
<a href=\"v1.46.0/\" title=\"v1.46.0/\">v1.46.0/</a>
</body>
</html>")
        ;; Second reply, crawling http://dist.libuv.example.org/dist/v1.46.0/.
        (200 "\
<!DOCTYPE html>
<html>
<head><title>Index of dist/v1.46.0</title></head>
<body>
<a href=\"../\">../</a>
<a href=\"libuv-v1.46.0-dist.tar.gz\" title=\"libuv-v1.46.0-dist.tar.gz\">
   libuv-v1.46.0-dist.tar.gz</a>
<a href=\"libuv-v1.46.0-dist.tar.gz.sign\"
   title=\"libuv-v1.46.0-dist.tar.gz.sign\">libuv-v1.46.0-dist.tar.gz.sign</a>
<a href=\"libuv-v1.46.0.tar.gz\" title=\"libuv-v1.46.0.tar.gz\">
   libuv-v1.46.0.tar.gz</a>
<a href=\"libuv-v1.46.0.tar.gz.sign\" title=\"libuv-v1.46.0.tar.gz.sign\">
   libuv-v1.46.0.tar.gz.sign</a>
</body>
</html>"))
    (parameterize ((current-http-proxy (%local-url)))
      (rewrite-url "http://dist.libuv.example.org/dist/v1.45.0/libuv-v1.45.0.tar.gz"
                   "1.45.0"))))

(test-end)
as Geerinckx-Rice 2020-03-14Merge branch 'master' into core-updatesMarius Bakke 2020-03-11gnu: Add python2-pygraphviz....* gnu/packages/graphviz.scm (python2-pygraphviz): New variable. Efraim Flashner 2020-03-04Merge branch 'master' into core-updatesMarius Bakke 2020-03-04gnu: Update pypi.python.org home pages & use HTTPS....* gnu/packages/check.scm (python-unittest2, python-pytest-localserver) (python-discover)[home-page]: Follow (HTTPS) redirections. * gnu/packages/fontutils.scm (python2-defcon)[home-page]: Likewise. * gnu/packages/glib.scm (python2-pygobject-2)[home-page]: Likewise. * gnu/packages/graph.scm (python-igraph)[home-page]: Likewise. * gnu/packages/graphviz.scm (xdot)[home-page]: Likewise. * gnu/packages/pdf.scm (python-poppler-qt5)[home-page]: Likewise. * gnu/packages/python-web.scm (python-zope-event, python-zope-testing) (python-zope-testrunner, python-zope-i18nmessageid, python-zope-schema) (python-zope-configuration, python-zope-proxy, python-zope-location) (python-zope-security))[home-page]: Likewise. * gnu/packages/python-xyz.scm (python-setuptools,python-six) (python2-dogtail, python2-enum, python-enum34, python-unidecode) (python-numpydoc, python-decorator, python-drmaa, python-pathlib2) (python-ly, python-msgpack, python-termcolor, python-colorama) (python-pluggy, python2-pathlib2, python-rfc3987)[home-page]: Likewise. Tobias Geerinckx-Rice 2020-01-22gnu: Replace uses of 'libjpeg' with 'libjpeg-turbo'....* gnu/packages/abiword.scm (abiword)[inputs]: Change from LIBJPEG to LIBJPEG-TURBO. * gnu/packages/admin.scm (testdisk)[inputs]: Likewise. * gnu/packages/algebra.scm (giac)[inputs]: Likewise. * gnu/packages/animation.scm (synfig)[inputs]: Likewise. * gnu/packages/astronomy.scm (gnuastro, celestia)[inputs]: Likewise. * gnu/packages/cdrom.scm (dvdstyler)[inputs]: Likewise. * gnu/packages/cran.scm (r-jpeg, r-tiff, r-readbitmap)[inputs]: Likewise. * gnu/packages/cups.scm (cups-filters, hplip)[inputs]: Likewise. * gnu/packages/display-managers.scm (slim)[inputs]: Likewise. * gnu/packages/ebook.scm (fbreader)[inputs]: Likewise. * gnu/packages/emacs.scm (emacs)[inputs]: Likewise. * gnu/packages/enlightenment.scm (efl)[propagated-inputs]: Likewise. * gnu/packages/fltk.scm (fltk, ntk)[inputs]: Likewise. * gnu/packages/fontutils.scm (fontforge)[inputs]: Likewise. * gnu/packages/freedesktop.scm (weston)[inputs]: Likewise. * gnu/packages/game-development.scm (sfml, allegro, aseprite, python-pygame, eureka, ioquake3)[inputs]: Likewise. * gnu/packages/games.scm (adanaxisgpl, freedroidrpg, irrlicht, minetest, fizmo, supertuxkart, gzdoom, xmoto, xonotic)[inputs]: Likewise. * gnu/packages/gd.scm (gd, perl-gd)[inputs]: Likewise. * gnu/packages/ghostscript.scm (lcms)[inputs]: Likewise. (ghostscript)[inputs, native-inputs]: Likewise. * gnu/packages/gimp.scm (gegl, gimp)[inputs]: Likewise. * gnu/packages/gnome.scm (libgnomeui, eog, tracker-miners, gthumb)[inputs]: Likewise. * gnu/packages/gnunet.scm (libextractor)[inputs]: Likewise. * gnu/packages/gnustep.scm (windowmaker)[inputs]: Likewise. * gnu/packages/graphics.scm (blender, blender-2.79, openimageio, openscenegraph, openscenegraph-3.4, povray, fgallery)[inputs]: Likewise. * gnu/packages/graphviz.scm (graphviz)[inputs]: Likewise. * gnu/packages/gstreamer.scm (gst-plugins-good)[inputs]: Likewise. * gnu/packages/gtk.scm (gdk-pixbuf)[inputs]: Likewise. * gnu/packages/image-processing.scm (dcmtk, mia, vtk, opencv, vips, nip2, vxl, insight-toolkit)[inputs]: Likewise. * gnu/packages/image-viewers.scm (gpicview, luminance-hdr)[inputs]: Likewise. * gnu/packages/image.scm (jpegoptim, libtiff, leptonica, imlib2, freeimage, vigra, libwebp, libmng, jasper, steghide, jp2a)[inputs]: Likewise. * gnu/packages/imagemagick.scm (imagemagick, graphicsmagick)[inputs]: Likewise. * gnu/packages/java.scm (icedtea-6, icedtea-7, openjdk9, openjdk11, openjdk12)[inputs]: Likewise. * gnu/packages/kde-frameworks.scm (khtml)[inputs]: Likewise. * gnu/packages/kodi.scm (kodi)[inputs]: Likewise. * gnu/packages/machine-learning.scm (dlib, tensorflow)[inputs]: Likewise. * gnu/packages/mate.scm (atril, eom)[inputs]: Likewise. * gnu/packages/maths.scm (hdf4, hdf-java, hdf-eos2, netcdf)[inputs]: Likewise. * gnu/packages/netpbm.scm (netpbm)[inputs]: Likewise. * gnu/packages/pdf.scm (zathura-pdf-mupdf, podofo, mupdf, fbida)[inputs]: Likewise. * gnu/packages/photo.scm (libraw, libpano13, enblend-enfuse, darktable, hugin, rawtherapee)[inputs]: Likewise. * gnu/packages/prolog.scm (swi-prolog)[native-inputs]: Likewise. * gnu/packages/python-xyz.scm (python-hdf4, python-pillow)[inputs]: Likewise. * gnu/packages/qt.scm (qtbase, qtwebkit)[inputs]: Likewise. * gnu/packages/rdesktop.scm (freerdp)[inputs]: Likewise. * gnu/packages/scanner.scm (sane-backends, xsane)[inputs]: Likewise. * gnu/packages/scheme.scm (racket)[inputs]: Likewise. * gnu/packages/scribus.scm (scribus)[inputs]: Likewise. * gnu/packages/sdl.scm (sdl-image)[propagated-inputs]: Likewise. (guile-sdl)[native-inputs]: Likewise. * gnu/packages/spice.scm (spice-gtk)[inputs]: Likewise. * gnu/packages/statistics.scm (r-with-tests)[inputs]: Likewise. * gnu/packages/tcl.scm (perl-tk)[inputs]: Likewise. * gnu/packages/upnp.scm (readymedia)[inputs]: Likewise. * gnu/packages/video.scm (mplayer, mpv, v4l-utils, motion)[inputs]: Likewise. * gnu/packages/web-browsers.scm (dillo, links)[inputs]: Likewise. * gnu/packages/web.scm (netsurf)[inputs]: Likewise. * gnu/packages/webkit.scm (webkitgtk)[inputs]: Likewise. * gnu/packages/wine.scm (wine)[inputs]: Likewise. * gnu/packages/wv.scm (wv)[inputs]: Likewise. * gnu/packages/wxwidgets.scm (wxwidgets, wxwidgets-2)[inputs]: Likewise. * gnu/packages/xdisorg.scm (xscreensaver)[inputs]: Likewise. * gnu/packages/xfce.scm (tumbler)[inputs]: Likewise. * gnu/packages/xfig.scm (xfig, transfig)[inputs]: Likewise. * gnu/packages/xorg.scm (xpra)[inputs]: Likewise. Marius Bakke 2020-01-21Merge branch 'staging' into core-updatesMarius Bakke 2020-01-16gnu: python-graphviz: Update to 0.13.2....* gnu/packages/graphviz.scm (python-graphviz): Update to 0.13.2. [native-inputs]: Add GRAPHVIZ, PYTHON-MOCK, PYTHON-PYTEST, PYTHON-PYTEST-COV, and PYTHON-PYTEST-MOCK. [arguments]: Replace 'check' phase. Marius Bakke 2020-01-15Merge branch 'master' into core-updatesMarius Bakke 2020-01-12gnu: dot2tex: Update to 2.11.3....* gnu/packages/graphviz.scm (dot2tex): Update to 2.11.3. Signed-off-by: Marius Bakke <mbakke@fastmail.com> Jakub Kądziołka