Ports recommending other ports

Rainer Müller raimue at macports.org
Mon Feb 9 04:10:06 PST 2009


Ryan Schmidt wrote:
> 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.

This could become a useful future addition, as currently all port
commands are non-interactive.

> 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.")

While I like the recommends feature, I don't think alternatives are that
good proposed. If they recommend alternatives for the current port one
should see them before installing this port at all. For example at the
'port info' output and then we can simply write such a sentence into the
long_description. After installing a port it is too late to inform about
alternatives.

> 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".)

If people have problems spelling "recommend", they will probably also
have problems with "supplements"?

Rainer


More information about the macports-dev mailing list