Problems with option-replace modifier

Ryan Schmidt ryandesign at macports.org
Fri Sep 10 17:04:12 PDT 2010


On Sep 10, 2010, at 09:01, Rainer Müller wrote:

> Is there a need for -strsed at all or is it enough to have simple
> replacements?
> 
> As a solution for the issue it would probably be better to have a plain
> -replace taking two arguments. It would search for the first and replace
> with the second, using the list form of the option (lsearch -exact,
> lreplace). This would make it a real shorthand of -delete/-append.
> 
> While this would probably be the better approach for this modifier, it
> would break existing Portfiles using the -replace feature.
> 
> To avoid breaking compatibility, I propose the following as a solution:
> 
> 1. Rename existing -replace to -strsed
> 2. Treat -replace with one parameter like -strsed, but emit a
>   deprecation warning
> 3. Add new -replace taking two arguments as described above


I think we probably don't need strsed features in -replace. It's a nice idea, but probably more power than is needed in this command. I'd be in favor of a simpler -replace that takes two arguments and searches exactly.

There are only 8 portfiles using -replace at all:

avidemux
bzip2
curl
epiphany-extensions
octave-devel
pure
pure-devel
wget

5 of those are mine and I just switched to using -replace within the past month to see what would happen.

We could easily remove -replace from these ports, then switch -replace to take two arguments, then start using -replace again once the new version of MacPorts is out.




More information about the macports-dev mailing list