Ticket #31280: move_unload_to_deactivate.diff

File move_unload_to_deactivate.diff, 2.0 KB (added by anatol (Anatol Pomozov), 13 years ago)
  • fuse4x-kext/Portfile

     
    6666    xinstall -o root -m 4755 ${worksrcpath}/build/${xcode.configuration}/load_fuse4x ${destroot}${kextdir}/fuse4x.kext/Support
    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.
     69# If fuse4x kext is runnig let's unload it before deactivating the port.
    7370#
    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
     71# If unload fails the user probably needs to unmount some
    7672# running filesystems; print a list.
    77 post-activate {
     73pre-deactivate {
    7874    set kextid "org.fuse4x.kext.fuse4x"
    7975    if {[string length [exec /usr/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 {
     76        if {[catch {exec /sbin/kextunload -b $kextid}]} {
    8477            set mounted [exec /sbin/mount -t fuse4x]
    8578            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`:"
     79            ui_warn "To complete the deactivation please unmount the following filesystems:"
    8880            foreach line [split $mounted "\n"] {
    89                 regexp {on (/.*) \(fuse4x} $line -> mountpoint
    90                 ui_warn "  - $mountpoint"
     81                regexp {(.*)@fuse\d+ on (/.*) \(fuse4x} $line -> fsname mountpoint
     82                ui_warn "     $fsname on $mountpoint"
    9183            }
     84            ui_warn "and then run `sudo kextunload -b $kextid`:"
    9285        }
    9386    }
    9487}