0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2025-01-18 10:22:30 -05:00
LibreWolf/scripts/check-patchfail.sh

69 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2022-04-11 07:01:53 +02:00
tmpdir="tmpdir92"
if [ ! -f version ]; then
echo "error: 'version' does not exist. Are you in the right folder?"
exit 1
fi
firefox=firefox-$(cat version).source.tar.xz
if [ ! -f "$firefox" ]; then
echo "error: '$firefox' does not exist."
exit 1
fi
2022-04-13 13:05:14 +02:00
failed_patches=
2022-04-11 07:01:53 +02:00
2022-04-11 07:06:01 +02:00
echo "Removing '$tmpdir'..."
2022-04-11 07:01:53 +02:00
rm -rf $tmpdir
mkdir $tmpdir
cd $tmpdir
2022-04-11 07:06:01 +02:00
echo "Extracting '$firefox'..."
2022-04-11 07:01:53 +02:00
tar xf ../$firefox
cd firefox-$(cat ../version)
2022-04-11 07:06:01 +02:00
echo ""
echo "Testing patches..."
2022-04-11 11:35:30 +02:00
2022-06-01 20:15:40 +02:00
for curpatch in $(cat ../../assets/patches.txt); do
2022-04-11 11:35:30 +02:00
echo ""
2022-06-01 20:15:40 +02:00
echo "==> $curpatch:"
2022-04-11 11:35:30 +02:00
echo ""
2022-06-01 20:15:40 +02:00
patch $* -p1 -i ../../$curpatch > ../patch.tmp
2022-04-11 11:35:30 +02:00
cat ../patch.tmp
2022-06-01 20:15:40 +02:00
######################
2022-04-11 11:35:30 +02:00
s=""
for j in $(grep -n rej$ ../patch.tmp | awk '{ print $(NF); }'); do
s="$s $j"
2022-06-01 20:15:40 +02:00
echo "---[snip]---------- --> $j:"
cat $j
echo "---[snip]----------"
2022-04-11 11:35:30 +02:00
done
s=$s
2022-06-01 20:15:40 +02:00
2022-04-11 11:35:30 +02:00
if [ ! -z "$s" ]; then
2022-06-01 20:15:40 +02:00
failed_patches="$failed_patches [$curpatch]"
2022-04-11 11:35:30 +02:00
fi
2022-06-01 20:15:40 +02:00
#######################
2022-04-11 11:35:30 +02:00
rm -f ../patch.tmp
#patch -R -p1 -i ../../$i
2022-04-11 07:01:53 +02:00
done
cd ../..
2022-04-11 11:35:30 +02:00
echo ""
2022-04-11 07:06:01 +02:00
echo "Removing '$tmpdir'..."
2022-04-11 07:01:53 +02:00
rm -rf $tmpdir
2022-04-13 13:05:14 +02:00
echo ""
if [ ! -z "$failed_patches" ]; then
echo $failed_patches
echo ""
echo "error: Some patches failed!"
exit 1
else
echo "success: All patches where applied successfully."
exit 0
fi