From 349bbc5adab5c8e332cee5d4a0dfd77093e403b4 Mon Sep 17 00:00:00 2001 From: Tomas Abrahamsson Date: Tue, 12 Dec 2023 09:12:20 +0100 Subject: [PATCH] Resuscitate import-protobuf-protos Make it able to find the version again from recent protobuf repos. --- helpers/import-protobuf-protos | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/helpers/import-protobuf-protos b/helpers/import-protobuf-protos index 3002174d..3edb5318 100755 --- a/helpers/import-protobuf-protos +++ b/helpers/import-protobuf-protos @@ -31,14 +31,26 @@ cd "$repotop" echo protobuf_shortsha=$(cd "$local_protobuf_repo" && git log -1 --format="%h") -protobuf_version=$(cat "$local_protobuf_repo"/CHANGES.txt | \ - awk '/.* version .*/ { \ +if [ -f "$local_protobuf_repo"/CMakeLists.txt ] +then + protobuf_version=$(grep set.protobuf_VERSION_STRING \ + "$local_protobuf_repo"/CMakeLists.txt | \ + cut -d'"' -f2) +elif [ -f "$local_protobuf_repo"/CHANGES.txt ] +then + protobuf_version=$(cat "$local_protobuf_repo"/CHANGES.txt | \ + awk '/.* version .*/ { \ for (i=1;i "$dest" <> "$dest"