[MacPorts] #26034: qt4-mac fails on Tiger: find: 1: unknown expression primary
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Couldn't upgrade qt4-mac on my Tiger i386 machine; it said: {{{ [snip] :info:destroot xinstall: /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work /qt-everywhere-opensource-src-4.6.3/INSTALL -> /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work/destroot/opt/local/libexec/qt4-mac/share/doc/qt4-mac/INSTALL :info:destroot xinstall: /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work /qt-everywhere-opensource-src-4.6.3/LGPL_EXCEPTION.txt -> /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work/destroot/opt/local/libexec/qt4-mac/share/doc/qt4-mac/LGPL_EXCEPTION.txt :info:destroot xinstall: /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work /qt-everywhere-opensource-src-4.6.3/LICENSE.GPL3 -> /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work/destroot/opt/local/libexec/qt4-mac/share/doc/qt4-mac/LICENSE.GPL3 :info:destroot xinstall: /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work /qt-everywhere-opensource-src-4.6.3/LICENSE.LGPL -> /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work/destroot/opt/local/libexec/qt4-mac/share/doc/qt4-mac/LICENSE.LGPL :info:destroot xinstall: /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work /qt-everywhere-opensource-src-4.6.3/README -> /opt/local/var/macports/build/_Users_rschmidt_macports_dports_aqua_qt4-mac/work/destroot/opt/local/libexec/qt4-mac/share/doc/qt4-mac/README :error:destroot Target org.macports.destroot returned: find: 1: unknown expression primary }}} The problem is this part of the portfile: {{{ foreach tfm [exec find ${destroot}${qt_dir}/lib -name "*.framework" \ -type d -depth 1 | sed -e "s@\.framework@@g" \ -e "s@${destroot}${qt_dir}/lib/@@g"] { }}} According to "`man find`" on Tiger, the "`-depth`" option does not take an argument. {{{ -d The -d option causes find to perform a depth-first traversal, i.e., directories are visited in post-order and all entries in a directory will be acted on before the directory itself. By default, find visits directories in pre-order, i.e., before their contents. Note, the default is not a breadth-first traversal. [snip] -depth Always true; same as the -d option. -depth can be useful when find is used with cpio(1) to process files that are contained in directories with unusual permissions. It enures that you have write permission while you are placing files in a directory, then sets the directory's permissions as the last thing. }}} Perhaps you can replace "`exec find`" with "`fs-traverse`" or, since via the "`-depth 1`" option, you seem to be wanting only immediate children of the directory, likely "`glob`" is what you should be using. -- Ticket URL: <http://trac.macports.org/ticket/26034> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Comment(by michaelld@…): Go figure about 'find' ... Looks like 'glob' will work, though that involves 2 steps instead of the 1 I had :( I think the following will work; I'll test tomorrow. {{{ foreach frms [glob -type d -directory ${destroot}${qt_dir}/lib \ *.framework] { set tfm [exec echo ${frms} | \ sed -e "s@\[^ \]*/\\(\[^ \]*\\)\\.framework.*@\\1@"] }}} I'm trying to avoid using 'ls' since it generates an error if it finds nothing, though in this case there had darn better be *.framework directories since it's a framework build ... -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Comment(by ryandesign@…): Don't use "`exec echo | sed`"; use a Tcl function, like `strsed` or `regsub`. -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Comment(by ryandesign@…): I'd also tend toward more self-explanitory variable names, e.g. "frms" takes a little while to comprehend; "frameworks" would be so much clearer. -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Comment(by michaelld@…): OK; I'll look up strsed & regsub and see what makes the most sense. I'm not really a TCL programmer. -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Comment(by ryandesign@…): That's one of the joys of working on the innards of MacPorts: becoming one. :) -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Comment(by michaelld@…): Indeed and not a bad thing IMHO; I certainly have learned a lot about regex, both regular and extended. -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary -------------------------------------+-------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Keywords: | Port: qt4-mac -------------------------------------+-------------------------------------- Comment(by michaelld@…): This works for me: {{{ foreach full_framework [glob -type d -directory ${destroot_qt}/lib \ *.framework] { regexp {[^ ]*/(.+)\.framework.*} ${full_framework} match framework }}} and then 'framework' holds the desired value. In this case, because I know that qt4-mac is a framework install, I can also do: {{{ foreach framework [exec ls ${destroot_qt}/lib | \ grep framework | \ sed -e "s@\\.framework.*@@"] { }}} which is, overall, about as simple (or complex) as the combined 'glob' and 'regexp'. If the 'ls' command allowed me to specify '*.framework' then I'd do that to remove the 'grep' -- /bin/ls does allow me to do this. If I do "exec ls ${destroot_qt}/lib/*.framework" instead of the above, then I get back "ls: ${destroot_qt}/lib/*.framework: No such file or directory" ... while from 'bash' I get the listing I want. Anyway, do you have a preference as to which of the above I use? -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#26034: qt4-mac fails on Tiger: find: 1: unknown expression primary --------------------------------------+------------------------------------- Reporter: ryandesign@… | Owner: michaelld@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.1 Resolution: fixed | Keywords: Port: qt4-mac | --------------------------------------+------------------------------------- Changes (by michaelld@…): * status: new => closed * resolution: => fixed Comment: I'm going with the 'ls | grep | sed' option, since I think it's a little clearer. Fixed in r70523. -- Ticket URL: <http://trac.macports.org/ticket/26034#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts