[tracker/wip/sam/meson] Add missing file



commit 701f2ddb64b475a677c0efa29ac5446bf44a2ca3
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Mar 11 19:25:36 2017 +0000

    Add missing file

 .../generate-tracker-parser-sha1-header.sh         |   23 ++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-common/generate-tracker-parser-sha1-header.sh 
b/src/libtracker-common/generate-tracker-parser-sha1-header.sh
new file mode 100755
index 0000000..9ff4785
--- /dev/null
+++ b/src/libtracker-common/generate-tracker-parser-sha1-header.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Write the Git SHA1 of the libtracker-common subdir to a header file.
+#
+# This is used in tracker-db-manager.c to regenerate FTS tables if the parser
+# code used by the FTS tokenizer code could have changed.
+#
+# It's important that this script doesn't touch the output file unless it needs
+# to. If it updates the file unconditionally, everything will rebuild from
+# scratch every time Meson reexecutes.
+
+set -eu
+
+SRCDIR=${MESON_SOURCE_ROOT}/src/libtracker-common
+BUILDDIR=${MESON_BUILD_ROOT}/src/libtracker-common
+
+cached_sha1=$(cat ${BUILDDIR}/tracker-parser-sha1.cached || echo "")
+new_sha1=$(git -C ${SRCDIR} log -n1 --format=format:%H -- . )
+
+if [ "$cached_sha1" != "$new_sha1" ]; then
+       echo "#define TRACKER_PARSER_SHA1 \"${new_sha1}\"" > ${BUILDDIR}/tracker-parser-sha1.h
+       echo ${new_sha1} > ${BUILDDIR}/tracker-parser-sha1.cached
+fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]