Cleanup: Move patches.i to include/generated/
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 6 May 2020 18:26:01 +0000 (14:26 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 6 May 2020 19:08:56 +0000 (15:08 -0400)
Move patches.i from /extra_version to include/generated/ so we
can include them without using relative path includes.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I87927a372ffeb244f3c097c9bb80eeca7d9f99eb

.gitignore
lttng-events.c
lttng-wrapper-impl.c
scripts/extra-version-patches.sh

index 4af69a275d9dce83dd7631efc1ad2d084fdc7e98..4ea8aa5fd9e6a571bdf8b7b826872fb0e165b31d 100644 (file)
@@ -149,3 +149,4 @@ x509.genkey
 
 # lttng-modules specific
 /extra_version
+/include/generated
index e22cc8112253b6b48547c5dd499ee64a9e78f694..a85360912271c8725c4d59e329f4c3ea212ca6cf 100644 (file)
@@ -3071,7 +3071,7 @@ static void __exit lttng_events_exit(void)
 
 module_exit(lttng_events_exit);
 
-#include "extra_version/patches.i"
+#include <generated/patches.i>
 #ifdef LTTNG_EXTRA_VERSION_GIT
 MODULE_INFO(extra_version_git, LTTNG_EXTRA_VERSION_GIT);
 #endif
index cef4fc7ae20e98272d00841f6f23f2fcac949cea..e7f5660fa3e5dea62e1dd2e70bbfbc4cb3796538 100644 (file)
@@ -21,7 +21,7 @@ static void __exit lttng_exit(void)
 
 module_exit(lttng_exit);
 
-#include "extra_version/patches.i"
+#include <generated/patches.i>
 #ifdef LTTNG_EXTRA_VERSION_GIT
 MODULE_INFO(extra_version_git, LTTNG_EXTRA_VERSION_GIT);
 #endif
index a32d39e0c595770d1600876e0c34e3abf24d9e0c..da79e1fd54a15c1a77a0dfca29c53ef978552558 100755 (executable)
@@ -4,6 +4,8 @@
 # First argument is the path to the lttng modules sources.
 TOP_LTTNG_MODULES_DIR="$1"
 
+INCLUDE_DIR="include/generated"
+
 if ! test -d "${TOP_LTTNG_MODULES_DIR}"; then
        exit 1
 fi
@@ -13,9 +15,13 @@ TMPFILE="$(mktemp)"
 find "${TOP_LTTNG_MODULES_DIR}/extra_version/patches/" -maxdepth 1 ! -name 'README' -type f -printf '%f\n' | sort -r \
        | sed -E 's/[^a-zA-Z0-9 \.]/-/g ; s/(.*)/MODULE_INFO(extra_version_patch, "\1");/g' >"${TMPFILE}" 2>/dev/null
 
-if test ! -f "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i" || \
-       test x"$(cat "${TMPFILE}")" != x"$(cat "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i")"; then
-       mv "${TMPFILE}" "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i"
+if test ! -d "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}"; then
+       mkdir "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}"
+fi
+
+if test ! -f "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}/patches.i" || \
+       test x"$(cat "${TMPFILE}")" != x"$(cat "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}/patches.i")"; then
+       mv "${TMPFILE}" "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}/patches.i"
 fi
 
 rm -f "${TMPFILE}"
This page took 0.036806 seconds and 4 git commands to generate.