Commit | Line | Data |
---|---|---|
101215b7 | 1 | #!/bin/sh |
b7cdc182 | 2 | # SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only) |
101215b7 MJ |
3 | |
4 | # First argument is the path to the lttng modules sources. | |
5 | TOP_LTTNG_MODULES_DIR="$1" | |
6 | ||
7 | if ! test -d "${TOP_LTTNG_MODULES_DIR}"; then | |
8 | exit 1 | |
9 | fi | |
10 | ||
11 | TMPFILE="$(mktemp)" | |
12 | ||
13 | find "${TOP_LTTNG_MODULES_DIR}/extra_version/patches/" -maxdepth 1 ! -name 'README' -type f -printf '%f\n' | sort -r \ | |
14 | | sed -E 's/[^a-zA-Z0-9 \.]/-/g ; s/(.*)/MODULE_INFO(extra_version_patch, "\1");/g' >"${TMPFILE}" 2>/dev/null | |
15 | ||
16 | if test ! -f "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i" || \ | |
17 | test x"$(cat "${TMPFILE}")" != x"$(cat "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i")"; then | |
18 | mv "${TMPFILE}" "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i" | |
19 | fi | |
20 | ||
21 | rm -f "${TMPFILE}" |