Ignore:
Timestamp:
Sep 7, 2011, 11:30:20 PM (8 years ago)
Author:
ryandesign@…
Message:

app-1.0.tcl: fix error when app.executable refers to a symlink in the destroot and a previous version of the port is not already installed (#31157)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/app-1.0.tcl

    r82933 r83624  
    212212           
    213213            # If app.executable is in the destroot, link to it.
    214             if {[file exists ${destroot}${executable}]} {
     214            if {[file exists ${destroot}[app._resolve_symlink ${executable} ${destroot}]]} {
    215215                ln -s ${executable} ${destroot}${applications_dir}/${app.name}.app/Contents/MacOS/${app.name}
    216216            } elseif {[file exists ${executable}]} {
     
    280280    }
    281281}
     282
     283
     284# Recursively resolve a symlink in a destroot.
     285proc app._resolve_symlink {path destroot} {
     286    if {[catch {set resolved_path [file join [file dirname ${path}] [file readlink ${destroot}${path}]]}]} {
     287#        ui_debug "In ${destroot}, ${path} is not a symlink"
     288        return ${path}
     289    }
     290#    ui_debug "In ${destroot}, ${path} is a symlink to ${resolved_path}"
     291    return [app._resolve_symlink ${resolved_path} ${destroot}]
     292}
Note: See TracChangeset for help on using the changeset viewer.