[44612] trunk/base/src/registry1.0/receipt_flat.tcl

jmr at macports.org jmr at macports.org
Wed Dec 31 00:04:47 PST 2008


Revision: 44612
          http://trac.macports.org/changeset/44612
Author:   jmr at macports.org
Date:     2008-12-31 00:04:46 -0800 (Wed, 31 Dec 2008)
Log Message:
-----------
receipt_flat: print a more informative error message when a receipt is malformed (see #12596)

Modified Paths:
--------------
    trunk/base/src/registry1.0/receipt_flat.tcl

Modified: trunk/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- trunk/base/src/registry1.0/receipt_flat.tcl	2008-12-31 08:03:12 UTC (rev 44611)
+++ trunk/base/src/registry1.0/receipt_flat.tcl	2008-12-31 08:04:46 UTC (rev 44612)
@@ -181,7 +181,11 @@
 
 		# Remove any line starting with #
 		while {[regexp "(^|\n)#.*\n(.*)\$" $receipt_contents match foo receipt_contents]} {}
-		array set receipt_$ref $receipt_contents
+		if {[catch {array set receipt_$ref $receipt_contents} rcpterr]} {
+			ui_error "Malformed receipt for ${name} @${version}_${revision}${variants}"
+			ui_error "receipt_contents = '$receipt_contents'"
+			error $rcpterr
+		}
 	} else {
 		# This is old Images format
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081231/4d79d204/attachment.html>


More information about the macports-changes mailing list