base: 'port uninstall' ignores subport when using 'current'
Joshua Root
jmr at macports.org
Sun Jul 28 20:08:46 PDT 2013
On 2013-7-29 00:52 , Bradley Giesbrecht wrote:
> Is this intended?
>
> $ cd $(port dir qt4-mac-mysql55-plugin)
> $ for mysql in mysql5 mysql51 mysql55 mariadb percona ; do sudo port -dy uninstall subport=qt4-mac-${mysql}-plugin 2>/dev/null ; done
> qt4-mac-mysql55-plugin is already uninstalled
> qt4-mac-mysql55-plugin is already uninstalled
> qt4-mac-mysql55-plugin is already uninstalled
> qt4-mac-mysql55-plugin is already uninstalled
> qt4-mac-mysql55-plugin is already uninstalled
> $
The uninstall action does not parse the portfile in the tree, because
(a) it doesn't have to, and (b) it may not exist.
It does parse the portfile in the registry in order to run the pre/post
code for uninstall/deactivate, but letting you override the subport when
it does that would be bad, because the registry already knows the
correct subport and changing it when executing the portfile could
potentially cause problems. Doing this also wouldn't affect which port
is removed from the registry, because that's determined before opening
the registry entry to find the portfile.
If there is a bug, it's in the code for evaluating the 'current'
pseudo-portname. But it's not at all clear that we really want to make
it able to override variables, especially when in your example you don't
need to be using 'current' or overriding any variables anyway (just omit
the 'subport=' from your command line).
- Josh
More information about the macports-dev
mailing list