port "activate instead"

Mihai Moldovan ionic at macports.org
Mon May 25 14:50:20 PDT 2015


On 25.05.2015 07:20 PM, René J.V. Bertin wrote:
> On Monday May 25 2015 18:30:48 Mihai Moldovan wrote:
>> Semantically, your "instead_of" proposal isn't great due to the fact that
>> multiple ports can conflict, with count > 2. Also, the conflicts can be based
>> upon orthogonal reasons and you wouldn't necessarily know.
> 
> So, GIGO ...
> If someone wants to deactivate gcc and activate clang should it be impossible to do that in a single command because it so happens that they can be active at the same time?
> Are you really implying that a convenience feature shouldn't be implemented because some people might do stupid things with it that they can already do with a bit more work? Would it not actually help prevent issues? With 2 separate commands it's hard to compare the list of deactivated files and the list of activated files and see if the latter satisfies the dependency relations of the former. With a single command it should be possible I think (port install and/or port upgrade do a similar check that doesn't do an exhaustive scan of the whole registry, no?).

That's even worse. gcc is by no means a "replacement" for clang. Maybe
"instead_of" is just a misnomer and it should be "--pre-deactivate" or
something, but even with that ruled out, Raim is right in that the force flag
would apply to both operations, which is not a good idea. (Think what would
happen if the "replacement" collides with another package file-wise?)

There's nothing stopping you from writing a simple wrapper and naming that
instead_of or however you want to call it and putting it in /usr/local/bin/.



#!/bin/sh
old_port="${1:?"no port to deactivate given"}"
new_port="${2:?"no port to activate given"}"

sudo port deactivate -f "${old_port}"
sudo port activate "${new_port}"



Extending base and working around the -f problem with even more ambiguity? Not
so much.



Mihai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20150525/e2269d3f/attachment.sig>


More information about the macports-dev mailing list