mirror of
https://github.com/jarun/nnn.git
synced 2024-10-31 16:37:18 +00:00
fd69fc2dca
adds a script `check-patches.sh` to check for patch failures and also adds a make target `checkpatches` which will invoke the check-patches script.
31 lines
752 B
Bash
Executable file
31 lines
752 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Usage: ./misc/test/check-patches.sh
|
|
#
|
|
# Bash script that checks for any of the patches failing to apply.
|
|
# Read patches/README.md for more information.
|
|
|
|
export PATCH_OPTS="--merge"
|
|
patches=("O_GITSTATUS" "O_NAMEFIRST" "O_RESTOREPREVIEW")
|
|
z=$(( 1 << ${#patches[@]} ))
|
|
pid=$$
|
|
ret=0
|
|
trap 'ret=1' SIGUSR1
|
|
|
|
for ((n=1; n < z; ++n)); do
|
|
for ((i=0; i < ${#patches[@]}; ++i)); do
|
|
printf "%s=%d " "${patches[$i]}" "$(( (n & (1 << i)) != 0 ))"
|
|
done | tee "/dev/stderr" | (
|
|
make clean -s
|
|
xargs make 2>&1
|
|
if [ "$?" -ne 0 ]; then
|
|
echo "[FAILED]" >&2
|
|
kill -SIGUSR1 "$pid"
|
|
else
|
|
echo "[SUCCESS]" >&2
|
|
fi
|
|
git restore src
|
|
) >/dev/null
|
|
done
|
|
exit "$ret"
|