feat(build_helper): use 'id' command instead $USER variable

When $USER is not set (Yes we did !), extracting protobuf fails.
Wh avoid this by using the 'id' command both to get user and group ids.
This commit is contained in:
Frédéric Leroy
2020-11-09 14:55:02 +01:00
parent 1426ee5ed6
commit 6338831315
+1 -1
View File
@@ -256,7 +256,7 @@ install_protobuf_from_source(){
then
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
wget --tries=3 --retry-connrefused https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $(groups | cut -d" " -f1) --no-same-owner
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $($id -u) --group $(id -g) --no-same-owner
cd protobuf-3.3.0/
else
export LD_LIBRARY_PATH=/usr/local/lib #protoc needs to know where toclook for shared libs