Changeset 1530 for trunk/base


Ignore:
Timestamp:
Jan 3, 2003, 9:15:39 AM (17 years ago)
Author:
jkh
Message:

Conditionalize the package.type handling properly. Now if I could just
figure out how to set package.destdir externally.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portpackage.tcl

    r1527 r1530  
    4242
    4343# Set defaults
    44 default package.type tarball
     44default package.type pkg
    4545default package.destpath {${workpath}}
    4646
     
    4848
    4949proc package_main {args} {
    50     global portname portversion package.type UI_PREFIX
     50    global portname portversion package.type package.destpath UI_PREFIX
    5151
    5252    set rfile [registry_exists $portname $portversion]
     
    5555        return -code error "Package ${portname}-${portversion} not installed on this system"
    5656    }
    57     ui_msg "$UI_PREFIX Creating ${package.type} package for ${portname}-${portversion}"
     57    ui_msg "$UI_PREFIX Creating ${package.type} format package for ${portname}-${portversion}"
    5858    if [regexp .bz2$ $rfile] {
    5959        set fd [open "|bunzip2 -c $rfile" r]
     
    6464    close $fd
    6565
    66     # For now the only package type we support is "tarball" but move that
    67     # into another routine anyway so that this is abstract enough.
    68 
    69     return [package_pkg $portname $portversion $entry]
     66    # Make sure the destination path exists.
     67    system "mkdir -p ${package.destpath}"
     68
     69    # For now we only support pkg and tarball package types.
     70    switch -exact -- ${package.type} {
     71        pkg {
     72            return [package_pkg $portname $portversion $entry]
     73        }
     74        tarball {
     75            return [package_tarball $portname $portversion $entry]
     76        }
     77        default {
     78            ui_error "Do not know how to generate package of type ${package.type}"
     79            return -code error "Unknown package type: ${package.type}"
     80        }
     81    }
    7082}
    7183
Note: See TracChangeset for help on using the changeset viewer.