From 10506b5173f32680cf886da96131968e6fb9d939 Mon Sep 17 00:00:00 2001 From: Vitaliy Ivanov Date: Thu, 29 Oct 2020 00:13:19 +0200 Subject: Generate NDPI_API_VERSION based on git commands. https://github.com/ntop/PF_RING/issues/668 Check for .git directory works in case of usual clone of nDPI repo. But if you integrate is as submodule then .git is a file. Signed-off-by: Vitaliy Ivanov --- configure.seed | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.seed b/configure.seed index 9303e3187..535823271 100644 --- a/configure.seed +++ b/configure.seed @@ -46,7 +46,9 @@ AC_DEFINE_UNQUOTED(NDPI_MAJOR_RELEASE, "${NDPI_MAJOR}", [nDPI major release]) AC_DEFINE_UNQUOTED(NDPI_MINOR_RELEASE, "${NDPI_MINOR}", [nDPI minor release]) AC_DEFINE_UNQUOTED(NDPI_PATCH_LEVEL, "${NDPI_PATCH}", [nDPI patch level]) -if test -d ".git"; then : +# .git as directory in a cloned repo +# .git as file in submodule based integration +if test -d ".git" || test -f ".git" ; then : GIT_TAG=`git log -1 --format=%h` GIT_DATE=`git log -1 --format=%cd` # -- cgit v1.2.3