mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-25 10:49:06 +08:00
sync: adjust sync-kernel.sh script to handle UAPI header guards better
Adjust the sync script to handle UAPI header guards with singular and double underscore between UAPI and LINUX. Kernel seems to have a mix of both approaches. Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
This commit is contained in:
committed by
Andrii Nakryiko
parent
0e2ac81b00
commit
95a9035e8b
@@ -63,7 +63,7 @@ LIBBPF_TREE_FILTER="mkdir -p __libbpf/include/uapi/linux __libbpf/include/tools
|
||||
for p in "${!PATH_MAP[@]}"; do
|
||||
LIBBPF_TREE_FILTER+="git mv -kf ${p} __libbpf/${PATH_MAP[${p}]} && "$'\\\n'
|
||||
done
|
||||
LIBBPF_TREE_FILTER+="find __libbpf/include/uapi/linux -type f -exec sed -i 's/_UAPI__LINUX/__LINUX/' {} + && "$'\\\n'
|
||||
LIBBPF_TREE_FILTER+="find __libbpf/include/uapi/linux -type f -exec sed -i 's/_UAPI\(__\?LINUX\)/\1/' {} + && "$'\\\n'
|
||||
LIBBPF_TREE_FILTER+="git rm --ignore-unmatch -f __libbpf/src/{Makefile,Build,test_libbpf.c,.gitignore} >/dev/null"
|
||||
|
||||
cd_to()
|
||||
@@ -348,7 +348,7 @@ diff -u ${TMP_DIR}/linux-view.ls ${TMP_DIR}/github-view.ls
|
||||
echo "Comparing file contents..."
|
||||
CONSISTENT=1
|
||||
for F in $(cat ${TMP_DIR}/linux-view.ls); do
|
||||
if ! diff -u <(sed 's/_UAPI__LINUX/__LINUX/' "${LINUX_ABS_DIR}/${F}") "${GITHUB_ABS_DIR}/${F}"; then
|
||||
if ! diff -u <(sed 's/_UAPI\(__\?LINUX\)/\1/' "${LINUX_ABS_DIR}/${F}") "${GITHUB_ABS_DIR}/${F}"; then
|
||||
echo "${LINUX_ABS_DIR}/${F} and ${GITHUB_ABS_DIR}/${F} are different!"
|
||||
CONSISTENT=0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user