diff --git a/versions b/versions index 3cc551fd1f81fbe3e68990bdf8746e8be891e484..1c1567037cb92bba676b7c4b98ebdb7398976867 100755 --- a/versions +++ b/versions @@ -5,6 +5,11 @@ # For packages only, similar information can be found on Repology: # https://repology.org/project/mpfr/versions +# A Mozilla/5.0 User-Agent header is provided to avoid a "Forbidden" error +# with some websites, but for repology.org, this is the opposite! Note that +# this script is intended to be run manually from time to time, contrary to +# a usual robot. + # Usage: versions [ <site> ... ] use strict; @@ -21,6 +26,7 @@ sub getvers ($$$;$) if ($url ne $oldurl) { my $ua = LWP::UserAgent->new; + $ua->agent('Mozilla/5.0'); $ua->timeout(30); my $response = $ua->get($url); unless ($response->is_success) @@ -246,14 +252,15 @@ getvers "Microsoft vcpkg", "https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/mpfr/vcpkg.json", qr!"version": "([-0-9.]+)"!; -# https://doc.sagemath.org/html/en/reference/spkg/mpfr.html -# cannot be used directly (fetch error). getvers "SAGE (reference)", - "https://repology.org/project/mpfr/versions", - sub { - my @v = sort vsort ($file =~ m!<a href="https://doc.sagemath.org/html/en/reference/spkg/mpfr.html">([0-9.]+)</a>!g); - $v[$#v]; - }; + "https://doc.sagemath.org/html/en/reference/spkg/mpfr.html", + qr!package-version.txt:.*?>([0-9.]+)<!s; + +# "https://repology.org/project/mpfr/versions", +# sub { +# my @v = sort vsort ($file =~ m!<a href="https://doc.sagemath.org/html/en/reference/spkg/mpfr.html">([0-9.]+)</a>!g); +# $v[$#v]; +# }; getvers "SAGE (upstream)", "http://www-ftp.lip6.fr/pub/math/sagemath/spkg/upstream/mpfr/index.html", @@ -266,4 +273,4 @@ getvers "Termux", "https://packages.termux.dev/apt/termux-main/pool/main/libm/libmpfr/", qr!libmpfr_([-0-9.a-z]+)_\S+\.deb!; -# $Id: versions 177518 2025-03-21 13:17:27Z vinc17/qaa $ +# $Id: versions 177641 2025-03-25 11:28:01Z vinc17/cventin $