0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 13:43:04 -05:00
LibreWolf/scripts/check-patchfail.sh

57 lines
948 B
Bash
Raw Normal View History

2022-04-11 00:01:53 -05: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-11 00:06:01 -05:00
echo "Removing '$tmpdir'..."
2022-04-11 00:01:53 -05:00
rm -rf $tmpdir
mkdir $tmpdir
cd $tmpdir
2022-04-11 00:06:01 -05:00
echo "Extracting '$firefox'..."
2022-04-11 00:01:53 -05:00
tar xf ../$firefox
cd firefox-$(cat ../version)
2022-04-11 00:06:01 -05:00
echo ""
echo "Testing patches..."
2022-04-11 04:35:30 -05:00
2022-04-11 00:06:01 -05:00
for i in $(cat ../../assets/patches.txt); do
2022-04-11 04:35:30 -05:00
echo ""
echo "==> $i:"
echo ""
patch $* -p1 -i ../../$i > ../patch.tmp
cat ../patch.tmp
s=""
for j in $(grep -n rej$ ../patch.tmp | awk '{ print $(NF); }'); do
s="$s $j"
done
s=$s
if [ ! -z "$s" ]; then
echo ""
for k in $s; do
echo "--> $s:"
cat $s
done
fi
rm -f ../patch.tmp
#patch -R -p1 -i ../../$i
2022-04-11 00:01:53 -05:00
done
cd ../..
2022-04-11 04:35:30 -05:00
echo ""
2022-04-11 00:06:01 -05:00
echo "Removing '$tmpdir'..."
2022-04-11 00:01:53 -05:00
rm -rf $tmpdir
exit 0