1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Fix some lib version checks in checklibs.sh

This commit is contained in:
dmiller
2023-04-28 15:01:19 +00:00
parent 585832c41e
commit 909b022bd7

View File

@@ -3,7 +3,7 @@
NDIR=${NDIR:-$PWD} NDIR=${NDIR:-$PWD}
newest() { newest() {
perl -nE'END{$,=".";say unpack"C*",$m}$m=($m,$n)[($n=pack"C*",split/\./) gt$m]' sort -V | tail -n 1
} }
trim_version() { trim_version() {
@@ -11,13 +11,13 @@ trim_version() {
} }
check_libpcre() { check_libpcre() {
PCRE_SOURCE="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/" PCRE_SOURCE="https://sourceforge.net/projects/pcre/files/latest/download"
PCRE_MAJOR="" PCRE_MAJOR=""
PCRE_MINOR="" PCRE_MINOR=""
eval $(grep '^PCRE_MAJOR=' $NDIR/libpcre/configure) eval $(grep '^PCRE_MAJOR=' $NDIR/libpcre/configure)
eval $(grep '^PCRE_MINOR=' $NDIR/libpcre/configure) eval $(grep '^PCRE_MINOR=' $NDIR/libpcre/configure)
PCRE_VERSION="$PCRE_MAJOR.$PCRE_MINOR" PCRE_VERSION="$PCRE_MAJOR.$PCRE_MINOR"
PCRE_LATEST=$(curl -ls $PCRE_SOURCE | perl -lne 'if(/pcre-(\d+.\d+).tar.gz$/){print $1}' | newest) PCRE_LATEST=$(curl -s -I $PCRE_SOURCE | perl -lne 'if(/pcre-(\d+.\d+).zip/){print $1}' | newest)
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
@@ -27,7 +27,7 @@ check_libpcre() {
} }
check_libpcap() { check_libpcap() {
PCAP_SOURCE="http://www.tcpdump.org/release/" PCAP_SOURCE="https://www.tcpdump.org/release/"
PCAP_VERSION=$(cat $NDIR/libpcap/VERSION) PCAP_VERSION=$(cat $NDIR/libpcap/VERSION)
PCAP_LATEST=$(curl -s $PCAP_SOURCE | perl -lne 'if(/libpcap-([\d.]+).tar.gz/){print $1}' | newest) PCAP_LATEST=$(curl -s $PCAP_SOURCE | perl -lne 'if(/libpcap-([\d.]+).tar.gz/){print $1}' | newest)
if [ "$PCAP_VERSION" != "$PCAP_LATEST" ]; then if [ "$PCAP_VERSION" != "$PCAP_LATEST" ]; then