[60343] branches/release_1_8

jmr at macports.org jmr at macports.org
Mon Nov 9 06:12:58 PST 2009


Revision: 60343
          http://trac.macports.org/changeset/60343
Author:   jmr at macports.org
Date:     2009-11-09 06:12:58 -0800 (Mon, 09 Nov 2009)
Log Message:
-----------
merge r60260 and r60259 from trunk:
 * use hdiutil's -srcfolder option in portdmg, as was done in portmdmg in r34844, instead of doing it the hard way (#22404)
 * clean up unused code in portmdmg

Revision Links:
--------------
    http://trac.macports.org/changeset/60260
    http://trac.macports.org/changeset/60259
    http://trac.macports.org/changeset/34844

Modified Paths:
--------------
    branches/release_1_8/base/src/package1.0/portdmg.tcl
    branches/release_1_8/base/src/package1.0/portmdmg.tcl

Property Changed:
----------------
    branches/release_1_8/
    branches/release_1_8/base/


Property changes on: branches/release_1_8
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:55268,55279,55281,55285,55317,55385,55417,55591,55594,55679,55767,55793,56147,56160,56162,56435,56448,57026,57255,57436,57441,57784,57801,57871,57974,58445,59585
   + /trunk:55268,55279,55281,55285,55317,55385,55417,55591,55594,55679,55767,55793,56147,56160,56162,56435,56448,57026,57255,57436,57441,57784,57801,57871,57974,58445,59585,60259-60260


Property changes on: branches/release_1_8/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:55268,55279,55281,55285,55317,55385,55417,55591,55594,55679,55767,55793,55825,56147,56160,56162,56435,56448,56472-56474,56666,56889,57026,57048,57055,57131,57255,57436,57441,57784,57801,57820,57871,57974,57979,57982,58093,58445,59585
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:55268,55279,55281,55285,55317,55385,55417,55591,55594,55679,55767,55793,55825,56147,56160,56162,56435,56448,56472-56474,56666,56889,57026,57048,57055,57131,57255,57436,57441,57784,57801,57820,57871,57974,57979,57982,58093,58445,59585,60259-60260
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/release_1_8/base/src/package1.0/portdmg.tcl
===================================================================
--- branches/release_1_8/base/src/package1.0/portdmg.tcl	2009-11-09 14:08:08 UTC (rev 60342)
+++ branches/release_1_8/base/src/package1.0/portdmg.tcl	2009-11-09 14:12:58 UTC (rev 60343)
@@ -69,17 +69,7 @@
         ui_msg "$UI_PREFIX [format [msgcat::mc "Disk Image for %s-%s is up-to-date"] ${portname} ${portversion}]"
 	return 0
     }
-    
-    # size for .dmg
-    set size [dirSize ${pkgpath}]
-    if {[expr ($size < 4194304)]} {
-	# there is a minimum of 8292 512 blocks in a dmg
-        set blocks 8292
-    } else {
-	# this should later be replaced with hdiutil create -srcfolder
-        set blocks [expr ($size/512) + ((($size/512)*3)/100)]
-    }
-    
+
     # partition for .dmg
     if {${os.major} >= 9 && ${os.arch} == "i386"} {
 	# GUID_partition_scheme
@@ -90,18 +80,9 @@
     }
     
     set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
-    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
+    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${pkgpath} ${tmp_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
     }
-    if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
-        return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
-    }
-    set attach_output [split $attach_output "\t"]
-    set devicename [string trim [lindex $attach_output 0]]
-    set mount_point [string trim [lindex $attach_output 2]]
-    regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
-    system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${pkgpath} '${mount_point}/${portname}-${portversion}.pkg'"
-    system "$hdiutil detach ${devicename} -quiet"
     if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
         return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
     }

Modified: branches/release_1_8/base/src/package1.0/portmdmg.tcl
===================================================================
--- branches/release_1_8/base/src/package1.0/portmdmg.tcl	2009-11-09 14:08:08 UTC (rev 60342)
+++ branches/release_1_8/base/src/package1.0/portmdmg.tcl	2009-11-09 14:12:58 UTC (rev 60343)
@@ -69,17 +69,7 @@
         ui_msg "$UI_PREFIX [format [msgcat::mc "Disk Image for %s-%s is up-to-date"] ${portname} ${portversion}]"
 	return 0
     }
-    
-    # size for .dmg
-    set size [dirSize ${mpkgpath}]
-    if {[expr ($size < 4194304)]} {
-	# there is a minimum of 8292 512 blocks in a dmg
-        set blocks 8292
-    } else {
-	# this is now replaced with hdiutil create -srcfolder
-        set blocks [expr ($size/512) + ((($size/512)*3)/100)]
-    }
-    
+
     # partition for .dmg
     if {${os.major} >= 9 && ${os.arch} == "i386"} {
 	# GUID_partition_scheme
@@ -89,25 +79,10 @@
         set subdev 2
     }
 
-  set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
-  if {false} {
-    if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -size ${blocks}b ${tmp_image}"] != ""} {
-        return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
-    }
-    if {[catch {set attach_output [exec $hdiutil attach -puppetstrings ${tmp_image} | grep s${subdev}]} error]} {
-        return -code error [format [msgcat::mc "Failed to attach temporary image: %s"] ${error}]
-    }
-    set attach_output [split $attach_output "\t"]
-    set devicename [string trim [lindex $attach_output 0]]
-    set mount_point [string trim [lindex $attach_output 2]]
-    regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point
-    system "[findBinary ditto $portutil::autoconf::ditto_path] -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'"
-    system "$hdiutil detach ${devicename} -quiet"
-  } else {
+    set hdiutil [findBinary hdiutil $portutil::autoconf::hdiutil_path]
     if {[system "$hdiutil create -quiet -fs HFS+ -volname ${imagename} -srcfolder ${mpkgpath} ${tmp_image}"] != ""} {
         return -code error [format [msgcat::mc "Failed to create temporary image: %s"] ${imagename}]
     }
-  }
     if {[system "$hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
         return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091109/18f11c07/attachment.html>


More information about the macports-changes mailing list