aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-10 00:16:45 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-10 00:16:45 +0200
commit2748a9b16f91fe7fe06effc352cad14928ef7660 (patch)
tree51b8682fb59ca8a4b6486d9b9d79897771b4bf6e
parent25df8e87491243595fe06727881490251a138193 (diff)
downloadpatches-2748a9b16f91fe7fe06effc352cad14928ef7660.tar.gz
Add README
-rw-r--r--README51
1 files changed, 51 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..ca429cb
--- /dev/null
+++ b/README
@@ -0,0 +1,51 @@
+This folder contains my patches for various pkgsrc packages.
+This README describes how to create and apply them.
+
+= Modifying a package =
+
+ cd /usr/pkgsrc/path-to/package
+ make fetch
+ cd /usr/pkgsrc/distfiles
+ tar xf archived-package.tgz
+ cd extracted-package/
+ git init
+
+I like tracking my modifications with Git, if only temporarily.
+
+= Generating a patch =
+
+ cd /path-to/extracted-package/
+ git diff ... | conv -i
+
+The resulting patch will be placed in ~/patches.
+
+= Applying a patch =
+
+Be sure to set the LOCALPATCHES variable in mk.conf:
+
+ echo LOCALPATCHES = $HOME/patches >> /etc/mk.conf
+
+After that, local patches will be applied automatically, assuming
+they are formatted correctly and placed in the correct directory.
+
+= Undoing patches =
+
+I haven't tried it yet, but the following command should work:
+
+ cd /usr/pkgsrc/path-to/package/work/
+ find . -name '*.orig' | while read f; do
+ mv "$f" "${f%.orig}"
+ done
+
+It probably won't work if you've tried to apply patches twice, as
+each do-patch theoretically presumably creates new .orig files.
+
+= Rebuilding with new patch =
+
+First, you may want to undo the old patches as described above.
+
+ make do-patch
+ make do-build
+
+The first step will complain if patches have already been applied
+(and not undone), but your new patch should be applied regardless.