Move struct lttng_metadata_stream to private header
[lttng-modules.git] / scripts / extra-version-patches.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
3
4 # First argument is the path to the lttng modules sources.
5 TOP_LTTNG_MODULES_DIR="$1"
6
7 INCLUDE_DIR="include/generated"
8
9 if ! test -d "${TOP_LTTNG_MODULES_DIR}"; then
10 exit 1
11 fi
12
13 TMPFILE="$(mktemp)"
14
15 find "${TOP_LTTNG_MODULES_DIR}/extra_version/patches/" -maxdepth 1 ! -name 'README' -type f -printf '%f\n' | sort -r \
16 | sed -E 's/[^a-zA-Z0-9 \.]/-/g ; s/(.*)/MODULE_INFO(extra_version_patch, "\1");/g' >"${TMPFILE}" 2>/dev/null
17
18 if test ! -d "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}"; then
19 mkdir "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}"
20 fi
21
22 if test ! -f "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}/patches.h" || \
23 test x"$(cat "${TMPFILE}")" != x"$(cat "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}/patches.h")"; then
24 mv "${TMPFILE}" "${TOP_LTTNG_MODULES_DIR}/${INCLUDE_DIR}/patches.h"
25 fi
26
27 rm -f "${TMPFILE}"
This page took 0.029428 seconds and 4 git commands to generate.