Ticket #53775: Portfile.patch

File Portfile.patch, 783 bytes (added by crapshoot, 8 years ago)
  • Portfile

    old new  
    6262    foreach f [glob ${destroot}${prefix}/libexec/emacs/${emacs_version}/*/*] {
    6363        move ${f} ${app_dir}/../MacOS/libexec
    6464    }
    65     delete ${destroot}${prefix}
     65    # Remove everything from ${destroot}${prefix} except ${app_dir}
     66    if {0 != [string first ${destroot}${prefix} ${app_dir}]} {
     67        # ${app_dir} is not a subdirectory of ${prefix}
     68        delete ${destroot}${prefix}
     69    } else {
     70        foreach d [glob ${destroot}${prefix}/*] {
     71            if {0 != [string first ${d} ${app_dir}]} {
     72                delete ${d}
     73            }
     74        }
     75    }
    6676
    6777    # make the application binary a hard link.
    6878    delete ${app_dir}/../MacOS/Emacs