Optional patching

Pietro Cerutti gahr at gahr.ch
Wed Dec 19 11:10:04 PST 2007


Wesley Shields wrote:
> On Wed, Dec 19, 2007 at 01:03:23PM -0600, Paul Schmehl wrote:
>> --On Wednesday, December 19, 2007 16:59:37 +0100 Pietro Cerutti 
>> <gahr at gahr.ch> wrote:
>>
>>> Paul Schmehl wrote:
>>>> Is there a way to include a patch as an option to a port?  I maintain
>>>> the security/barnyard port.  There's a patch that is necessary for
>>>> barnyard to work correctly on a 64bit system.  I'm wondering if I can
>>>> use OPTIONS to make this patch optional if the system is 64 bit, but I'm
>>>> not sure what the syntax would be inside the if statement.
>>>>
>>>> .if defined(WITH_64BIT)
>>>> do-patch: patchname
>>>> .endif
>>>
>>> I would do something like (please check the list of 64 bits platforms)
>>>
>>> .if ${ARCH} == "amd64" || ${ARCH} == "ia64" || ${ARCH} == "sparc64"
>>> # apply the patch here
>>> .endif
>>>
>>>> I assume the patch would have to be in the filesdir but could not be
>>>> named "patch-foo" or it would always be applied, correct?
>>>>
>>> Please check the reply from pav@ for this ;-)
>> That brings up an interesting question.  Which would be the preferred 
>> method? To use an OPTION knob?  Or simply apply the patch if the arch 
>> matches?  I'm thinking the latter.  I've tested the former method, and it 
>> works fine.   Does it matter which method I use?
> 
> I don't think it matters really, but is probably a matter of personal
> preference.  The only problem with using an option that I see is that if
> the user has no idea if (s)he is on a 64bit platform and turns the
> option off.  It's for this reason I'd suggest using the .if ${ARCH}
> approach.

This would be my argument too.

> 
> -- WXS


-- 
Pietro Cerutti

PGP Public Key:
http://gahr.ch/pgp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20071219/1f92d4b3/signature.pgp


More information about the freebsd-ports mailing list