Ports recommending other ports

Ryan Schmidt ryandesign at macports.org
Thu Feb 5 21:44:56 PST 2009


It might be nice if a port could recommend the user install another  
port in addition, via some new keyword. For example, graphviz could  
recommend the user install graphviz-gui as well. postgresql83 could  
recommend the user install postgresql83-server. port could output  
these recommendations at the end of the installation. ("You may wish  
to install graphviz-gui as well.") The advantage over just printing a  
message at post-install time would be that port or a MacPorts GUI  
could offer the user the choice to install those recommended ports  
too ("Would you like to install graphviz-gui now?") and could know to  
omit the suggestion if the suggested port is already installed.

There could be another new keyword for recommended alternatives to a  
given port. For example, on Leopard and later, graphviz-gui is a  
better choice than graphviz-oldgui (which is required on Tiger and  
earlier). ("You may wish to install graphviz-gui instead of graphviz- 
oldgui.")

Hypothetical addition to port graphviz:

if {${os.platform} == "darwin"} {
     if {${os.major} >= 9} {
         suggest_supplements-append port:graphviz-gui
     } else {
         suggest_supplements-append port:graphviz-oldgui
     }
}

Hypothetical additions to port graphviz-oldgui:

if {${os.major} >= 9} {
     suggest_alternatives-append port:graphviz-gui
}

(I used "suggest" instead of "recommend" in the keyword names because  
people have more trouble spelling "recommend".)



More information about the macports-dev mailing list