Re: platform{} statement

2016-06-05 Thread René J . V . Bertin
On Sunday June 05 2016 17:00:17 Gustaf Neumann wrote: > i was talking about a general mechanism, through which a port maintainer > can change the behavior of commands on which others depend. I do not see > much danger with extending the platform command as discussed. Of course. I wasn't thinkin

Re: platform{} statement

2016-06-05 Thread Gustaf Neumann
understanding of the consequences of such changes to other ports. This would make maintenance even more difficult. What effect could the addition of an "else" condition to the platform statement have on other ports, whether it's provided through a PortGroup (or similar) or through base

Re: platform{} statement

2016-06-05 Thread René J . V . Bertin
nces of such changes to other ports. This would make maintenance >even more difficult. What effect could the addition of an "else" condition to the platform statement have on other ports, whether it's provided through a PortGroup (or similar) or through base? If it's done thro

Re: platform{} statement

2016-06-05 Thread Gustaf Neumann
Am 05.06.16 um 12:14 schrieb René J.V. Bertin: On Saturday June 04 2016 13:41:59 Gustaf Neumann wrote: yes, the {$len == 1} check needs to be generalized (was wrong in the earlier versions as well). If you mean in the other procedures: no, i was referring with "earlier version" to the posted

Re: platform{} statement

2016-06-05 Thread René J . V . Bertin
On Saturday June 04 2016 13:41:59 Gustaf Neumann wrote: >yes, the {$len == 1} check needs to be generalized (was wrong in the >earlier versions as well). If you mean in the other procedures: will you file an enhancement/submission trac ticket to "base" that takes care of that, or do I file one

Re: platform{} statement

2016-06-04 Thread René J . V . Bertin
Gustaf Neumann wrote: > The original code used as signature "proc platform {args} ..." and > pulled later the "os" out of $args, whereas the posted one uses "proc > platform {os args}", Ah, right. Missed that :-/ > called, then the variant with "$consumed == 3" will call the uplevel, Why? "Do

Re: platform{} statement

2016-06-04 Thread Gustaf Neumann
Am 04.06.16 um 10:08 schrieb René J. V. Bertin: if {$len < 1} { My code has 2 here, and I think that's reasonable ("platform darwin" on its own doesn't make a lot of sense). The original code used as signature "proc platform {args} ..." and pulled later the "os" out of $args, whereas the

Re: platform{} statement

2016-06-04 Thread René J . V . Bertin
Gustaf Neumann wrote: > The code below is more in line with current tcl code practice Seems to work too > (untested, using e.g. tcl index expressions). after correcting a few omissions ;) > if {$len < 1} { My code has 2 here, and I think that's reasonable ("platform darwin" on its own d

Re: platform{} statement

2016-06-03 Thread Gustaf Neumann
Am 03.06.16 um 14:55 schrieb René J. V. Bertin: Rainer Müller wrote: The definition of the platform proc is here: https://trac.macports.org/browser/trunk/base/src/port1.0/portutil.tcl?rev=149111#L765 Extending that syntax with an optional code block after an "else" keyword would be possible

Re: platform{} statement

2016-06-03 Thread René J . V . Bertin
Rainer Müller wrote: > The definition of the platform proc is here: > > https://trac.macports.org/browser/trunk/base/src/port1.0/portutil.tcl?rev=149111#L765 > > Extending that syntax with an optional code block after an "else" > keyword would be possible. Once I knew it was possible it wasn't

Re: platform{} statement

2016-05-31 Thread René J . V . Bertin
On Tuesday May 31 2016 09:31:02 Brandon Allbery wrote: > On Tue, May 31, 2016 at 4:24 AM, René J.V. wrote: > Is there some reason you can't invert the logic? I don't see how, not if you have things to be done on one platform and other things to be done on another. That's why I used if/else cons

Re: platform{} statement

2016-05-31 Thread Brandon Allbery
On Tue, May 31, 2016 at 4:24 AM, René J.V. wrote: > That's a pity. I had quite a few if {${os.platform} eq "darwin"} {} else > {} statements in certain of my ports, which I most all replaced with > platform statements at the suggestion to do so. Is there some reason you can't invert the logic?

Re: platform{} statement

2016-05-31 Thread Rainer Müller
On 2016-05-31 10:24, René J.V. Bertin wrote: > Would it be hard (and potentially acceptable) to extend the syntax to > > platform ... { > } else { > } > > of something of the sort? That seems like it might require patching the Tcl > source code. The definition of the platform proc is here: htt

Re: platform{} statement

2016-05-31 Thread René J . V . Bertin
On Sunday May 29 2016 10:14:53 Ryan Schmidt wrote: >Correct, you can't use a platform statement to do that, so use an if >statement. That's a pity. I had quite a few if {${os.platform} eq "darwin"} {} else {} statements in certain of my ports, which I most

Re: platform{} statement

2016-05-29 Thread Ryan Schmidt
variant" has not been correct for several years. The platform statement used to behave like the variant statement (creating a block of code that executes after the rest of the portfile) but now behaves like an if statement (executing the code immediately where it appears in the portfile).

platform{} statement

2016-05-29 Thread René J . V . Bertin
Hi, The documentation states that the platform{} syntax for specifying platform variants doesn't allow you to specify a range of platforms. That still seems to be accurate. So there is no way to use a single platform statement to replace `if {${os.platform} ne "darwin"}` (I