From ae212a792e470b7a07dbb8fb4a5b3d78e1de78d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Josef=20=C5=A0pa=C4=8Dek?= Date: Thu, 17 Nov 2022 14:31:35 +0100 Subject: [PATCH] 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. --- bootstrap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bootstrap b/bootstrap index 6312953..1da6d60 100755 --- a/bootstrap +++ b/bootstrap @@ -17,16 +17,16 @@ fi 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_CURRENT=`echo "$BROTLI_ABI_INT / 16777216" | bc` -BROTLI_ABI_REVISION=`echo "$BROTLI_ABI_INT / 4096 % 4096" | bc` -BROTLI_ABI_AGE=`echo "$BROTLI_ABI_INT % 4096" | bc` +BROTLI_ABI_CURRENT=`echo "scale=0;$BROTLI_ABI_INT / 16777216" | bc` +BROTLI_ABI_REVISION=`echo "scale=0;$BROTLI_ABI_INT / 4096 % 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_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_MAJOR=`echo "$BROTLI_VERSION_INT / 16777216" | bc` -BROTLI_VERSION_MINOR=`echo "$BROTLI_VERSION_INT / 4096 % 4096" | bc` -BROTLI_VERSION_PATCH=`echo "$BROTLI_VERSION_INT % 4096" | bc` +BROTLI_VERSION_MAJOR=`echo "scale=0;$BROTLI_VERSION_INT / 16777216" | bc` +BROTLI_VERSION_MINOR=`echo "scale=0;$BROTLI_VERSION_INT / 4096 % 4096" | bc` +BROTLI_VERSION_PATCH=`echo "scale=0;$BROTLI_VERSION_INT % 4096" | bc` 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