mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
meson: fix patch script compatibility (#8)
This commit is contained in:
parent
dcea6ce763
commit
eee10a3f9c
1 changed files with 5 additions and 9 deletions
|
@ -1,31 +1,27 @@
|
||||||
#!/bin/bash
|
#!/bin/sh -eu
|
||||||
|
|
||||||
# find all patches in patches/
|
# find all patches in patches/
|
||||||
PATCHES=$(find patches/ -type f -name '*.patch')
|
PATCHES=$(find patches/ -type f -name '*.patch')
|
||||||
|
|
||||||
check () {
|
|
||||||
git apply --check -q -p1 $PATCH
|
|
||||||
}
|
|
||||||
|
|
||||||
apply () {
|
apply () {
|
||||||
git apply -p1 $PATCH
|
git apply $PATCH
|
||||||
}
|
}
|
||||||
|
|
||||||
check_applied () {
|
check_applied () {
|
||||||
git apply --check --reverse -q -p1 $PATCH
|
git apply --check --reverse -q $PATCH
|
||||||
}
|
}
|
||||||
|
|
||||||
fail () {
|
fail () {
|
||||||
echo =======\> \'$PATCH\' was not applied && exit 1
|
echo =======\> \'$PATCH\' was not applied && exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -n "$PATCHES" ]];
|
if [ -n "$PATCHES" ];
|
||||||
then
|
then
|
||||||
# check patch validity and apply, else check if already applied and report and exit on failure
|
# check patch validity and apply, else check if already applied and report and exit on failure
|
||||||
echo 'Patches found. Applying...';
|
echo 'Patches found. Applying...';
|
||||||
for PATCH in $PATCHES;
|
for PATCH in $PATCHES;
|
||||||
do
|
do
|
||||||
check && apply || check_applied || fail;
|
apply || check_applied || fail;
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo 'No patches found.'
|
echo 'No patches found.'
|
||||||
|
|
Loading…
Reference in a new issue