diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-07-03 18:08:54 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-07-03 18:08:54 +0800 |
commit | 8772b7b4be47e146625649e5a6e591a8b457b946 (patch) | |
tree | 76e72301efa7f6151118521d1b2fe7df3296eee6 | |
parent | e43b7e7eb87b65b09cf4c28354d0bf500ee4f537 (diff) |
current: Use GitHub API for applicable packages
-rw-r--r-- | lfs-latest-git.php | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/lfs-latest-git.php b/lfs-latest-git.php index 86147386c..de8f89563 100644 --- a/lfs-latest-git.php +++ b/lfs-latest-git.php @@ -12,12 +12,10 @@ $exceptions = array(); $regex = array(); //$regex[ 'bzip2' ] = "/^.*current version is ([\d\.]+).*$/"; -$regex[ 'check' ] = "/^.*Check (\d[\d\.]+\d).*$/"; $regex[ 'intltool' ] = "/^.*Latest version is (\d[\d\.]+\d).*$/"; $regex[ 'less' ] = "/^.*current released version is less-(\d+).*$/"; $regex[ 'mpfr' ] = "/^mpfr-([\d\.]+)\.tar.*$/"; $regex[ 'Python' ] = "/^.*Latest Python 3.*Python (3[\d\.]+\d).*$/"; -$regex[ 'systemd' ] = "/^.*systemd v([\d]+)$/"; //$regex[ 'sysvinit' ] = "/^.*sysvinit-([\d\.]+)dsf\.tar.*$/"; $regex[ 'tzdata' ] = "/^.*tzdata([\d]+[a-z]).*$/"; $regex[ 'xz' ] = "/^.*xz-([\d\.]*\d).*$/"; @@ -120,40 +118,40 @@ function get_packages( $package, $dirpath ) //if ( $package != "psmisc" ) return 0; // debug -if ( $package == "bc" ) $dirpath = "https://github.com/gavinhoward/bc/releases"; -if ( $package == "check" ) $dirpath = "https://github.com/libcheck/check/releases"; +if ( $package == "bc" ) $dirpath = github("gavinhoward/bc"); +if ( $package == "check" ) $dirpath = github("libcheck/check"); if ( $package == "e2fsprogs" ) $dirpath = "https://sourceforge.net/projects/e2fsprogs/files/e2fsprogs"; if ( $package == "expat" ) $dirpath = "https://sourceforge.net/projects/expat/files"; if ( $package == "elfutils" ) $dirpath = "https://sourceware.org/ftp/elfutils"; if ( $package == "expect" ) $dirpath = "https://sourceforge.net/projects/expect/files"; -if ( $package == "eudev" ) $dirpath = "https://github.com/eudev-project/eudev/releases"; +if ( $package == "eudev" ) $dirpath = github("eudev-project/eudev"); if ( $package == "file" ) $dirpath = "https://github.com/file/file/tags"; -if ( $package == "flex" ) $dirpath = "https://github.com/westes/flex/releases"; +if ( $package == "flex" ) $dirpath = github("westes/flex"); if ( $package == "flit_core" ) $dirpath = "https://pypi.org/project/flit-core/"; if ( $package == "gcc" ) $dirpath = max_parent( $dirpath, "gcc-" ); -if ( $package == "iana-etc" ) $dirpath = "https://github.com/Mic92/iana-etc/releases"; +if ( $package == "iana-etc" ) $dirpath = github("Mic92/iana-etc"); if ( $package == "intltool" ) $dirpath = "https://launchpad.net/intltool/trunk"; -if ( $package == "libffi" ) $dirpath = "https://github.com/libffi/libffi/releases"; +if ( $package == "libffi" ) $dirpath = github("libffi/libffi"); if ( $package == "libxcrypt" ) $dirpath = github("besser82/libxcrypt"); -if ( $package == "meson" ) $dirpath = "https://github.com/mesonbuild/meson/releases"; +if ( $package == "meson" ) $dirpath = github("mesonbuild/meson"); if ( $package == "mpc" ) $dirpath = "https://ftp.gnu.org/gnu/mpc"; if ( $package == "mpfr" ) $dirpath = "https://mpfr.loria.fr/mpfr-current"; if ( $package == "ncurses" ) $dirpath = "https://invisible-mirror.net/archives/ncurses"; -if ( $package == "ninja" ) $dirpath = "https://github.com/ninja-build/ninja/releases"; +if ( $package == "ninja" ) $dirpath = github("ninja-build/ninja"); if ( $package == "procps-ng" ) $dirpath = "https://gitlab.com/procps-ng/procps/-/tags"; if ( $package == "psmisc" ) $dirpath = "https://gitlab.com/psmisc/psmisc/-/tags"; if ( $package == "Python" ) $dirpath = "https://www.python.org/downloads/source/"; -if ( $package == "shadow" ) $dirpath = "https://github.com/shadow-maint/shadow/releases"; -if ( $package == "sysvinit" ) $dirpath = "https://github.com/slicer69/sysvinit/releases"; +if ( $package == "shadow" ) $dirpath = github("shadow-maint/shadow"); +if ( $package == "sysvinit" ) $dirpath = github("slicer69/sysvinit"); if ( $package == "MarkupSafe" ) $dirpath = "https://pypi.python.org/pypi/MarkupSafe/"; if ( $package == "Jinja" ) $dirpath = "https://pypi.python.org/pypi/Jinja2/"; -if ( $package == "systemd" ) $dirpath = "https://github.com/systemd/systemd/releases"; +if ( $package == "systemd" ) $dirpath = github("systemd/systemd"); //if ( $package == "tcl" ) $dirpath = "https://sourceforge.net/projects/tcl/files"; if ( $package == "tcl" ) $dirpath = "https://www.tcl.tk/software/tcltk/download.html"; if ( $package == "util-linux" ) $dirpath = max_parent( $dirpath, "v." ); if ( $package == "vim" ) $dirpath = "https://github.com/vim/vim/tags"; if ( $package == "wheel" ) $dirpath = "https://pypi.org/project/wheel/#files"; -if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/releases"; +if ( $package == "zstd" ) $dirpath = github("facebook/zstd"); // Check for ftp if ( preg_match( "/^ftp/", $dirpath ) ) @@ -272,18 +270,6 @@ if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/rel if ( $package == "elfutils" ) return find_max( $lines, "/^\d/", "/^(\d[\d\.]+\d)\/.*$/" ); - if ( $package == "iana-etc" ) - return find_max( $lines, "/^\s*20\d\d/", "/^\s+(\d+).*$/" ); - - if ( $package == "meson" ) - return find_max( $lines, "/^\s+\d\./", "/^\s+([\d\.]+)$/" ); - - if ( $package == "shadow" ) - return find_max( $lines, "/^\s+\d\./", "/^\s+([\d\.]+)$/" ); - - if ( $package == "sysvinit" ) - return find_max( $lines, "/^\s+\d\./", "/^\s+([\d\.]+)$/" ); - if ( $package == "XML-Parser" ) { $max = find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d).tar.*$/" ); @@ -295,9 +281,6 @@ if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/rel if ( $package == "tcl" ) return find_max( $lines, "/tcl\d/", "/^.*tcl(\d\.[\d\.]*\d)-src.*$/" ); - if ( $package == "ninja" ) - return find_max( $lines, "/^ *v\d/", "/^.*v(\d[\d\.]*\d).*$/" ); - if ( $package == "gmp" ) return find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d[a-z]?).tar.*$/" ); @@ -310,9 +293,6 @@ if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/rel return str_replace( "_", ".", $max ); } - if ( $package == "libffi" ) - return find_max( $lines, "/v\d/", "/^.*v([\d\.]+)$/" ); - if ( $package == "flit_core" ) return find_max( $lines, "/flit-core /", "/^.*flit-core ([\d\.]+)$/" ); |