Ignore:
Timestamp:
Dec 9, 2002, 4:08:43 AM (16 years ago)
Author:
landonf
Message:

Start of portexec that provides for sharing work in one workpath

File:
1 edited

Legend:

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

    r1356 r1362  
    609609# open file to store name of completed targets
    610610proc open_statefile {args} {
    611     global portpath workdir
    612    
    613     if ![file isdirectory $portpath/$workdir] {
    614         file mkdir $portpath/$workdir
     611    global workpath portname
     612   
     613    if ![file isdirectory $workpath ] {
     614        file mkdir $workpath
    615615    }
    616616    # flock Portfile
    617     set statefile [file join $portpath $workdir .darwinports.state]
     617    set statefile [file join $workpath .darwinports.${portname}.state]
    618618    if {[file exists $statefile] && ![file writable $statefile]} {
    619619        return -code error "$statefile is not writable - check permission on port directory"
     
    10701070}
    10711071
    1072 # jkh uses this API so i guess it's public =)
     1072# portfile primitive that calls portexec_int with newworkpath == ${workpath}
     1073proc portexec {portname target} {
     1074        global workpath
     1075        portexec_int $portname $target $workpath
     1076}
     1077
    10731078# builds the specified port (looked up in the index) to the specified target
    10741079# doesn't yet support options or variants...
    1075 proc portexec {portname target} {
     1080# newworkpath defines the port's workpath - useful for when one port relies
     1081# on the source, etc, of another
     1082proc portexec_int {portname target {newworkpath ""}} {
    10761083    ui_debug "Executing $target ($portname)"
    1077     array set options [list]
    10781084    array set variations [list]
     1085    if {$newworkpath == ""} {
     1086        array set options [list]
     1087    } else {
     1088        set options(workpath) ${newworkpath}
     1089    }
     1090       
    10791091    set res [dportsearch ^$portname\$]
    10801092    if {[llength $res] < 2} {
     
    10821094        return -1
    10831095    }
    1084         array set portinfo [lindex $res 1]
     1096    array set portinfo [lindex $res 1]
    10851097    set porturl $portinfo(porturl)
    1086    
    10871098    set worker [dportopen $porturl options variations]
    10881099    if {[catch {dportexec $worker clean} result] || $result != 0} {
Note: See TracChangeset for help on using the changeset viewer.