aboutsummaryrefslogtreecommitdiffstats
path: root/lfs-latest-git.php
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-07-03 17:48:44 +0800
committerXi Ruoyao <xry111@xry111.site>2023-07-03 17:53:41 +0800
commite43b7e7eb87b65b09cf4c28354d0bf500ee4f537 (patch)
tree41009960c7fef5db9930dc45f65d009dfff5b05b /lfs-latest-git.php
parentbf7d32821e6d6525e8f550f3f4c49d3436a22468 (diff)
currency: Add libxcrypt
Diffstat (limited to 'lfs-latest-git.php')
-rw-r--r--lfs-latest-git.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lfs-latest-git.php b/lfs-latest-git.php
index 8f933a30e..86147386c 100644
--- a/lfs-latest-git.php
+++ b/lfs-latest-git.php
@@ -108,6 +108,11 @@ function max_parent( $dirpath, $prefix )
return "$dirpath/$max";
}
+function github( $path )
+{
+ return "https://api.github.com/repos/$path/releases/latest";
+}
+
function get_packages( $package, $dirpath )
{
global $exceptions;
@@ -129,6 +134,7 @@ if ( $package == "gcc" ) $dirpath = max_parent( $dirpath, "gcc-" );
if ( $package == "iana-etc" ) $dirpath = "https://github.com/Mic92/iana-etc/releases";
if ( $package == "intltool" ) $dirpath = "https://launchpad.net/intltool/trunk";
if ( $package == "libffi" ) $dirpath = "https://github.com/libffi/libffi/releases";
+if ( $package == "libxcrypt" ) $dirpath = github("besser82/libxcrypt");
if ( $package == "meson" ) $dirpath = "https://github.com/mesonbuild/meson/releases";
if ( $package == "mpc" ) $dirpath = "https://ftp.gnu.org/gnu/mpc";
if ( $package == "mpfr" ) $dirpath = "https://mpfr.loria.fr/mpfr-current";
@@ -331,6 +337,9 @@ if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/rel
if ( $package == "zstd" )
return find_max( $lines, "/Zstandard v/", "/^.*v([\d\.]+).*$/" );
+ if ( preg_match( "/api.github.com/", $dirpath) )
+ return ltrim(json_decode(join("", $lines))->tag_name, "v");
+
// Most packages are in the form $package-n.n.n
// Occasionally there are dashes (e.g. 201-1)
return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d)\.tar.*$/" );