[60259] trunk/base/src/package1.0/portmdmg.tcl

jmr at macports.org jmr at macports.org
Sat Nov 7 07:18:55 PST 2009


Revision: 60259
          http://trac.macports.org/changeset/60259
Author:   jmr at macports.org
Date:     2009-11-07 07:18:53 -0800 (Sat, 07 Nov 2009)
Log Message:
-----------
clean up unused code in portmdmg

Modified Paths:
--------------
    trunk/base/src/package1.0/portmdmg.tcl

Modified: trunk/base/src/package1.0/portmdmg.tcl
===================================================================
--- trunk/base/src/package1.0/portmdmg.tcl	2009-11-07 15:11:38 UTC (rev 60258)
+++ trunk/base/src/package1.0/portmdmg.tcl	2009-11-07 15:18:53 UTC (rev 60259)
@@ -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/20091107/9557622f/attachment.html>


More information about the macports-changes mailing list