Ports and their dependencies (run deps and also versioning questions)
Rainer Müller
raimue at macports.org
Sat May 31 20:22:13 PDT 2008
Tabitha McNerney wrote:
> On 5/30/08, Rainer Müller <raimue at macports.org> wrote:
> $ port deps Xft2 @2.1.12_0
>> @version is ignored for port deps.
>>
>> port deps takes infos from PortIndex only, so it may not always be
>> accurate.
>
> Meaning, if a port has changed (or a new port has been added) but the
> PortIndex has not been updated?
Exactly. Or the port has been installed before, but a new PortIndex (and
Portfile) was synced later which adds a new dependency.
> [...]
> So this would really be the only way (with a machine and parsing software)
> to automatically confirm the probable version information of the ldap
> (openldap port) variant for the library dependency when ldap is a variant
> tacked on to postfix?
Hmmmmmm.... *taking a deep thought*
Aaaah, port info!
Use like this:
$ port info --depends_build --depends_lib --depends_run postfix +ldap
You can also add --line to compress the output to one line only. You can
hide the label in front of the line and error output by using port -q info.
As variants are also parsed from the @version notation, you can simply
call this as:
$ port -q info --line --depends_build --depends_lib --depends_run \
postfix @2.4.6_0+ldap+pcre+sasl+tls
But if you only need the set of variants you have currently installed:
$ port -q info --line --depends_build --depends_lib --depends_run \
postfix and installed
And if you need this for multiple installed ports, this is also
possible. You can use port echo to check to what such a port list expands:
$ port echo \( postfix openldap \) and installed
"or" is the default logical operator in such lists, so you do not need
to write it explicitely.
There is still a little bug though, port -q info --depends_build postfix
outputs the usual info as postfix does not have dependencies. I am going
to have a look into this.
These are awesome features of port, don't you think? I hope you didn't
invest too much work into writing your own parser for Portfiles...
But I have to admit I would have never gotten the idea to use port info
if I would not have made other changes to port/port.tcl today. :-)
Maybe we should really make port deps aware of variants.
Rainer
More information about the macports-users
mailing list