Ticket #12791: macports-mdmg.patch

File macports-mdmg.patch, 4.0 KB (added by afb@…, 17 years ago)

macports-mdmg.patch

  • src/port/port.tcl

     
    21632163    archive     action_target
    21642164    unarchive   action_target
    21652165    dmg         action_target
     2166    mdmg        action_target
    21662167    dpkg        action_target
    21672168    mpkg        action_target
    21682169    pkg         action_target
  • doc/port.1

     
    495495.Ss dmg
    496496Creates an internet-enabled disk image containing an OS X package of
    497497.Ar portname .
     498.Ss mdmg
     499Creates an internet-enabled disk image containing an OS X metapackage of
     500.Ar portname
     501and its dependencies.
    498502.Ss rpm
    499503Creates an RPM binary package of
    500504.Ar portname ,
  • src/package1.0/package.tcl

     
    3737package require portpkg 1.0
    3838package require portmpkg 1.0
    3939package require portdmg 1.0
     40package require portmdmg 1.0
    4041package require portdpkg 1.0
    4142package require portunarchive 1.0
    4243package require portarchive 1.0
  • src/package1.0/portmdmg.tcl

     
    11# et:ts=4
    2 # portdmg.tcl
     2# portmdmg.tcl
    33# $Id$
    44#
    55# Copyright (c) 2003 Apple Computer, Inc.
     
    3030# POSSIBILITY OF SUCH DAMAGE.
    3131#
    3232
    33 package provide portdmg 1.0
     33package provide portmdmg 1.0
    3434package require portutil 1.0
    3535
    36 set org.macports.dmg [target_new org.macports.dmg dmg_main]
    37 target_runtype ${org.macports.dmg} always
    38 target_provides ${org.macports.dmg} dmg
    39 target_requires ${org.macports.dmg} pkg
     36set org.macports.mdmg [target_new org.macports.mdmg mdmg_main]
     37target_runtype ${org.macports.mdmg} always
     38target_provides ${org.macports.mdmg} mdmg
     39target_requires ${org.macports.mdmg} mpkg
    4040
    4141set_ui_prefix
    4242
    43 proc dmg_main {args} {
     43proc mdmg_main {args} {
    4444    global portname portversion portrevision package.destpath UI_PREFIX
    4545   
    4646    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating disk image for %s-%s"] ${portname} ${portversion}]"
    4747   
    48     return [package_dmg $portname $portversion $portrevision]
     48    return [package_mdmg $portname $portversion $portrevision]
    4949}
    5050
    51 proc package_dmg {portname portversion portrevision} {
     51proc package_mdmg {portname portversion portrevision} {
    5252    global UI_PREFIX package.destpath portpath
    5353   
    5454    if {[expr (${portrevision} > 0)]} {
     
    5959   
    6060    set tmp_image ${package.destpath}/${imagename}.tmp.dmg
    6161    set final_image ${package.destpath}/${imagename}.dmg
    62     set pkgpath ${package.destpath}/${portname}-${portversion}.pkg
     62    set mpkgpath ${package.destpath}/${portname}-${portversion}.mpkg
    6363   
    6464    if {[file readable $final_image] && ([file mtime ${final_image}] >= [file mtime ${portpath}/Portfile])} {
    6565        ui_msg "$UI_PREFIX [format [msgcat::mc "Disk Image for %s-%s is up-to-date"] ${portname} ${portversion}]"
     
    6767    }
    6868   
    6969    # size for .dmg
    70     set size [dirSize ${pkgpath}]
     70    set size [dirSize ${mpkgpath}]
    7171    if {[expr ($size < 4194304)]} {
    7272        # there is a minimum of 8292 512 blocks in a dmg
    7373        set blocks 8292
     
    8484    }
    8585    set mount_point [exec mount | grep "${devicename}"]
    8686    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'"
    8888    system "hdiutil detach ${devicename} -quiet"
    8989    if {[system "hdiutil convert ${tmp_image} -format UDCO -o ${final_image} -quiet"] != ""} {
    9090        return -code error [format [msgcat::mc "Failed to convert to final image: %s"] ${final_image}]