Ticket #13509: use_dmg.diff
File use_dmg.diff, 2.8 KB (added by ryandesign (Ryan Carsten Schmidt), 17 years ago) |
---|
-
src/port1.0/portfetch.tcl
41 41 target_prerun ${org.macports.fetch} fetch_start 42 42 43 43 # define options: distname master_sites 44 options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 dist_subdir \44 options master_sites patch_sites extract.suffix distfiles patchfiles use_zip use_bzip2 use_dmg dist_subdir \ 45 45 fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \ 46 46 master_sites.mirror_subdir patch_sites.mirror_subdir portname \ 47 47 cvs.module cvs.root cvs.password cvs.date cvs.tag \ … … 94 94 # Option-executed procedures 95 95 option_proc use_bzip2 fix_extract_suffix 96 96 option_proc use_zip fix_extract_suffix 97 option_proc use_dmg fix_extract_suffix 97 98 98 99 proc fix_extract_suffix {option action args} { 99 100 global extract.suffix … … 105 106 use_zip { 106 107 set extract.suffix .zip 107 108 } 109 use_dmg { 110 set extract.suffix .dmg 111 } 108 112 } 109 113 } 110 114 } … … 115 119 116 120 set_ui_prefix 117 121 118 # Given a distname, return a suffix based on the use_zip / use_bzip2 / extract.suffix options122 # Given a distname, return a suffix based on the use_zip / use_bzip2 / use_dmg / extract.suffix options 119 123 proc suffix {distname} { 120 124 global extract.suffix fetch.type 121 125 switch -- "${fetch.type}" { -
src/port1.0/portextract.tcl
58 58 set_ui_prefix 59 59 60 60 proc extract_init {args} { 61 global extract.only extract.dir extract.cmd extract.pre_args extract.post_args extract.mkdir distfiles use_bzip2 use_zip workpath61 global extract.only extract.dir extract.cmd extract.pre_args extract.post_args extract.mkdir distfiles use_bzip2 use_zip use_dmg workpath 62 62 63 63 # should the distfiles be extracted to worksrcpath instead? 64 64 if {[tbool extract.mkdir]} { … … 74 74 option extract.cmd [binaryInPath "unzip"] 75 75 option extract.pre_args -q 76 76 option extract.post_args "-d [option extract.dir]" 77 } elseif {[tbool use_dmg]} { 78 global worksrcdir 79 set dmg_tmp_dir [exec mktemp -d -q "/tmp/mports.XXXXXXXX"] 80 set dmg_mount ${dmg_tmp_dir}/${worksrcdir} 81 file mkdir ${dmg_mount} 82 option extract.cmd [binaryInPath "hdiutil"] 83 option extract.pre_args attach 84 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}" 77 85 } 78 86 } 79 87