On Jan 28, 2018, at 09:17, Stephen Rasku wrote:

> I just enabled bash-completion for MacPorts but the already installed
> ports didn't have this enabled.  I would like to upgrade the installed
> ports to enable this variant.  Eventually, I would like to do this for
> all installed ports but I am starting with Mercurial first.  I tried
> this:
> 
>    $ port variants mercurial
>    mercurial has the variants:
>       bash_completion: Completion support for bash
>       universal: Build for multiple architectures
>       zsh_completion: Install mercurial zsh completion file
> 
>    $ sudo port upgrade --enforce-variants mercurial +bash_completion
>    --->  Scanning binaries for linking errors
>    --->  No broken files found.
> 
>    $ port variants mercurial
>    mercurial has the variants:
>       bash_completion: Completion support for bash
>       universal: Build for multiple architectures
>       zsh_completion: Install mercurial zsh completion file
> 
> It doesn't appear to have worked.  There is no "+" beside
> bash_completion and there is no "mercurial" file in
> /opt/local/etc/bash_completion.d.
> 
> What am I doing wrong?

From what you've described, I can only conclude that you already had mercurial 
installed with the +bash_completion variant. If you didn't, what you did would 
have worked:


$ port installed mercurial
The following ports are currently installed:
  mercurial @4.4.2_0 (active)
$ sudo port upgrade --enforce-variants mercurial +bash_completion
--->  Computing dependencies for mercurial
--->  Fetching archive for mercurial
--->  Attempting to fetch 
mercurial-4.4.2_0+bash_completion.darwin_16.x86_64.tbz2 from 
https://packages.macports.org/mercurial
--->  Fetching distfiles for mercurial
--->  Verifying checksums for mercurial
--->  Extracting mercurial
--->  Applying patches to mercurial
--->  Configuring mercurial
--->  Building mercurial
--->  Staging mercurial into destroot
--->  Installing mercurial @4.4.2_0+bash_completion
--->  Cleaning mercurial
--->  Computing dependencies for mercurial
--->  Deactivating mercurial @4.4.2_0
--->  Cleaning mercurial
--->  Activating mercurial @4.4.2_0+bash_completion
--->  Cleaning mercurial
$ port installed mercurial
The following ports are currently installed:
  mercurial @4.4.2_0
  mercurial @4.4.2_0+bash_completion (active)


Note that:

* "port variants" shows you what variants are available, not what variants you 
have installed. It will only show a + (or -) next to variants that you have 
explicitly enabled (or disabled) on the command line at the time when you run 
"port variants", or in variants.conf. Use "port installed" to see what you have 
installed.

* mercurial's +bash_completion variant doesn't put files in 
/opt/local/etc/bash_completion.d. Use "port contents mercurial" to see what it 
installed.

Reply via email to