Optional Patches

Matthew Pounsett matt at conundrum.com
Wed May 18 21:29:49 UTC 2011


I posted the other day about an issue I was having working around a distribution CGI when adding a patch to a port.  Thanks to a suggestion from Matthew Seaman that problem is solved, but I seem to have bumped up against another.  It seems that I can't find a way to make applying the patch optional, which was the original intent.

I've added a new option (call it 'FOO') to the OPTIONS definition, and I'm attempting to add something like this directly below MASTER_SITES near the top of the Makefile:

.if defined(FOO)
PATCH_SITES=      http://location.site.com/path/
PATCHFILES=       port-${PORTVERSION}.patch
PATCH_DIST_STRIP= -p1
.endif

The option shows up when the config target is run, but ports doesn't do anything with the patch info.  If I remove or comment-out the .if and .endif surrounding the above block, then ports finds and applies the patch perfectly, so I know the patching info itself is correct.

I've tried placing the block in various places around the Makefile, on the off chance that there's an issue with ordering, but that hasn't solved the problem either.

I've done a quick grep through the ports tree looking for instances of PATCH_SITES appearing shortly after an .if defined but nothing has cropped up that I can crib from.

Does anyone know what the problem is?  Is what I'm attempting just not possible?

Thanks,
  Matt




More information about the freebsd-ports mailing list