Re: patch instead of reinplace?

2014-09-27 Thread Ryan Schmidt

On Sep 27, 2014, at 11:06 AM, Brandon Allbery wrote:
> On Sat, Sep 27, 2014 at 11:59 AM, Kurt Hindenburg wrote:
>> Hi,  I find reinplace easier and less work for new releases.  Are there 
>> reasons to use one over the other?
> 
> reinplace is appropriate for replacing self-contained "tokens" and such. When 
> the context of an edit is important, reinplace handles context very poorly, 
> while patch is designed to handle it and fail if the context can't be 
> rationalized (e.g. by detecting that something moved but is otherwise the 
> same).

Normally, if you're making a change that doesn't involve a MacPorts variable, 
you'll use a patchfile. If you're making a change that does involve a MacPorts 
variable, you'll use a patchfile to insert a placeholder (e.g. "@PREFIX@"), 
then use a reinplace to change the placeholder to its real value.

Remember from https://trac.macports.org/ticket/15514 that if a reinplace fails, 
there's currently no notice. This can mean that old bugs which were fixed with 
a reinplace can resurface if a port is updated and the reinplace is not 
adjusted. With a patch, this can't happen, since if the patch fails to apply, 
the build will stop with an error.

Patches provide context to the reader to let them know what's being changed. 
This makes it easier to see how the patch needs to be changed if a new version 
of the code changes things.

Patches are easy to send to upstream developers.

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


Re: patch instead of reinplace?

2014-09-27 Thread Brandon Allbery
On Sat, Sep 27, 2014 at 11:59 AM, Kurt Hindenburg  wrote:

> Hi,  I find reinplace easier and less work for new releases.  Are there
> reasons to use one over the other?


reinplace is appropriate for replacing self-contained "tokens" and such.
When the context of an edit is important, reinplace handles context very
poorly, while patch is designed to handle it and fail if the context can't
be rationalized (e.g. by detecting that something moved but is otherwise
the same).

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
___
macports-dev mailing list
macports-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/macports-dev


patch instead of reinplace?

2014-09-27 Thread Kurt Hindenburg
Hi,  I find reinplace easier and less work for new releases.  Are there 
reasons to use one over the other?


Kurt

Revision: 125845
  https://trac.macports.org/changeset/125845
Author:ryandesign at macports.org  

Date: 2014-09-27 08:41:26 -0700 (Sat, 27 Sep 2014)
Log Message:
---
chromaprint: use patchfile instead of reinplace


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