Ticket #12791: macports-mdmg.patch
File macports-mdmg.patch, 4.0 KB (added by afb@…, 17 years ago) |
---|
-
src/port/port.tcl
2163 2163 archive action_target 2164 2164 unarchive action_target 2165 2165 dmg action_target 2166 mdmg action_target 2166 2167 dpkg action_target 2167 2168 mpkg action_target 2168 2169 pkg action_target -
doc/port.1
495 495 .Ss dmg 496 496 Creates an internet-enabled disk image containing an OS X package of 497 497 .Ar portname . 498 .Ss mdmg 499 Creates an internet-enabled disk image containing an OS X metapackage of 500 .Ar portname 501 and its dependencies. 498 502 .Ss rpm 499 503 Creates an RPM binary package of 500 504 .Ar portname , -
src/package1.0/package.tcl
37 37 package require portpkg 1.0 38 38 package require portmpkg 1.0 39 39 package require portdmg 1.0 40 package require portmdmg 1.0 40 41 package require portdpkg 1.0 41 42 package require portunarchive 1.0 42 43 package require portarchive 1.0 -
src/package1.0/portmdmg.tcl
1 1 # et:ts=4 2 # port dmg.tcl2 # portmdmg.tcl 3 3 # $Id$ 4 4 # 5 5 # Copyright (c) 2003 Apple Computer, Inc. … … 30 30 # POSSIBILITY OF SUCH DAMAGE. 31 31 # 32 32 33 package provide port dmg 1.033 package provide portmdmg 1.0 34 34 package require portutil 1.0 35 35 36 set org.macports. dmg [target_new org.macports.dmgdmg_main]37 target_runtype ${org.macports. dmg} always38 target_provides ${org.macports. dmg}dmg39 target_requires ${org.macports. dmg}pkg36 set org.macports.mdmg [target_new org.macports.mdmg mdmg_main] 37 target_runtype ${org.macports.mdmg} always 38 target_provides ${org.macports.mdmg} mdmg 39 target_requires ${org.macports.mdmg} mpkg 40 40 41 41 set_ui_prefix 42 42 43 proc dmg_main {args} {43 proc mdmg_main {args} { 44 44 global portname portversion portrevision package.destpath UI_PREFIX 45 45 46 46 ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${portname} ${portversion}]" 47 47 48 return [package_ dmg $portname $portversion $portrevision]48 return [package_mdmg $portname $portversion $portrevision] 49 49 } 50 50 51 proc package_ dmg {portname portversion portrevision} {51 proc package_mdmg {portname portversion portrevision} { 52 52 global UI_PREFIX package.destpath portpath 53 53 54 54 if {[expr (${portrevision} > 0)]} { … … 59 59 60 60 set tmp_image ${package.destpath}/${imagename}.tmp.dmg 61 61 set final_image ${package.destpath}/${imagename}.dmg 62 set pkgpath ${package.destpath}/${portname}-${portversion}.pkg62 set mpkgpath ${package.destpath}/${portname}-${portversion}.mpkg 63 63 64 64 if {[file readable $final_image] && ([file mtime ${final_image}] >= [file mtime ${portpath}/Portfile])} { 65 65 ui_msg "$UI_PREFIX [format [msgcat::mc "Disk Image for %s-%s is up-to-date"] ${portname} ${portversion}]" … … 67 67 } 68 68 69 69 # size for .dmg 70 set size [dirSize ${ pkgpath}]70 set size [dirSize ${mpkgpath}] 71 71 if {[expr ($size < 4194304)]} { 72 72 # there is a minimum of 8292 512 blocks in a dmg 73 73 set blocks 8292 … … 84 84 } 85 85 set mount_point [exec mount | grep "${devicename}"] 86 86 regexp {(\/Volumes/[A-Za-z0-9\-\_\s].+)\s\(} $mount_point code mount_point 87 system "ditto -rsrcFork ${ pkgpath} '${mount_point}/${portname}-${portversion}.pkg'"87 system "ditto -rsrcFork ${mpkgpath} '${mount_point}/${portname}-${portversion}.mpkg'" 88 88 system "hdiutil detach ${devicename} -quiet" 89 89 if {[system "hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} { 90 90 return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]