Easy access to external repositories.

Artur Szostak aszostak at partner.eso.org
Mon Jun 1 11:11:56 PDT 2015


>>> Did you handle deactivation or did you simply make it impossible.
>>
>> The update of the configuration files is handled during the activation
>> phase and rolled-back during deactivation.
>> So it should all be handled. Deactivating the port should get you back
>> to the same state as if the port was never installed in the first place.
>> If this is not the case then I should fix it :-)
>> Of course, a user could always break something by making some very
>> weird modifications to the configuration files directly. But I think I have
>> handled all reasonable scenarios.
>
> Yeah? How do you handle
>
> %> port install repositoryA
> %> port install repositoryB
> %> port deactivate|uninstall repositoryA
>
> Do you roll back to the state from before installing repo A, removing
> repo B at the same time?

No, repositoryB stays in place. I only remove what was added during "port install repositoryA".

I append configuration strings to the files during pre-activate and use reinplace with appropriate regular expressions to remove what was previously added during post-deactivate. Have a look at the Portfile for details:
https://trac.macports.org/attachment/ticket/46954/Portfile.2

Of course, if MacPorts was reading configuration directories like has been discussed already, then this could all be cleaner, because I just install and remove whole files rather than modify existing ones.

Cheers

Artur


More information about the macports-dev mailing list