Compromise?

f.-
 include/Makefile.am   | 7 +++++--
 lib/libvcc/vcc_vmod.c | 5 ++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index 766eb9a..09c237d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -96,6 +96,7 @@ MAINTAINERCLEANFILES = vcs_version.h
 vcs_version.h: FORCE
 	@if [ -d "$(top_srcdir)/.git" ]; then \
 		V="$$(git show -s --pretty=format:%h)" \
+		B="$$(git rev-parse --abbrev-ref HEAD)" \
 		H="$$(head -n 1 vcs_version.h 2>/dev/null || true)"; \
 		if [ "/* $$V */" != "$$H" ]; then \
 		( \
@@ -108,7 +109,8 @@ vcs_version.h: FORCE
 		  echo ' */' ;\
 		  echo "/* $$V */" ;\
 		  echo '' ;\
-		  echo "#define VCS_Version \"$$V\"" \
+		  echo "#define VCS_Version \"$$V\"" ; \
+		  echo "#define VCS_Branch \"$$B\"" \
 		) > vcs_version.h ; \
 		fi \
 	else \
@@ -116,7 +118,8 @@ vcs_version.h: FORCE
 		( \
 		  echo "/* NOGIT */" ; \
 		  echo '/* No git commit ID available, see include/Makefile.am for explanation */' ; \
-		  echo '#define VCS_Version "NOGIT"' \
+		  echo '#define VCS_Version "NOGIT"' ; \
+		  echo '#define VCS_Branch "NOGIT"' \
 		) >  vcs_version.h ; \
 		fi \
 	fi
diff --git a/lib/libvcc/vcc_vmod.c b/lib/libvcc/vcc_vmod.c
index 4f139de..3c83273 100644
--- a/lib/libvcc/vcc_vmod.c
+++ b/lib/libvcc/vcc_vmod.c
@@ -34,6 +34,8 @@
 
 #include "vcc_compile.h"
 
+#include "vcs_version.h"
+
 #include "vmod_abi.h"
 #include "vrt.h"
 
@@ -154,7 +156,8 @@ vcc_ParseImport(struct vcc *tl)
 		return;
 	}
 
-	if (strcmp(vmd->abi, VMOD_ABI_Version) != 0) {
+	if (strcmp(VCS_Branch, "master") == 0 &&
+	    strcmp(vmd->abi, VMOD_ABI_Version) != 0) {
 		VSB_printf(tl->sb, "Incompatible VMOD %.*s\n", PF(mod));
 		VSB_printf(tl->sb, "\tFile name: %s\n", fn);
 		VSB_printf(tl->sb, "\tABI mismatch, expected <%s>, got <%s>\n",
_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to