> On Nov 4, 2016, at 8:53 PM, A. Karl Kornel <k...@kornel.us> wrote:
> 
> The first thing I was thinking of doing is using "reinplace" directly
> on the file in question, in the pre-build phase. The section method
> I came up with was to use a patch file to change the line, replacing
> "/etc" with "PREFIX_GOES_HERE" (or something), and then using
> reinplace to put in the correct path.
> 
> Both methods do the same thing, but in my mind the second method is
> better because it makes absolutely sure I am only changing one part of
> the file. Also, if the code changes in a future version, the patch
> will fail to apply. That will help me from missing changes.

We strongly prefer the second method, for the reasons you already gave.
Your portfile should contain a bit resembling this:

patchfiles use-macports-prefix.patch

post-patch {
        reinplace s|__PREFIX__|${prefix}| file.ext
}

vq
_______________________________________________
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to