pre- & post-(de)activate?

Michael Dickens michaelld at macports.org
Tue Jul 6 22:40:13 PDT 2010


I think I've worked out most of the issues with my local qt4-mac
Portfile; all the variants are now installing & tweaking the select file
correctly.  I will do a little more testing tomorrow morning, and if all
goes well I'll check in the change tomorrow evening.

During these tests, I realized that it would be convenient to make use
of "post-activate" and "pre-deactivate" for the purposes of handling
whether or not this port is selected; from the code in
base/src/port1.0/*.tcl it looks like these phases should work if
specified in the Portfile.

When I do "sudo port install qt4-mac", the "post-activate" phase
executes correctly & determines if 'qt4_select' already has a port
selected & if not then it selects this port; if something is already
selected, then it just prints out a message to the user with its
findings & how to select this port.

What I'd like now is to use "pre-deactivate" to check to see if this
port is selected & if so select 'none' and print a message warning the
user ... but my "pre-deactivate" phase isn't executed when I do "sudo
port deactivate qt4-mac".  And, after deactivating qt4-mac, if I do
"sudo port activate qt4-mac" my "post-activate" phase is no longer
called -- ideally it would be called for either type of "activate".

What am I not getting?  Thanks! - MLD


More information about the macports-dev mailing list