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
66 66 xinstall -o root -m 4755 ${worksrcpath}/build/${xcode.configuration}/load_fuse4x ${destroot}${kextdir}/fuse4x.kext/Support 67 67 } 68 68 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. 73 70 # 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 76 72 # running filesystems; print a list. 77 p ost-activate {73 pre-deactivate { 78 74 set kextid "org.fuse4x.kext.fuse4x" 79 75 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}]} { 84 77 set mounted [exec /sbin/mount -t fuse4x] 85 78 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:" 88 80 foreach line [split $mounted "\n"] { 89 regexp { on (/.*) \(fuse4x} $line ->mountpoint90 ui_warn " -$mountpoint"81 regexp {(.*)@fuse\d+ on (/.*) \(fuse4x} $line -> fsname mountpoint 82 ui_warn " $fsname on $mountpoint" 91 83 } 84 ui_warn "and then run `sudo kextunload -b $kextid`:" 92 85 } 93 86 } 94 87 }