Ticket #5525: portpkg.tcl.diff

File portpkg.tcl.diff, 2.1 KB (added by jmpalacios (Juan Manuel Palacios), 18 years ago)
  • portpkg.tcl

    old new  
    11# et:ts=4
    22# portpkg.tcl
    3 # $Id: portpkg.tcl,v 1.5 2005/08/27 00:07:27 pguyot Exp $
     3# $Id: portpkg.tcl,v 1.2.6.2 2005/09/05 01:12:16 pguyot Exp $
    44#
    55# Copyright (c) 2002 - 2003 Apple Computer, Inc.
    66# All rights reserved.
     
    4343}
    4444
    4545# define options
    46 options package.type package.destpath
     46options package.type package.destpath package.resources
    4747
    4848# Set defaults
    4949default package.destpath {${workpath}}
     
    5151set_ui_prefix
    5252
    5353proc pkg_main {args} {
    54     global portname portversion portrevision package.type package.destpath UI_PREFIX
     54    global portname portversion portrevision package.type package.destpath package.resources UI_PREFIX
    5555
    5656    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s"] ${portname} ${portversion}]"
    5757
     
    5959}
    6060
    6161proc package_pkg {portname portversion portrevision} {
    62     global UI_PREFIX portdbpath destpath workpath prefix portresourcepath description package.destpath long_description homepage portpath
     62    global UI_PREFIX portdbpath destpath workpath prefix portresourcepath\
     63     description package.destpath package.resources long_description homepage portpath filespath
    6364
    6465    set resourcepath ${workpath}/pkg_resources
    6566    # XXX: we need to support .lproj in resources.
     
    8485    }
    8586    write_welcome_html ${pkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
    8687    file copy -force -- ${portresourcepath}/package/background.tiff ${pkgpath}/Contents/Resources/background.tiff
     88
     89        if {[info exists package.resources]} {
     90        foreach file ${package.resources} {
     91                if {![file exists ${file}]} {
     92              ui_msg "$UI_PREFIX ${file} from package.resources not found."
     93            } else {
     94              file copy -force -- ${file} ${pkgpath}/Contents/Resources/
     95                }
     96        }
     97        }
     98   
    8799    system "mkbom ${destpath} ${pkgpath}/Contents/Archive.bom"
    88100    system "cd ${destpath} && pax -x cpio -w -z . > ${pkgpath}/Contents/Archive.pax.gz"
    89101