Ports and their dependencies (run deps and also versioning questions)

Tabitha McNerney tabithamc at gmail.com
Fri Jun 6 02:15:39 PDT 2008


Rainer, et al ...

On 5/31/08, Rainer Müller <raimue at macports.org> wrote:

[snip]

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


I have recently written a script that runs the commands as you suggested,
for a list of all MacPorts I have on my system. My parsing script pretty
much expects this type of format resulting from the port command (example
for library dependencies):

$ port info --depends_lib portname @version_revision
>

-->

depends_lib: [sequence of zero or more: port:dependencyportname]
>

Here's a real example:

$ port info --depends_lib libvorbis
>

-->

depends_lib: port:libogg
>

In the above example of course we only have one instance of "port:" which is
"port:libogg" but of course there could be zero or more than one instance. I
wrote my script to expect the format of either zero instances or at least
one of: "depends_lib: port:portname" as well has handling the type cases of
"depends_build:" and "depends_run:"

But, then my script ran into this specific problem:

$ port info --depends_lib speex @1.0.5
>

-->

depends_lib: lib:libogg:libogg
>

Hmmm ... the repeat of the library dependency libogg looks to be incorrect.
Also, the first instance of the libogg dependency is preceded by "lib:" but
shouldn't that be "port:" instead?

Of course the port command is only reading what it sees, which is correct
for it do this logically since the port command probably doesn't check for
human authoring errors of Portfiles. I state so because I had a look at the
speex Portfile and I found this, excerpted:

depends_lib      lib:libogg:libogg
>

Since my script is going to go through about 450 ports looking for their
dependencies (library, build, run), I will find the Portfiles that have
errors such as speex above and I imagine the best thing to do is file a
ticket / bug reporting true? I will of course also change and correct the
errors. Does that seem to be the right thing to do or maybe, if I am missing
something, I should instead write my script to adapt for a variety of output
conditions such as the above?

Thanks,

T.M.

[snip]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-users/attachments/20080605/b4ff104c/attachment.htm 


More information about the macports-users mailing list