[86463] trunk/dports/fuse/fuse4x-kext/Portfile

dports at macports.org dports at macports.org
Wed Oct 26 02:49:06 PDT 2011


Revision: 86463
          http://trac.macports.org/changeset/86463
Author:   dports at macports.org
Date:     2011-10-26 02:49:03 -0700 (Wed, 26 Oct 2011)
Log Message:
-----------
fuse4x-kext: attempt to unload a previously-installed kext in both
post-deactivate and post-activate (#31280)

Modified Paths:
--------------
    trunk/dports/fuse/fuse4x-kext/Portfile

Modified: trunk/dports/fuse/fuse4x-kext/Portfile
===================================================================
--- trunk/dports/fuse/fuse4x-kext/Portfile	2011-10-26 09:29:01 UTC (rev 86462)
+++ trunk/dports/fuse/fuse4x-kext/Portfile	2011-10-26 09:49:03 UTC (rev 86463)
@@ -74,25 +74,38 @@
 # Thus, check whether the kext is already loaded, and if so attempt to
 # unload it. If that fails, the user probably needs to unmount some
 # running filesystems; print a list.
-post-activate {
+#
+# We do this both after deactivating an existing version (because the
+# user might be removing the port) and after activating a new version
+# (because the user might be upgrading from an installation that
+# didn't unload the kext).
+proc try_unload_kext {} {
     set kextid "org.fuse4x.kext.fuse4x"
     if {[string length [exec /usr/sbin/kextstat -lb $kextid]] > 0} {
-        ui_msg "Another version of Fuse4X is already loaded. Attempting to unload it."
+        ui_msg "The Fuse4X kernel extension is already loaded. Attempting to unload it."
         if {![catch {exec /sbin/kextunload -b $kextid}]} {
             ui_msg "Successfully unloaded the previous installation of Fuse4X"
         } else {
             set mounted [exec /sbin/mount -t fuse4x]
             ui_warn "Unable to unload the existing Fuse4X kernel extension."
-            ui_warn "To complete the upgrade. please unmount the following filesystems "
-            ui_warn "and then run `sudo kextunload -b $kextid`:"
+            ui_warn "Please unmount the following filesystems, and then run "
+            ui_warn "`sudo kextunload -b $kextid`:"
             foreach line [split $mounted "\n"] {
                 regexp {on (/.*) \(fuse4x} $line -> mountpoint
-                ui_warn "  - $mountpoint"
+                ui_warn "  * $mountpoint"
             }
         }
     }
 }
 
+post-activate {
+    try_unload_kext
+}
+
+post-deactivate {
+    try_unload_kext
+}
+
 livecheck.type      regex
 livecheck.url       ${homepage}
 livecheck.regex     {Fuse4X-([0-9.]+).dmg}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111026/7e351e31/attachment-0001.html>


More information about the macports-changes mailing list