Fix "./unrealircd upgrade" (and ./Config -quick) problem with local-curl.

First, what we call local-curl is a situation where the system does not have
the cURL library installed and UnrealIRCd offers to compile and use it.

The problem is that CURLDIR in config.settings may refer to an old directory
such as /home/xyz/unrealircd-5.2.1/extras/curl and UnrealIRCd 6 would try to
use it. That would be problematic as it would result in: 1) no cURL updates
anymore since it is only half-detected as local-curl, and 2) once you remove
the unrealircd-5.2.1 directory (since you are on U6) it breaks as well.

So, we now check for this situation and in case of something that looks like
a local-curl situation, change the path to <currentunreal>/extras/curl and
download and compile cURL fresh, as expected.

All this is only for the like 1% users that uses local-curl, which then
used ./unrealircd upgrade or ./Config -quick.

Reported by CrazyCat on the forums.
This commit is contained in:
Bram Matthys 2021-12-29 10:48:41 +01:00
parent 73be662db2
commit c5cb19dc5d
No known key found for this signature in database
GPG key ID: BF8116B163EAAE98

16
Config
View file

@ -50,6 +50,18 @@ ARG="$ARG--enable-ssl "
else
ARG="$ARG--enable-ssl=$SSLDIR "
fi
# Ensure we install curl even if someone does ./Config -quick...
if [ "x$CURLDIR" = "x$UNREALCWD/extras/curl" ]; then
INSTALLCURL=1
else
# And that the path does not refer to eg an old unrealircd-1.2.3 either ;)
if echo "$CURLDIR"|egrep -qi extras.*curl; then
echo "WARNING: Potentially old cURL directory encountered ($CURLDIR)."
echo "I am changing the cURL directory to $UNREALCWD/extras/curl and forcing a rebuild of cURL."
CURLDIR="$UNREALCWD/extras/curl"
INSTALLCURL=1
fi
fi
if [ "$REMOTEINC" = "1" ] ; then
ARG="$ARG--enable-libcurl=$CURLDIR "
fi
@ -84,10 +96,6 @@ ARG="$ARG $EXTRAPARA "
CONF="./configure $ARG"
# remove possibly old instances of curl in ~/unrealircd/lib/
rm -f $PRIVATELIBDIR/*curl* 1>/dev/null 2>&1
# Ensure we install curl even if someone does ./Config -quick...
if [ "x$CURLDIR" = "x$UNREALCWD/extras/curl" ]; then
INSTALLCURL=1
fi
if [ "x$INSTALLCURL" = "x1" ]; then
extras/curlinstall "$PRIVATELIBDIR" || exit 1
fi