[51705] branches/images-and-archives/base/src

blb at macports.org blb at macports.org
Sun May 31 23:04:38 PDT 2009


Revision: 51705
          http://trac.macports.org/changeset/51705
Author:   blb at macports.org
Date:     2009-05-31 23:04:37 -0700 (Sun, 31 May 2009)
Log Message:
-----------
Centralize naming of imagefile within macports.tcl

Modified Paths:
--------------
    branches/images-and-archives/base/src/macports1.0/macports.tcl
    branches/images-and-archives/base/src/port1.0/portimagefile.tcl
    branches/images-and-archives/base/src/registry1.0/portuninstall.tcl
    branches/images-and-archives/base/src/registry1.0/registry.tcl

Modified: branches/images-and-archives/base/src/macports1.0/macports.tcl
===================================================================
--- branches/images-and-archives/base/src/macports1.0/macports.tcl	2009-06-01 05:53:44 UTC (rev 51704)
+++ branches/images-and-archives/base/src/macports1.0/macports.tcl	2009-06-01 06:04:37 UTC (rev 51705)
@@ -776,6 +776,7 @@
     # Export some utility functions defined here.
     $workername alias macports_create_thread macports::create_thread
     $workername alias getportworkpath_from_buildpath macports::getportworkpath_from_buildpath
+    $workername alias getportimagename_from_port_info macports::getportimagename_from_port_info
     $workername alias getportresourcepath macports::getportresourcepath
     $workername alias getdefaultportresourcepath macports::getdefaultportresourcepath
     $workername alias getprotocol macports::getprotocol
@@ -1457,6 +1458,11 @@
     return [macports::getportworkpath_from_buildpath [macports::getportbuildpath $portpath]]
 }
 
+proc macports::getportimagename_from_port_info {portname portepoch portversion portrevision portvariants} {
+    global macports::os_platform macports::os_arch
+    return "${portname}-${portepoch}-${portversion}_${portrevision}${portvariants}.${os_platform}.${os_arch}.macport"
+}
+
 proc macports::getindex {source} {
     # Special case file:// sources
     if {[macports::getprotocol $source] == "file"} {

Modified: branches/images-and-archives/base/src/port1.0/portimagefile.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portimagefile.tcl	2009-06-01 05:53:44 UTC (rev 51704)
+++ branches/images-and-archives/base/src/port1.0/portimagefile.tcl	2009-06-01 06:04:37 UTC (rev 51705)
@@ -52,7 +52,7 @@
 
 proc portimagefile::imagefile_main {args} {
     global name version revision portvariants epoch destpath
-    global workpath portpath os.platform os.arch
+    global workpath portpath
     set startpwd [pwd]
     if {[catch {_cd $destpath} err]} {
         ui_error $err
@@ -77,7 +77,7 @@
     file copy [file join $portpath Portfile] [file join $imageworkpath "+PORTFILE"]
     create_image_receipt $imageworkpath
     _cd $imageworkpath
-    set macport_filename "${name}-${epoch}-${version}_${revision}${portvariants}.${os.platform}.${os.arch}.macport"
+    set macport_filename [getportimagename_from_port_info $name $epoch $version $revision $portvariants]
     set macport_file [file join $workpath $macport_filename]
     ui_debug "Creating $macport_filename"
     if {[catch {system "$tarcmd -cvf $macport_file *"} err]} {

Modified: branches/images-and-archives/base/src/registry1.0/portuninstall.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/portuninstall.tcl	2009-06-01 05:53:44 UTC (rev 51704)
+++ branches/images-and-archives/base/src/registry1.0/portuninstall.tcl	2009-06-01 06:04:37 UTC (rev 51705)
@@ -41,7 +41,7 @@
 
 proc uninstall {portname {v ""} optionslist} {
 	global uninstall.force uninstall.nochecksum UI_PREFIX
-	global macports::portimagefilepath macports::os_platform macports::os_arch
+	global macports::portimagefilepath
 	array set options $optionslist
 
 	set ilist [registry::installed $portname $v]
@@ -152,7 +152,7 @@
 		registry::unregister_dependencies $portname
 	}
 
-	set macport_filename "${portname}-${epoch}-${version}_${revision}${variants}.${macports::os_platform}.${macports::os_arch}.macport"
+	set macport_filename [macports::getportimagename_from_port_info $portname $epoch $version $revision $variants]
 	set portimagedir [file join ${macports::portimagefilepath} $portname]
 	set macport_file [file join $portimagedir $macport_filename]
 	file delete $macport_file

Modified: branches/images-and-archives/base/src/registry1.0/registry.tcl
===================================================================
--- branches/images-and-archives/base/src/registry1.0/registry.tcl	2009-06-01 05:53:44 UTC (rev 51704)
+++ branches/images-and-archives/base/src/registry1.0/registry.tcl	2009-06-01 06:04:37 UTC (rev 51705)
@@ -414,7 +414,7 @@
 # Activate a "Port Image"	
 proc activate {name v optionslist} {
 	global macports::prefix macports::registry.path UI_PREFIX env
-	global macports::portimagefilepath macports::os_platform macports::os_arch
+	global macports::portimagefilepath
 	array set options $optionslist
 	variable force
 
@@ -431,7 +431,7 @@
 	set revision [lindex $ilist 2]
 	set	variants [lindex $ilist 3]
 	set	epoch [lindex $ilist 5]
-	set macport_filename "${name}-${epoch}-${version}_${revision}${variants}.${macports::os_platform}.${macports::os_arch}.macport"
+    set macport_filename [macports::getportimagename_from_port_info $name $epoch $version $revision $variants]
 	set macport_file [file join ${macports::portimagefilepath} $name $macport_filename]
 	if {![file exists $macport_file]} {
 		return -code error "Image error: Can't find image file $macport_file"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090531/b43e1a9a/attachment.html>


More information about the macports-changes mailing list