Ignore:
Timestamp:
Nov 4, 2014, 3:44:26 PM (5 years ago)
Author:
khindenburg@…
Message:

logwatch: delete bad installed file correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/security/logwatch/Portfile

    r127815 r127816  
    66name                logwatch
    77version             7.4.1
    8 revision            1
     8revision            2
    99distname            logwatch-${version}
    1010categories          security
     
    6262post-destroot {
    6363    file delete /Library/LaunchDaemons/org.macports.${name}.plist
    64     file delete /opt/local/bin/logwatch
    6564    xinstall -d -m 0755 ${destroot}/Library/LaunchDaemons
    6665    ln -sf ${prefix}/etc/LaunchDaemons/${name}/org.macports.${name}.plist ${destroot}/Library/LaunchDaemons/
    6766    ln -sf ${prefix}/share/${name}/scripts/logwatch.pl ${destroot}${prefix}/bin/logwatch
     67}
     68
     69pre-activate {
     70    #- this port used to create a symlink directly in ${prefix} which was fixed in 7.4.1_1
     71    #- we need to remove this symlink from ${prefix} though, so upgrades work
     72    #- this can eventually be removed, origionally added 2014-10-01
     73    set badfile ${prefix}/bin/${name}
     74    if {[file exists ${badfile}] && [registry_file_registered ${badfile}] == "0"} {
     75        if {[catch {delete ${badfile}}]} {
     76            ui_warn "Cannot delete ${badfile}; please remove it manually"
     77        }
     78    }
    6879}
    6980
Note: See TracChangeset for help on using the changeset viewer.