From: Michael Jeanson Date: Wed, 6 May 2020 18:26:01 +0000 (-0400) Subject: Cleanup: Move patches.i to include/generated/ X-Git-Tag: v2.13.0-rc1~221 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cd4486798c2b046ea93b89439cd705e93c40b349;p=lttng-modules.git Cleanup: Move patches.i to include/generated/ Move patches.i from /extra_version to include/generated/ so we can include them without using relative path includes. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I87927a372ffeb244f3c097c9bb80eeca7d9f99eb --- diff --git a/.gitignore b/.gitignore index 4af69a27..4ea8aa5f 100644 --- a/.gitignore +++ b/.gitignore @@ -149,3 +149,4 @@ x509.genkey # lttng-modules specific /extra_version +/include/generated diff --git a/lttng-events.c b/lttng-events.c index e22cc811..a8536091 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -3071,7 +3071,7 @@ static void __exit lttng_events_exit(void) module_exit(lttng_events_exit); -#include "extra_version/patches.i" +#include #ifdef LTTNG_EXTRA_VERSION_GIT MODULE_INFO(extra_version_git, LTTNG_EXTRA_VERSION_GIT); #endif diff --git a/lttng-wrapper-impl.c b/lttng-wrapper-impl.c index cef4fc7a..e7f5660f 100644 --- a/lttng-wrapper-impl.c +++ b/lttng-wrapper-impl.c @@ -21,7 +21,7 @@ static void __exit lttng_exit(void) module_exit(lttng_exit); -#include "extra_version/patches.i" +#include #ifdef LTTNG_EXTRA_VERSION_GIT MODULE_INFO(extra_version_git, LTTNG_EXTRA_VERSION_GIT); #endif diff --git a/scripts/extra-version-patches.sh b/scripts/extra-version-patches.sh index a32d39e0..da79e1fd 100755 --- a/scripts/extra-version-patches.sh +++ b/scripts/extra-version-patches.sh @@ -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}"