[79603] trunk/dports/mail

Ryan Schmidt ryandesign at macports.org
Sun Jun 19 22:05:10 PDT 2011

On Jun 19, 2011, at 22:21, pixilla at macports.org wrote:

> Revision: 79603
>          http://trac.macports.org/changeset/79603
> Author:   pixilla at macports.org
> Date:     2011-06-19 20:21:41 -0700 (Sun, 19 Jun 2011)
> Log Message:
> -----------
> mail/dovecot2-antispam: New port.

> +post-extract {
> +    reinplace "s/.impl/.so/g" ${worksrcpath}/m4/buildsys.m4
> +}

I previously pointed out for another port that post-patch is a better place to do reinplaces than post-configure. It's also a better place to do it than post-extract. The reason is that you (or at least I) often want to see what MacPorts has changed in the files that were distributed -- patches, reinplaces and all. To discover this, my usual steps would be:

cd $(port dir foo)
sudo port clean
sudo port extract
sudo cp -a work/foo-1.2.3{,-orig}
sudo port patch
diff -ru work/foo-1.2.3{-orig,}

The phases are there for a reason. The extract phase is for extracting the distributed archive. The patch phase is for making modifications to those files to fix bugs or massage things into MacPorts' hierarchy. The configure phase is for determining information about the computer, OS, and other parameters and saving them somewhere so that the software can be built. The build phase is for actually building the software. And so on. It's best to use the phases for these purposes, and not shuffle things around too much if at all possible, so everyone knows what to expect from the port.

In the above case, I was curious what was being reinplaced. Attached is the result of your reinplacement. Are you sure these are all changes you want made? I suspect the only change you actually wanted was the middle hunk, and that the other changes made are erroneous. It would be so much clearer to us and to you if you would do it as a normal patchfile and not as a reinplace. If the reinplace were going to be affecting hundreds of lines in dozens of files then the brevity of the reinplace is often preferable, but when changing a single line, in a single file, which doesn't even involve variable substitutions, a patchfile is the clear choice.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dovecot.diff
Type: application/octet-stream
Size: 1737 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20110620/f4514111/attachment.obj>

More information about the macports-dev mailing list