Ticket #5523: portpkg.2.patch

File portpkg.2.patch, 1.8 KB (added by drernie@…, 19 years ago)

updated patch

  • portpkg.

    old new  
    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
     
    6060
    6161proc package_pkg {portname portversion portrevision} {
    6262    global UI_PREFIX portdbpath destpath workpath prefix portresourcepath\
    63      description package.destpath long_description homepage portpath filespath
     63     description package.destpath package.resources long_description homepage portpath filespath
    6464
    6565    set resourcepath ${workpath}/pkg_resources
    6666    # XXX: we need to support .lproj in resources.
     
    8585    }
    8686    write_welcome_html ${pkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
    8787    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   
    8899    system "mkbom ${destpath} ${pkgpath}/Contents/Archive.bom"
    89100    system "cd ${destpath} && pax -x cpio -w -z . > ${pkgpath}/Contents/Archive.pax.gz"
    90101