Added script to warn a user about issues regarding wrong umask and CPack

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2024-11-20 11:01:01 +01:00
parent 442900bc14
commit 7b91ad8458
2 changed files with 22 additions and 0 deletions

View File

@@ -200,6 +200,14 @@ add_executable(nDPId nDPId.c ${NDPID_PFRING_SRCS} nio.c utils.c)
add_executable(nDPIsrvd nDPIsrvd.c nio.c utils.c)
add_executable(nDPId-test nDPId-test.c ${NDPID_PFRING_SRCS})
add_custom_target(umask_check)
add_custom_command(
TARGET umask_check
PRE_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/scripts/umask-check.sh
)
add_dependencies(nDPId umask_check)
add_custom_target(dist)
add_custom_command(
TARGET dist

14
scripts/umask-check.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
UMASK=$(umask)
if [ "${UMASK}" != "0002" -a "${UMASK}" != "0022" ]; then
cat <<EOF
********************************************
* WARNING: 'cpack -G DEB' / 'cpack -G RPM' *
* might not work correctly due to umask, *
* which is set to ${UMASK} *
* but expected is either 0002 or 0022 *
********************************************
EOF
fi