[41854] trunk/base/src/registry1.0

ryandesign at macports.org ryandesign at macports.org
Tue Nov 11 01:23:47 PST 2008


Revision: 41854
          http://trac.macports.org/changeset/41854
Author:   ryandesign at macports.org
Date:     2008-11-11 01:23:45 -0800 (Tue, 11 Nov 2008)
Log Message:
-----------
Registry: Properly handle ports whose version evaluates to 0; see #16740

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

Modified: trunk/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- trunk/base/src/registry1.0/receipt_flat.tcl	2008-11-11 09:15:41 UTC (rev 41853)
+++ trunk/base/src/registry1.0/receipt_flat.tcl	2008-11-11 09:23:45 UTC (rev 41854)
@@ -98,7 +98,7 @@
 ##
 #
 # Open an existing entry and return its reference number.
-proc open_entry {name {version 0} {revision 0} {variants ""}} {
+proc open_entry {name {version ""} {revision 0} {variants ""}} {
 	global macports::registry.installtype
 	global macports::registry.path
 
@@ -110,7 +110,7 @@
 		set receipt_file [get_head_entry_receipt_path $name $version]
 		
 		if {![string length $receipt_file]} {
-			if { $version != 0 } {
+			if { $version != "" } {
 				return -code error "Registry error: ${name} @${version}_${revision}${variants} not registered as installed."
 			} else {
 				return -code error "Registry error: ${name} not registered as installed."
@@ -118,14 +118,14 @@
 		}
 		
 		# Extract the version from the path.
-		if { $version == 0 } {
+		if { $version == "" } {
 			set theFileName [file tail $receipt_file]
 			regexp "^$name-(.*)\$" $theFileName match version
 		}
 	} else {
 		# If version wasn't specified, find out the version number.  This will
 		# depend on which installtype mode we're in, "direct" or "image"	
-		if { $version == 0 } {
+		if { $version == "" } {
 			# xxx: If we're in image mode, we really should have had the 
 			# version given to us.  How should we handle this?
 			set x [glob -nocomplain [file join ${receipt_path} *]]

Modified: trunk/base/src/registry1.0/receipt_sqlite.tcl
===================================================================
--- trunk/base/src/registry1.0/receipt_sqlite.tcl	2008-11-11 09:15:41 UTC (rev 41853)
+++ trunk/base/src/registry1.0/receipt_sqlite.tcl	2008-11-11 09:23:45 UTC (rev 41854)
@@ -49,7 +49,7 @@
 }
 
 # Open an existing entry and place it in the receipt_list
-proc open_entry {name {version 0} {revision 0} {variants ""}} {
+proc open_entry {name {version ""} {revision 0} {variants ""}} {
 	return -1
 }
 

Modified: trunk/base/src/registry1.0/registry.tcl
===================================================================
--- trunk/base/src/registry1.0/registry.tcl	2008-11-11 09:15:41 UTC (rev 41853)
+++ trunk/base/src/registry1.0/registry.tcl	2008-11-11 09:23:45 UTC (rev 41854)
@@ -111,7 +111,7 @@
 }
 
 # Open a registry entry.
-proc open_entry {name {version 0} {revision 0} {variants ""}} {
+proc open_entry {name {version ""} {revision 0} {variants ""}} {
 	global macports::registry.format
 
 	return [${macports::registry.format}::open_entry $name $version $revision $variants]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081111/37e6ebe4/attachment-0001.html>


More information about the macports-changes mailing list