On Nov 1, 2008, at 14:15, Joshua Root wrote:

Ryan Schmidt wrote:

On Nov 1, 2008, at 13:29, [EMAIL PROTECTED] wrote:

Revision: 41395
          http://trac.macports.org/changeset/41395
Author:   [EMAIL PROTECTED]
Date:     2008-11-01 11:29:13 -0700 (Sat, 01 Nov 2008)
Log Message:
-----------
autoconf: fix path to perl in dependency

Modified Paths:
--------------
    trunk/dports/devel/autoconf/Portfile

Modified: trunk/dports/devel/autoconf/Portfile
===================================================================
--- trunk/dports/devel/autoconf/Portfile    2008-11-01 18:05:23 UTC
(rev 41394)
+++ trunk/dports/devel/autoconf/Portfile    2008-11-01 18:29:13 UTC
(rev 41395)
@@ -31,7 +31,7 @@
                 sha1 f15e14aa34acf871b47f659ef99a2e6707db4a18 \
                 rmd160 273448a60bc4dfcfcb3ee455ef012333eeca3256

-depends_lib     path:${prefix}/bin/perl:perl5 \
+depends_lib     path:bin/perl:perl5 \
                 port:m4 \
                 port:help2man

Why remove ${prefix} from the path? That doesn't seem right to me...
I've always included ${prefix} when defining a path:-style dependency.
The Guide also shows that the ${prefix} should be there in its lone
path:-style dependency example:

http://guide.macports.org/#reference.dependencies.types

Because I noticed that when I upgraded autoconf, it was trying to
install perl5 despite ${prefix}/bin/perl existing due to perl5.8 being
installed, and I therefore went and read the actual code. :-)

Turns out that depspecs are escaped, so variable substitution is not
performed. Additionally, ${prefix} is prepended to any path that doesn't
start with a slash. So it was actually looking for
/opt/local/\${prefix}/bin/perl.

Well, the documentation shows that the path should start with $ {prefix} if that's what's meant. Such usage is easily understandable. Auto-prepending ${prefix} for non-absolute paths is a convenience, and one which is not documented, and which until your change to autoconf was not used by any port [1]. We could document it and begin using it. But lack of variable substitution in depspecs must be a bug. As of r41396, we have 206 occurrences of "path:${prefix}" in the ports tree [2]. There are also several depspecs that expect variable substitution of variables other than ${prefix} [3].

So I think it would be easier and better to fix the base code to match the documentation, rather than change the documentation and all the affected ports.


[1] grep 'path:[^$ /]' */*/Portfile

[2] grep 'path:${prefix}' */*/Portfile

[3] grep 'path:\$' */*/Portfile | grep -v 'path:${prefix}'



_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to