Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#44649 closed defect (fixed)

mpv portfile does not parse

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: haspatch Cc:
Port: mpv

Description

On Mac OS X 10.4:

Can't map the URL 'file://.' to a port description file ("expected boolean value but got "${os.major} == 10 && ${os.minor} >= 3"").

Change History (10)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

This seems to fix it:

Index: Portfile
===================================================================
--- Portfile    (revision 123795)
+++ Portfile    (working copy)
@@ -112,7 +112,7 @@
                     "
 
     # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+
-    if {${os.major} > 10 || {${os.major} == 10 && ${os.minor} >= 3}} {
+    if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} {
         configure.args-delete   --disable-vda-hwaccel \
                                 --disable-vda-gl
         configure.args-append   --enable-vda-hwaccel \

comment:2 Changed 10 years ago by larryv (Lawrence Velázquez)

Strictly speaking, the grouping isn’t necessary at all, since Tcl uses C-esque operator precedence (logical-AND binds more tightly than logical-OR). I suppose it does have some readability value.

comment:3 Changed 10 years ago by Ionic (Mihai Moldovan)

Isn't TCL fun.

Yes, I prefer grouping for readability/understandability.

Feel free to push, Ryan.

May I ask how you got that? Neither portindex nor port itself complained with my original code.

On the other hand, are you sure this 10.4 box uses latest base? ${os.minor} was introduced only recently with 2.3.0 IIRC.

Last edited 10 years ago by Ionic (Mihai Moldovan) (previous) (diff)

comment:4 in reply to:  3 ; Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added
Resolution: fixed
Status: newclosed

Replying to ionic@…:

Isn't TCL fun.

Quite!

Yes, I prefer grouping for readability/understandability.

Feel free to push, Ryan.

r123883

May I ask how you got that? Neither portindex nor port itself complained with my original code.

I just updated my ports tree with "sudo port -v sync" as usual and noticed the parse failure in the portindex output, then went to investigate. Are you saying you tested on 10.6 or earlier and didn't see this error?

On the other hand, are you sure this 10.4 box uses latest base? ${os.minor} was introduced only recently with 2.3.0 IIRC.

Yes, it's using 2.3.1.

comment:5 in reply to:  4 Changed 10 years ago by larryv (Lawrence Velázquez)

Replying to ryandesign@…:

Yes, it's using 2.3.1.

Is this related to Tcl version? Doesn’t 2.3.1 bundle Tcl 8.5?

comment:6 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Yes, MacPorts 2.3 and up bundle Tcl 8.5 so MacPorts is now using the same version of Tcl on all versions of OS X.

comment:7 in reply to:  6 Changed 10 years ago by larryv (Lawrence Velázquez)

Given the unified Tcl, I guess I’m not understanding why this would fail on Tiger but not on more recent OSes.

comment:8 Changed 10 years ago by Ionic (Mihai Moldovan)

Maybe due to short circuit evaluation. I have only tested on 10.9, which falls into the first branch and doesn't check the second one.

comment:9 in reply to:  8 Changed 10 years ago by larryv (Lawrence Velázquez)

That sounds right. I was thinking that later Tcl started accepting braces for grouping, or something.

comment:10 Changed 10 years ago by Ionic (Mihai Moldovan)

From MacPort's tclsh:

% if {"a" eq "a" || {"a" eq "b"}} { puts foo } else { puts bar }
foo
0
% if {{"a" eq "a"} || {"a" eq "b"}} { puts foo } else { puts bar }
expected boolean value but got ""a" eq "a""
Note: See TracTickets for help on using tickets.