Index: src/port1.0/portfetch.tcl
===================================================================
--- src/port1.0/portfetch.tcl	(revision 31757)
+++ src/port1.0/portfetch.tcl	(working copy)
@@ -41,7 +41,7 @@
 target_prerun ${org.macports.fetch} fetch_start
 
 # define options: distname master_sites
-options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 dist_subdir \
+options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 use_dmg dist_subdir \
 	fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
 	master_sites.mirror_subdir patch_sites.mirror_subdir portname \
 	cvs.module cvs.root cvs.password cvs.date cvs.tag \
@@ -94,6 +94,7 @@
 # Option-executed procedures
 option_proc use_bzip2 fix_extract_suffix
 option_proc use_zip fix_extract_suffix
+option_proc use_dmg fix_extract_suffix
 
 proc fix_extract_suffix {option action args} {
     global extract.suffix
@@ -105,6 +106,9 @@
             use_zip {
                 set extract.suffix .zip
             }
+            use_dmg {
+                set extract.suffix .dmg
+            }
         }
     }
 }
@@ -115,7 +119,7 @@
 
 set_ui_prefix
 
-# Given a distname, return a suffix based on the use_zip / use_bzip2 / extract.suffix options
+# Given a distname, return a suffix based on the use_zip / use_bzip2 / use_dmg / extract.suffix options
 proc suffix {distname} {
     global extract.suffix fetch.type
     switch -- "${fetch.type}" {
Index: src/port1.0/portextract.tcl
===================================================================
--- src/port1.0/portextract.tcl	(revision 31757)
+++ src/port1.0/portextract.tcl	(working copy)
@@ -58,7 +58,7 @@
 set_ui_prefix
 
 proc extract_init {args} {
-    global extract.only extract.dir extract.cmd extract.pre_args extract.post_args extract.mkdir distfiles use_bzip2 use_zip workpath
+    global extract.only extract.dir extract.cmd extract.pre_args extract.post_args extract.mkdir distfiles use_bzip2 use_zip use_dmg workpath
 
     # should the distfiles be extracted to worksrcpath instead?
     if {[tbool extract.mkdir]} {
@@ -74,6 +74,14 @@
 	option extract.cmd [binaryInPath "unzip"]
 	option extract.pre_args -q
 	option extract.post_args "-d [option extract.dir]"
+    } elseif {[tbool use_dmg]} {
+        global worksrcdir
+        set dmg_tmp_dir [exec mktemp -d -q "/tmp/mports.XXXXXXXX"]
+        set dmg_mount ${dmg_tmp_dir}/${worksrcdir}
+        file mkdir ${dmg_mount}
+        option extract.cmd [binaryInPath "hdiutil"]
+        option extract.pre_args attach
+        option extract.post_args "-private -readonly -nobrowse -mountpoint ${dmg_mount} && [binaryInPath "cp"] -Rp ${dmg_mount} ${extract.dir} && ${extract.cmd} detach ${dmg_mount} && [binaryInPath "rmdir"] ${dmg_mount} ${dmg_tmp_dir}"
     }
 }
 

