New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 79443


Ignore:
Timestamp:
06/13/11 07:33:27 (4 years ago)
Author:
jmr@…
Message:

don't delete empty /Library/Launch{Agents,Daemons} when deactivating files in them (#27920)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/registry2.0/portimage.tcl

    r79167 r79443  
    559559} 
    560560 
     561# These directories should not be removed during deactivation even if they are empty. 
     562# TODO: look into what other dirs should go here 
     563variable precious_dirs 
     564array set precious_dirs { /Library/LaunchDaemons 1 /Library/LaunchAgents 1 } 
     565 
    561566proc _deactivate_file {dstfile} { 
    562567    if { [file type $dstfile] == "link" } { 
     
    566571        # 0 item means empty. 
    567572        if { [llength [readdir $dstfile]] == 0 } { 
    568             ui_debug "deactivating directory: $dstfile" 
    569             file delete -- $dstfile 
     573            variable precious_dirs 
     574            if {![info exists precious_dirs($dstfile)]} { 
     575                ui_debug "deactivating directory: $dstfile" 
     576                file delete -- $dstfile 
     577            } else { 
     578                ui_debug "directory $dstfile does not belong to us" 
     579            } 
    570580        } else { 
    571581            ui_debug "$dstfile is not empty" 
Note: See TracChangeset for help on using the changeset viewer.