mystonline-cider: fix extract failure (https://trac.macports.org/ticket/45923)

git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@128291 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
Ryan Schmidt
2014-11-18 16:19:32 +00:00
parent 0fb75e117a
commit 4d62098c4a
2 changed files with 8 additions and 29 deletions
+8 -10
View File
@@ -27,8 +27,6 @@ checksums md5 3b3b5af000b32a4415e6aa7d944083fb \
sha1 253e14987a9375d66f92373b11e2dda43872b2a8 \
rmd160 c156b0edd20a691248269f6e3ab9996fddae74c8
depends_extract bin:expect:expect
depends_run port:mystonline-bootstrap
set libexec_dir ${prefix}/libexec/${name}
@@ -40,8 +38,7 @@ set app_name "Myst Online (Cider)"
set app_package ${applications_dir}/${app_name}.app
post-extract {
copy ${distpath}/${installer_dmg} ${worksrcpath}
set my_dmg_mount [my_attach_disk_image ${worksrcpath}/${installer_dmg}]
set my_dmg_mount [my_attach_disk_image ${distpath}/${installer_dmg}]
copy "${my_dmg_mount}/Myst Online.app" ${worksrcpath}/app
my_detach_disk_image ${my_dmg_mount}
@@ -146,17 +143,18 @@ universal_variant no
# Mounts a disk image.
proc my_attach_disk_image {disk_image} {
global my_name filespath
set mountpoint [mkdtemp "/tmp/${my_name}.XXXXXXXX"]
# Use this expect script instead of using hdiutil directly,
# so that we can agree to the license agreement.
system "expect ${filespath}/attach.exp '${disk_image}' '${mountpoint}'"
global workpath
set tmp_disk_image_dir [mkdtemp "${workpath}/.tmp/disk_image.XXXXXXXX"]
set tmp_disk_image ${tmp_disk_image_dir}/[file tail ${disk_image}].cdr
system "hdiutil convert -quiet -ov -format UDTO -o '${tmp_disk_image}' '${disk_image}'"
set mountpoint [mkdtemp "${workpath}/.tmp/mountpoint.XXXXXXXX"]
system "hdiutil attach -quiet '${tmp_disk_image}' -mountpoint '${mountpoint}' -private -nobrowse -noautoopen -noautofsck -noverify -readonly"
return ${mountpoint}
}
# Unmounts a disk image.
proc my_detach_disk_image {mountpoint} {
system "hdiutil detach ${mountpoint} -force"
system "hdiutil detach '${mountpoint}' -force"
file delete -force ${mountpoint}
}
-19
View File
@@ -1,19 +0,0 @@
#!/usr/bin/env expect --
# $Id$
spawn hdiutil attach "[lindex $argv 0]" -mountpoint "[lindex $argv 1]" -private -nobrowse -noautoopen -noautofsck -noverify -readonly
expect {
"License Agreement" {
exp_send "q"
exp_continue
}
"Agree Y/N?" {
exp_send "y\r"
exp_continue
}
"/dev/" {
interact
}
}