pin protoc to 3.5.1

This commit is contained in:
Ding Xiang Fei
2018-05-23 15:32:57 +08:00
committed by Romain Ruetschi
parent 2356719da9
commit 622a8d7256

View File

@ -1,8 +1,22 @@
#!/usr/bin/bash
set -e
if [ ! -d "$HOME/protobuf/lib" ]; then
wget https://github.com/google/protobuf/archive/v3.5.1.tar.gz
tar -xzvf v3.5.1.tar.gz
cd protobuf-3.5.1 && ./autogen.sh && ./configure --prefix=$HOME/protobuf && make && make install
check_protoc_version () {
version="libprotoc $1"
PROTOC="$HOME/protobuf/bin/protoc"
if [ -f $PROTOC ]; then
this_version=`$PROTOC --version`
return `[ "$version" = "$this_version" ]`
else
return 1
fi
}
if check_protoc_version '3.5.1'; then
echo protoc version 3.5.1 detected.
exit
fi
wget https://github.com/google/protobuf/archive/v3.5.1.tar.gz
tar -xzvf v3.5.1.tar.gz
cd protobuf-3.5.1 && ./autogen.sh && ./configure --prefix=$HOME/protobuf && make && make install