modifying patch files

Jeremy Lavergne jeremy at lavergne.gotdns.org
Sat Sep 12 07:31:10 PDT 2009


>   I have run into an issue that is unclear on MacPorts. In fink
> we often would put placekeepers in a patch such as @FINKPREFIX@
> and use the command...
>
> sed 's|@FINKPREFIX@|%p|g' <%{PatchFile} | patch -p1
>
> to replace the @FINKPREFIX@ with the actual fink installation  
> directory.
> How do you handle this situation in MacPorts where you want to
> generalize the MacPorts prefix in a Makefile patch for instance
> to survive the case of a user installing MacPorts in a non-default
> location other than /opt/local?


patchfiles  patch-patched_file.diff

...

reinplace s|@FINKPREFIX@|${prefix}|g patched_file



More information about the macports-dev mailing list