From 60461a1c32bc7b4d0e95b552980082ee3eb1bcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Wed, 15 Mar 2023 12:25:17 +0100 Subject: [PATCH] update `fix-patch.sh` --- scripts/{test-patch.sh => fix-patch.sh} | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) rename scripts/{test-patch.sh => fix-patch.sh} (65%) diff --git a/scripts/test-patch.sh b/scripts/fix-patch.sh similarity index 65% rename from scripts/test-patch.sh rename to scripts/fix-patch.sh index 6000d36..29d9912 100755 --- a/scripts/test-patch.sh +++ b/scripts/fix-patch.sh @@ -24,12 +24,23 @@ make "firefox-$version.source.tar.xz" tar xf "firefox-$version.source.tar.xz" cd "firefox-$version" -echo "-> Settings up git" +echo "-> Setting up git" git init files="$(cat ../$1 | grep '+++ b/' | sed 's/\+\+\+ b\///')" echo "$files" | xargs touch echo "$files" | xargs git add -echo "-> Done" -echo "You can now apply the patch with:" -echo " cd 'firefox-$version' && patch -p1 -i '$(readlink -f ../$1)'" +echo "-> Trying to apply patch" +patch -p1 -i "../$1" + +echo "-> Done. You can now fix the patch. If you are done," +echo " press enter to update the patch with your changes" +echo " or Ctrl+C to abort." +read + +echo "-> Updating patch" +git diff >"../$1" + +echo "-> Cleaning up" +cd .. +rm -rf "firefox-$version"