passing variants to dependencies; pre-activate check
David Strubbe
dstrubbe at macports.org
Sat Oct 10 17:34:59 PDT 2015
Thanks for checking. I realize now I can find these two different
behaviors, depending on whether the other dependency BWidget is installed
or not. I'm confused about why this would be happening. Why isn't
"Computing dependencies for xcrysden" happening in both cases?
(BWidget is installed)
$ sudo port -f uninstall tk xcrysden
$ sudo port install xcrysden +x11
---> Computing dependencies for tk
---> Fetching archive for tk
---> Attempting to fetch tk-8.6.3_0+quartz.darwin_14.x86_64.tbz2 from
http://mse.uk.packages.macports.org/sites/packages.macports.org/tk
...
$ sudo port -f uninstall tk xcrysden BWidget
$ sudo port install xcrysden +x11
---> Computing dependencies for xcrysden
---> Dependencies to be installed: BWidget tk
---> Fetching archive for tk
---> Attempting to fetch tk-8.6.3_0+x11.darwin_14.x86_64.tbz2 from
http://mse.uk.packages.macports.org/sites/packages.macports.org/tk
...
Regarding the pre-activate, I added this code to my copy of
active_variants-1.1.tcl:
+pre-activate {
+ ui_warn "checking active variants"
+ _check_require_active_variants archivefetch
+}
When I do a fresh install, I see this message before activate. When I
deactivate and re-activate, I don't see the message. My conclusion was that
pre-activate was not being run in the latter case -- is there some other
reason it wouldn't be written?
David
On Sat, Oct 10, 2015 at 7:06 PM, Joshua Root <jmr at macports.org> wrote:
> On 2015-10-11 09:33 , David Strubbe wrote:
> > Hi all,
> >
> > It seems to me that as of recently it was the case that variants from
> > the install command line are passed on to the building of dependencies
> > (as discussed below last year), but that it is no longer happening. Is
> > this something that was changed (deliberately or otherwise) in the 2.3.4
> > release?
> >
> > Specifically, my recently added xcrysden port needs tk +x11 (checked via
> > active_variants), whereas the default is +quartz. As of a couple of
> > weeks ago, I think I was able successfully to trigger installation of tk
> > +x11 when it was not installed by doing 'port install xcrysden +x11'.
> > But now this doesn't happen.
>
> I just checked and this still works the same as it has for many years.
>
> > Another question related to active_variants: would it be possible for
> > require_active_variants to perform its check not just in the
> > pre-configure phase as is currently the case, but also in the activate
> > phase? Currently, you could install xcrysden when tk +x11 was active,
> > then deactivate xcrysden, install tk +quartz, and re-activate xcrysden.
> > It would no longer work. It would be good if we could write an error at
> > this point. I tried adding code to pre-activate to accomplish this, but
> > I found it was only called when doing a fresh install, not when
> > activating a deactivated port. Is there a way to get some code to run
> > when activating a deactivated port?
>
> Preventing the activation would not be helpful I think, especially if
> the user is running something like 'port activate xcrysden tk +x11'.
> Printing a warning would be fine.
>
> I just checked the pre-activate behaviour as well and it still runs
> before every activation as intended. The only reason it wouldn't run is
> if the Portfile was missing from the registry or failed to parse.
>
> - Josh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20151010/4525ad6c/attachment-0001.html>
More information about the macports-dev
mailing list