summaryrefslogtreecommitdiffstats
path: root/netdata-installer.sh
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-05-02 14:32:57 +0300
committerGitHub <noreply@github.com>2022-05-02 07:32:57 -0400
commitf389f8c7f0f24b3cde2f56cfd8dc771020fbf7d3 (patch)
tree4708694b451d4dce62c807814afbbfca6e3fe2e1 /netdata-installer.sh
parent444f4e470f87852ab4f3aac48dd7dd78df6a4827 (diff)
just a simple fix to avoid recompiling protobuf all the time (#12790)
* just a simple fix to avoid recompiling protobuf all the time on our development environments * added quotes * remove bashism
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-xnetdata-installer.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh
index 5bd2e94008..2bd871718a 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -618,6 +618,13 @@ bundle_protobuf() {
PROTOBUF_PACKAGE_VERSION="$(cat packaging/protobuf.version)"
+ if [ -f "${PWD}/externaldeps/protobuf/.version" ] && [ "${PROTOBUF_PACKAGE_VERSION}" = "$(cat "${PWD}/externaldeps/protobuf/.version")" ]
+ then
+ echo >&2 "Found compiled protobuf, same version, not compiling it again. Remove file '${PWD}/externaldeps/protobuf/.version' to recompile."
+ NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-bundled-protobuf"
+ return 0
+ fi
+
tmp="$(mktemp -d -t netdata-protobuf-XXXXXX)"
PROTOBUF_PACKAGE_BASENAME="protobuf-cpp-${PROTOBUF_PACKAGE_VERSION}.tar.gz"
@@ -629,6 +636,7 @@ bundle_protobuf() {
if run tar --no-same-owner -xf "${tmp}/${PROTOBUF_PACKAGE_BASENAME}" -C "${tmp}" &&
build_protobuf "${tmp}/protobuf-${PROTOBUF_PACKAGE_VERSION}" &&
copy_protobuf "${tmp}/protobuf-${PROTOBUF_PACKAGE_VERSION}" &&
+ echo "${PROTOBUF_PACKAGE_VERSION}" >"${PWD}/externaldeps/protobuf/.version" &&
rm -rf "${tmp}"; then
run_ok "protobuf built and prepared."
NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS} --with-bundled-protobuf"