[MacPorts] #39785: netcdf fails to index
#39785: netcdf fails to index --------------------+----------------------- Reporter: cal@… | Owner: takeshi@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Keywords: | Port: netcdf --------------------+----------------------- When I try to generate PortIndex, I see: {{{ Failed to parse file science/netcdf/Portfile: grep: /opt/local/lib/libhdf5.settings: No such file or directory }}} Please ensure the Portfile does execute correctly without the file /opt/local/lib/libhdf5.settings present (e.g. by wrapping the call to grep with a `catch` statement). If you want to change the default variants and/or throw an error depending on whether a certain variant is present in a dependent port, you can use the `active_variants` PortGroup (see source:trunk/dports/_resources/port1.0/group/active_variants-1.1.tcl, which has some documentation). -- Ticket URL: <https://trac.macports.org/ticket/39785> MacPorts <http://www.macports.org/> Ports system for OS X
#39785: netcdf fails to index ---------------------+----------------------- Reporter: cal@… | Owner: takeshi@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: netcdf | ---------------------+----------------------- Changes (by takeshi@…): * status: new => closed * resolution: => fixed Comment: Thank you for pointing this out. I didn't pay enough attention to what happens if hdf5-18 is not installed. Now the grep is called if netcdf4 variant (default), which defines the dependency to hdf5-18, is set. -- Ticket URL: <https://trac.macports.org/ticket/39785#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#39785: netcdf fails to index ---------------------+----------------------- Reporter: cal@… | Owner: takeshi@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: netcdf | ---------------------+----------------------- Changes (by ryandesign@…): * status: closed => reopened * resolution: fixed => Comment: Not enough: {{{ $ port info netcdf +netcdf4 Error: Unable to open port: grep: /opt/local/lib/libhdf5.settings: No such file or directory }}} You cannot be sure that the dependency has been installed by that time. You should use the active_variants 1.1 portgroup as already discussed in greater detail on the mailing list. -- Ticket URL: <https://trac.macports.org/ticket/39785#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#39785: netcdf fails to index ---------------------+----------------------- Reporter: cal@… | Owner: takeshi@… Type: defect | Status: reopened Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: netcdf | ---------------------+----------------------- Comment (by takeshi@…): I wrapped the call to grep with active_variants command. {{{ if {[variant_isset netcdf4]} { if {[active_variants hdf5-18 hdf5-18 ""]} { set hdf5cc [exec grep "C Compiler" ${prefix}/lib/libhdf5.settings | awk {BEGIN{FS="/"}{print $NF}}] .... } } }}} I get the following error with hdf5-18 deactivated and issue {{{ $ port info netcdf +netcdf4 Error: Unable to open port: Registry error: hdf5-18 not registered as installed & active. }}} Is this the expected error? -- Ticket URL: <https://trac.macports.org/ticket/39785#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#39785: netcdf fails to index ---------------------+----------------------- Reporter: cal@… | Owner: takeshi@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: netcdf | ---------------------+----------------------- Changes (by takeshi@…): * status: reopened => closed * resolution: => fixed Comment: I used catch as in the example. Committed in r108320. -- Ticket URL: <https://trac.macports.org/ticket/39785#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts