[SPAM] Re: [SPAM] need help with reinplace

Helmut K. C. Tessarek tessarek at evermeet.cx
Sun Nov 4 22:27:48 UTC 2018


On 2018-11-04 02:49, Ryan Schmidt wrote:
> The way I would approach this is to write a patch file which inserts
> "@VERSION@" into the file where you want the version to appear. Then
> you can simply reinplace "s|@VERSION@|${version}|g" to get the real
> version into the file. That's very simple to understand and it's a
> pattern we use in many other portfiles to insert the prefix or other
> portfile variables.

Yes, I thought about that. However, this means I have to create a new
patch file every time there's an update to that line.

Call me lazy (or more efficient), but I rather use one simple regex.
And yes, I definitely would not call the regex I wrote complex or
complicated. You shoud see some of the regexes that span 2 lines - those
are complicated and unreadable.

Anyhow, thanks for your input.

Cheers,
  K. C.

-- 
regards Helmut K. C. Tessarek              KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20181104/c026f943/attachment.sig>


More information about the macports-dev mailing list