aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-15 08:42:18 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-15 08:42:18 +0200
commit71a90d55f7797d504970c691213f2fd48bb8ab54 (patch)
tree7e2fbbe687063cd8b414e41752f1d4322d3ac50d /README
parentc3e44d48fb5d67904561bd99daa3b4e4ee6619dd (diff)
downloadpatches-71a90d55f7797d504970c691213f2fd48bb8ab54.tar.gz
Add undopatch script
Diffstat (limited to 'README')
-rw-r--r--README16
1 files changed, 11 insertions, 5 deletions
diff --git a/README b/README
index ca429cb..13f65cb 100644
--- a/README
+++ b/README
@@ -30,15 +30,21 @@ they are formatted correctly and placed in the correct directory.
= Undoing patches =
-I haven't tried it yet, but the following command should work:
+In order to undo all patches, you need to extract the original
+files from the downloaded archive.
- cd /usr/pkgsrc/path-to/package/work/
+ cd /usr/pkgsrc/path-to/package
+ w=/usr/pkgsrc/distfiles/$(sed -n '/.*(\(.*\)).*/{s//\1/;p;q}' distinfo)
+ cd $(dirname $w)
+ tar xf $w
+ cd -
find . -name '*.orig' | while read f; do
- mv "$f" "${f%.orig}"
+ f=${f%.orig}
+ cp $w/${f#work/} $f
done
-It probably won't work if you've tried to apply patches twice, as
-each do-patch theoretically presumably creates new .orig files.
+It is not reliable to restore the original files using the .orig
+files, as multiple patches may have been applied to the same file.
= Rebuilding with new patch =