New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 81463


Ignore:
Timestamp:
07/31/11 02:22:36 (4 years ago)
Author:
dports@…
Message:

fuse4x-kext: update post-activate logic. If another version of the
kext is currently loaded, attempt to unload it. If that fails, print a
list of filesystems that need to be unmounted. See #30437.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/fuse/fuse4x-kext/Portfile

    r81149 r81463  
    6767} 
    6868 
     69# We don't need to load the kext, because the fuse4x library will 
     70# autoload it when needed. However, if there's an existing version 
     71# loaded, we'd better unload it because it might be a different 
     72# version. 
     73# 
     74# Thus, check whether the kext is already loaded, and if so attempt to 
     75# unload it. If that fails, the user probably needs to unmount some 
     76# running filesystems; print a list. 
    6977post-activate { 
    70     if {[string length [exec kextstat -lb org.fuse4x.kext.fuse4x]] > 0} { 
    71         ui_msg "********************************************************" 
    72         ui_msg "*  fuse4x is already loaded. You may need to restart.  *" 
    73         ui_msg "*  Alternatively, if feeling adventurous, you can run  *" 
    74         ui_msg "*  `sudo kextunload -b org.fuse4x.kext.fuse4x`         *" 
    75         ui_msg "********************************************************" 
     78    set kextid "org.fuse4x.kext.fuse4x" 
     79    if {[string length [exec /sbin/kextstat -lb $kextid]] > 0} { 
     80        ui_msg "Another version of Fuse4X is already loaded. Attempting to unload it." 
     81        if {![catch {exec /sbin/kextunload -b $kextid}]} { 
     82            ui_msg "Successfully unloaded the previous installation of Fuse4X" 
     83        } else { 
     84            set mounted [exec /sbin/mount -t fuse4x] 
     85            ui_warn "Unable to unload the existing Fuse4X kernel extension." 
     86            ui_warn "To complete the upgrade. please unmount the following filesystems " 
     87            ui_warn "and then run `sudo kextunload -b $kextid`:" 
     88            foreach line [split $mounted "\n"] { 
     89                regexp {on (/.*) \(fuse4x} $line -> mountpoint 
     90                ui_warn "  - $mountpoint" 
     91            } 
     92        } 
    7693    } 
    7794} 
Note: See TracChangeset for help on using the changeset viewer.