[88511] trunk/base/src/macports1.0/macports.tcl

cal at macports.org cal at macports.org
Tue Jan 3 14:12:43 PST 2012


Revision: 88511
          http://trac.macports.org/changeset/88511
Author:   cal at macports.org
Date:     2012-01-03 14:12:22 -0800 (Tue, 03 Jan 2012)
Log Message:
-----------
rev-upgrade: Handle missing and non-accessible files gracefully rather than aborting

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2012-01-03 21:44:47 UTC (rev 88510)
+++ trunk/base/src/macports1.0/macports.tcl	2012-01-03 22:12:22 UTC (rev 88511)
@@ -3860,7 +3860,15 @@
                     }
                     ui_debug "Updating binary flag for file $i of [llength $files]: [$f path]"
                     incr i
-                    $f binary [fileIsBinary [$f path]]
+
+                    if {0 != [catch {$f binary [fileIsBinary [$f path]]} fileIsBinaryError]} {
+                        # handle errors (e.g. file not found, permission denied) gracefully
+                        if {![macports::ui_isset ports_debug]} {
+                            ui_msg ""
+                        }
+                        ui_warn "Error determining file type of `[$f path]': $fileIsBinaryError"
+                        ui_warn "Your registry for the `[[registry::entry owner [$f path]] name]' port is probably corrupt. Consider reinstalling it."
+                    }
                 }
             } catch {*} {
                 ui_error "Updating database of binaries failed"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120103/16d37d4d/attachment.html>


More information about the macports-changes mailing list