#37808: RFE: Add a "minor" variable to the perl portgroup --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by egall@…): Replying to [comment:1 ryandesign@…]:
The portgroup cannot know the actual version number of perl, since perl might not be installed yet at the time that the portgroup is being included into a portfile.
What is the use case for which you need to know this?
Well this might just be me being bad/new at writing portfiles, but I was trying to write a portfile for `cpan2port`, and for some reason it gave me the following error during the destroot phase: {{{ Error: org.macports.destroot for port p5.12-cpan2port returned: /opt/local/var/macports/build/_opt_local_var_macports_sources_local_perl_p5-cpan2port/p5.12-cpan2port/work/destroot/opt/local/lib/perl5/vendor_perl/5.12.4: no such file or directory }}} Now I didn't know why it was trying to do that, as I never asked it to make such a directory (I'm assuming the perl portgroup did?), but anyway, I tried to get around it by adding the following line of code: {{{ xinstall -d ${destroot}${prefix}/lib/perl5/vendor_perl/${perl5.major.minor} }}} And of course that errorred out because "minor" isn't actually a thing. idk, maybe I shouldn't even be using the perl portgroup at all for this port, but still, I think it'd be useful to have a "minor" variable anyway regardless of this use case. I can understand if it's not feasible though. Although then again, one thing I'm wondering, is why is the value of the variable being determined at include time? Couldn't it be determined at runtime? I don't really know that much about Tcl or MacPorts's internals, so forgive me if that's a stupid question... -- Ticket URL: <https://trac.macports.org/ticket/37808#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS