diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 86 |
1 files changed, 23 insertions, 63 deletions
@@ -1,65 +1,36 @@ -This folder contains my patches for various pkgsrc packages as well -as the NetBDS distribution. This README describes how to create -and apply them. + Patches for NetBSD and pkgsrc -= pkgsrc patches = +This repository contains my patches for various pkgsrc packages as +well as the NetBSD distribution itself. It also contains scripts +that make it easier to write patches. -== Modifying a package == +The pkg* scripts are designed to be used in conjunction with the +scripts from the pkgtools/pkgdiff package, as they depend on the +existence of .orig files. - cd /usr/pkgsrc/path-to/package - make fetch - cd /usr/pkgsrc/distfiles - tar xf archived-package.tgz - cd extracted-package/ + Use `pkgdiffs' to make a patch containing multiple changes. + Use `pkgpatch' to apply a patch to a source directory. + Use `pkgundo' to reinstate the original files. -At this point, you can either decide to track your changes by -initializing a Git repository +The other scripts have no special relation to pkgtools/pkgdiff. - git init - git commit . + Use `convpatch' to make a patch from `git diff' output. + Use `savepatch' to save a patch in ~/patches. + Use `undopatch' to undo all patches applied to a pkgsrc build. + Use `xpkg' to fetch and extract a pkgsrc package. -or by using pkgvi and pkgdiff: +The `undopatch' and `xpkg' scripts are only to be used within pkgsrc +package directories. They do nothing within the NetBSD source tree. - pkgvi file.c - pkgdiff file.c > ~/patches/path-to/package/patch-name + Applying pkgsrc patches -== Generating a patch from Git == +To have `make do-patch' apply local patches, be sure to set the +LOCALPATCHES variable in mk.conf: - cd /path-to/extracted-package/ - git diff ... | conv -i + echo LOCALPATCHES = ~/patches >> /etc/mk.conf -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 == - -In order to undo all patches, you need to extract the original -files from the downloaded archive. - - 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 - f=${f%.orig} - cp $w/${f#./work/} $f - done - -It is not reliable to restore the original files using the .orig -files, as multiple patches may have been applied to the same file. - -You can use the undopatch script to automate this. - -== Rebuilding with new patch == +To rebuild a package with new patches, something along the following +lines should be performed: undopatch make do-patch @@ -67,14 +38,3 @@ You can use the undopatch script to automate this. make do-install # pkg_delete PACKAGE make reinstall # or make replace - ---- - -= NetBSD patches = - -The usr/ directory contains patches for the NetBSD distribution. - -== Applying a patch == - - cd /usr/*src/... - pkgpatch <~/patches/usr/*src/.../patch-name |