[36708] trunk/base/src/port1.0

Rainer Müller raimue at macports.org
Tue May 13 07:02:40 PDT 2008


ryandesign at macports.org wrote:
> Revision: 36708
>           http://trac.macosforge.org/projects/macports/changeset/36708
> Author:   ryandesign at macports.org
> Date:     2008-05-12 20:27:25 -0700 (Mon, 12 May 2008)
> 
> Log Message:
> -----------
> Allow distfiles to be disk images with new "use_dmg yes" port option; #13509.

Nice new feature!

> Modified: trunk/base/src/port1.0/portextract.tcl
> ===================================================================
> --- trunk/base/src/port1.0/portextract.tcl	2008-05-13 03:11:06 UTC (rev 36707)
> +++ trunk/base/src/port1.0/portextract.tcl	2008-05-13 03:27:25 UTC (rev 36708)
[...]
> @@ -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"]

We have a mktemp procedure in pextlib, so you could just call that 
instead: [mktemp "/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}"
>      }
>  }


More information about the macports-dev mailing list