[MacPorts] #37808: RFE: Add a "minor" variable to the perl portgroup
#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 Keywords: | Port: -------------------------+-------------------------------- So that in a portfile, I can use something like this: {{{ ${perl5.major.minor} }}} to get an output of something like this: {{{ 5.12.4 }}} -- Ticket URL: <https://trac.macports.org/ticket/37808> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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 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? -- Ticket URL: <https://trac.macports.org/ticket/37808#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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
#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 ryandesign@…): I can't explain right now why that problem is happening to you with your cpan2port port, but I have a feeling the solution isn't just to create that directory. Note that the period is not a special character in variable names. So we have a variable called "perl5.major" and you're asking to create variable called "perl5.major.minor" (not just "minor"). If there is to be a port for cpan2port (which is a good idea) it should just be called cpan2port. We do not need versions of cpan2port for each perl version, because cpan2port is not a perl module; it's just a program that happens to use perl. I glanced at the cpan2port script for a few seconds and didn't immediately see a reason why it would need to use the perl5 portgroup to be installed. Am I missing something? -- Ticket URL: <https://trac.macports.org/ticket/37808#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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:3 ryandesign@…]:
I can't explain right now why that problem is happening to you with your cpan2port port, but I have a feeling the solution isn't just to create that directory.
Note that the period is not a special character in variable names. So we have a variable called "perl5.major" and you're asking to create variable called "perl5.major.minor" (not just "minor").
Oh, I didn't realize that. I thought something C#-like was going on...
If there is to be a port for cpan2port (which is a good idea) it should just be called cpan2port. We do not need versions of cpan2port for each perl version, because cpan2port is not a perl module; it's just a program that happens to use perl.
I glanced at the cpan2port script for a few seconds and didn't immediately see a reason why it would need to use the perl5 portgroup to be installed. Am I missing something?
No, it probably doesn't need the perl5 portgroup... I originally was going to try to do it without, but no one on irc had any ideas of a perl port that does'''n't''' use the perl5 portgroup that I could use as an example to work from, so instead I just used `portfile-gen` with the `-g perl5` flag set to give me a starting spot, as that seemed easier at the time... -- Ticket URL: <https://trac.macports.org/ticket/37808#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#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@…): Anyway we can move the discussion for a `cpan2port` port to ticket #37823 now, as I now have a working portfile for it that does'''n't''' use the perl5 portgroup after all. -- Ticket URL: <https://trac.macports.org/ticket/37808#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#37808: RFE: Add a "minor" variable to the perl portgroup --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: wontfix | Keywords: Port: | --------------------------+-------------------------------- Changes (by ryandesign@…): * status: new => closed * resolution: => wontfix Comment: Ok. Let's call this "wontfix". -- Ticket URL: <https://trac.macports.org/ticket/37808#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts