Fix bootstrap version computing with custom bc (#978)

When i have ~/.bc configuration file with content:
scale=2
which is changing default behaviour (scale=0), bootstrap is not working.
This commit is contained in:
Michal Josef Špaček 2022-11-17 14:31:35 +01:00 committed by GitHub
parent a8f5813b84
commit ae212a792e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,16 +17,16 @@ fi
BROTLI_ABI_HEX=`sed -n 's/#define BROTLI_ABI_VERSION 0x//p' c/common/version.h` BROTLI_ABI_HEX=`sed -n 's/#define BROTLI_ABI_VERSION 0x//p' c/common/version.h`
BROTLI_ABI_INT=`echo "ibase=16;$BROTLI_ABI_HEX" | bc` BROTLI_ABI_INT=`echo "ibase=16;$BROTLI_ABI_HEX" | bc`
BROTLI_ABI_CURRENT=`echo "$BROTLI_ABI_INT / 16777216" | bc` BROTLI_ABI_CURRENT=`echo "scale=0;$BROTLI_ABI_INT / 16777216" | bc`
BROTLI_ABI_REVISION=`echo "$BROTLI_ABI_INT / 4096 % 4096" | bc` BROTLI_ABI_REVISION=`echo "scale=0;$BROTLI_ABI_INT / 4096 % 4096" | bc`
BROTLI_ABI_AGE=`echo "$BROTLI_ABI_INT % 4096" | bc` BROTLI_ABI_AGE=`echo "scale=0;$BROTLI_ABI_INT % 4096" | bc`
BROTLI_ABI_INFO="$BROTLI_ABI_CURRENT:$BROTLI_ABI_REVISION:$BROTLI_ABI_AGE" BROTLI_ABI_INFO="$BROTLI_ABI_CURRENT:$BROTLI_ABI_REVISION:$BROTLI_ABI_AGE"
BROTLI_VERSION_HEX=`sed -n 's/#define BROTLI_VERSION 0x//p' c/common/version.h` BROTLI_VERSION_HEX=`sed -n 's/#define BROTLI_VERSION 0x//p' c/common/version.h`
BROTLI_VERSION_INT=`echo "ibase=16;$BROTLI_VERSION_HEX" | bc` BROTLI_VERSION_INT=`echo "ibase=16;$BROTLI_VERSION_HEX" | bc`
BROTLI_VERSION_MAJOR=`echo "$BROTLI_VERSION_INT / 16777216" | bc` BROTLI_VERSION_MAJOR=`echo "scale=0;$BROTLI_VERSION_INT / 16777216" | bc`
BROTLI_VERSION_MINOR=`echo "$BROTLI_VERSION_INT / 4096 % 4096" | bc` BROTLI_VERSION_MINOR=`echo "scale=0;$BROTLI_VERSION_INT / 4096 % 4096" | bc`
BROTLI_VERSION_PATCH=`echo "$BROTLI_VERSION_INT % 4096" | bc` BROTLI_VERSION_PATCH=`echo "scale=0;$BROTLI_VERSION_INT % 4096" | bc`
BROTLI_VERSION="$BROTLI_VERSION_MAJOR.$BROTLI_VERSION_MINOR.$BROTLI_VERSION_PATCH" BROTLI_VERSION="$BROTLI_VERSION_MAJOR.$BROTLI_VERSION_MINOR.$BROTLI_VERSION_PATCH"
sed -i.bak "$SED_ERE" "s/[0-9]+:[0-9]+:[0-9]+/$BROTLI_ABI_INFO/" Makefile.am sed -i.bak "$SED_ERE" "s/[0-9]+:[0-9]+:[0-9]+/$BROTLI_ABI_INFO/" Makefile.am