1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Follow redirects in checklibs

This commit is contained in:
dmiller
2024-02-26 18:29:05 +00:00
parent c8e0732f5a
commit 3d3d718634

View File

@@ -17,7 +17,7 @@ check_libpcre() {
eval $(grep '^PCRE2_MAJOR=' $NDIR/libpcre/configure) eval $(grep '^PCRE2_MAJOR=' $NDIR/libpcre/configure)
eval $(grep '^PCRE2_MINOR=' $NDIR/libpcre/configure) eval $(grep '^PCRE2_MINOR=' $NDIR/libpcre/configure)
PCRE_VERSION="$PCRE2_MAJOR.$PCRE2_MINOR" PCRE_VERSION="$PCRE2_MAJOR.$PCRE2_MINOR"
PCRE_LATEST=$(curl -s -I $PCRE_SOURCE | tee tmp.txt | perl -lne 'if(m|^Location:.*/tag/pcre2-(\d+.\d+)[\r\n]*$|){print $1;exit(0)}') PCRE_LATEST=$(curl -Ls -I $PCRE_SOURCE | tee tmp.txt | perl -lne 'if(m|^Location:.*/tag/pcre2-(\d+.\d+)[\r\n]*$|){print $1;exit(0)}')
if [ "$PCRE_VERSION" != "$PCRE_LATEST" ]; then if [ "$PCRE_VERSION" != "$PCRE_LATEST" ]; then
echo "Newer version of libpcre available" echo "Newer version of libpcre available"
echo " Current:" $PCRE_VERSION echo " Current:" $PCRE_VERSION
@@ -31,7 +31,7 @@ check_libpcre() {
check_libpcap() { check_libpcap() {
PCAP_SOURCE="https://www.tcpdump.org/release/" PCAP_SOURCE="https://www.tcpdump.org/release/"
PCAP_VERSION=$(cat $NDIR/libpcap/VERSION 2>/dev/null || cat $NDIR/libpcap/VERSION.txt) PCAP_VERSION=$(cat $NDIR/libpcap/VERSION 2>/dev/null || cat $NDIR/libpcap/VERSION.txt)
PCAP_LATEST=$(curl -s $PCAP_SOURCE | perl -lne 'if(/libpcap-([\d.]+).tar.gz/){print $1}' | newest) PCAP_LATEST=$(curl -Ls $PCAP_SOURCE | perl -lne 'if(/libpcap-([\d.]+).tar.gz/){print $1}' | newest)
if [ "$PCAP_VERSION" != "$PCAP_LATEST" ]; then if [ "$PCAP_VERSION" != "$PCAP_LATEST" ]; then
echo "Newer version of libpcap available" echo "Newer version of libpcap available"
echo " Current:" $PCAP_VERSION echo " Current:" $PCAP_VERSION
@@ -56,7 +56,7 @@ EOC
LUA_VERSION=$(./check_liblua) LUA_VERSION=$(./check_liblua)
LUA_VERSION=${LUA_VERSION#Lua } LUA_VERSION=${LUA_VERSION#Lua }
rm check_liblua check_liblua.c rm check_liblua check_liblua.c
LUA_LATEST=$(curl -s $LUA_SOURCE | perl -lne 'if(/lua-([\d.]+).tar.gz/){print $1}' | newest) LUA_LATEST=$(curl -Ls $LUA_SOURCE | perl -lne 'if(/lua-([\d.]+).tar.gz/){print $1}' | newest)
if [ "$LUA_VERSION" != "$LUA_LATEST" ]; then if [ "$LUA_VERSION" != "$LUA_LATEST" ]; then
echo "Newer version of liblua available" echo "Newer version of liblua available"
echo " Current:" $LUA_VERSION echo " Current:" $LUA_VERSION
@@ -70,14 +70,14 @@ EOC
check_liblinear() { check_liblinear() {
LINEAR_SOURCE="https://www.csie.ntu.edu.tw/~cjlin/liblinear/" LINEAR_SOURCE="https://www.csie.ntu.edu.tw/~cjlin/liblinear/"
echo "Can't check liblinear, no version information is available" echo "Can't check liblinear, no version information is available"
LINEAR_LATEST=$(curl -s $LINEAR_SOURCE | perl -lne 'if(/The current release \(([^)]+)\) of <b>LIBLINEAR/){print $1;exit 0}') LINEAR_LATEST=$(curl -Ls $LINEAR_SOURCE | perl -lne 'if(/The current release \(([^)]+)\) of <b>LIBLINEAR/){print $1;exit 0}')
echo " Latest:" $LINEAR_LATEST echo " Latest:" $LINEAR_LATEST
} }
check_zlib() { check_zlib() {
ZLIB_SOURCE="https://zlib.net/" ZLIB_SOURCE="https://zlib.net/"
ZLIB_VERSION=$(awk '$2=="ZLIB_VERSION"{print$3;exit}' $NDIR/libz/zlib.h | tr -d '"') ZLIB_VERSION=$(awk '$2=="ZLIB_VERSION"{print$3;exit}' $NDIR/libz/zlib.h | tr -d '"')
ZLIB_LATEST=$(curl -s $ZLIB_SOURCE | perl -lne 'if(/zlib-([\d.]+).tar.gz/){print $1}' | newest) ZLIB_LATEST=$(curl -Ls $ZLIB_SOURCE | perl -lne 'if(/zlib-([\d.]+).tar.gz/){print $1}' | newest)
if [ "$ZLIB_VERSION" != "$ZLIB_LATEST" ]; then if [ "$ZLIB_VERSION" != "$ZLIB_LATEST" ]; then
echo "Newer version of zlib available" echo "Newer version of zlib available"
echo " Current:" $ZLIB_VERSION echo " Current:" $ZLIB_VERSION
@@ -89,9 +89,9 @@ check_zlib() {
} }
check_libssh2() { check_libssh2() {
LIBSSH2_SOURCE="https://www.libssh2.org/download/" LIBSSH2_SOURCE="https://libssh2.org/download/"
LIBSSH2_VERSION=$(awk '$2=="LIBSSH2_VERSION"{print$3;exit}' $NDIR/libssh2/include/libssh2.h | tr -d '"') LIBSSH2_VERSION=$(awk '$2=="LIBSSH2_VERSION"{print$3;exit}' $NDIR/libssh2/include/libssh2.h | tr -d '"')
LIBSSH2_LATEST=$(curl -s $LIBSSH2_SOURCE | perl -lne 'if(/libssh2-([\d.]+).tar.gz/){print $1}' | newest) LIBSSH2_LATEST=$(curl -Ls $LIBSSH2_SOURCE | perl -lne 'if(/libssh2-([\d.]+).tar.gz/){print $1}' | newest)
if [ "$LIBSSH2_VERSION" != "$LIBSSH2_LATEST" ]; then if [ "$LIBSSH2_VERSION" != "$LIBSSH2_LATEST" ]; then
echo "Newer version of libssh2 available" echo "Newer version of libssh2 available"
echo " Current:" $LIBSSH2_VERSION echo " Current:" $LIBSSH2_VERSION