Fix the build on NixOS

On NixOS, the lsb_release command returns strings such as "NixOS"
and "22.04" (with the quotes included). This leads to compilation
problems because the updateminiupnpcstrings.sh scripts ends up
creating a C file with the following content:

The fix is to simply strip the quotes from the lsb_release output.
This commit is contained in:
Zahary Karadjov 2022-03-21 19:25:57 +02:00
parent fda61180e0
commit 689d1fdd04
1 changed files with 5 additions and 2 deletions

View File

@ -25,11 +25,14 @@ if [ -f /etc/debian_version ]; then
OS_NAME=Debian
OS_VERSION=`cat /etc/debian_version`
fi
# use lsb_release (Linux Standard Base) when available
LSB_RELEASE=`which lsb_release`
if [ 0 -eq $? -a -x "${LSB_RELEASE}" ]; then
OS_NAME=`${LSB_RELEASE} -i -s`
OS_VERSION=`${LSB_RELEASE} -r -s`
# On NixOS, lsb_release returns strings such as "NixOS" (with quotes),
# so we need to stript them with the following xargs trick:
OS_NAME=`${LSB_RELEASE} -i -s | xargs echo`
OS_VERSION=`${LSB_RELEASE} -r -s | xargs echo`
case $OS_NAME in
Debian)
#OS_VERSION=`${LSB_RELEASE} -c -s`