Changeset 66694


Ignore:
Timestamp:
Apr 20, 2010, 3:11:34 PM (10 years ago)
Author:
jmr@…
Message:

incorporate dist_subdir into distpath from the start instead of doing it in fetch_init

Location:
trunk/base/src/port1.0
Files:
3 edited

Legend:

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

    r64423 r66694  
    115115#
    116116proc portclean::clean_dist {args} {
    117     global ports_force name distpath dist_subdir distfiles
     117    global ports_force name distpath dist_subdir distfiles usealtworkpath portdbpath altprefix
    118118
    119119    # remove known distfiles for sure (if they exist)
    120120    set count 0
    121121    foreach file $distfiles {
    122         if {[info exist distpath] && [info exists dist_subdir]} {
    123             set distfile [file join $distpath $dist_subdir $file]
    124         } else {
    125             set distfile [file join $distpath $file]
    126         }
     122        set distfile [file join $distpath $file]
    127123        if {[file isfile $distfile]} {
    128124            ui_debug "Removing file: $distfile"
     
    143139    # or if user forces us to
    144140    set dirlist [list]
    145     if {($dist_subdir != $name)} {
    146         if {[info exists dist_subdir]} {
    147             set distfullpath [file join $distpath $dist_subdir]
    148             if {!([info exists ports_force] && $ports_force == "yes")
    149                 && [file isdirectory $distfullpath]
    150                 && [llength [readdir $distfullpath]] > 0} {
    151                 ui_warn [format [msgcat::mc "Distfiles directory '%s' may contain distfiles needed for other ports, use the -f flag to force removal" ] [file join $distpath $dist_subdir]]
    152             } else {
    153                 lappend dirlist $dist_subdir
    154                 lappend dirlist $name
    155             }
     141    if {$dist_subdir != $name} {
     142        if {!([info exists ports_force] && $ports_force == "yes")
     143            && [file isdirectory $distpath]
     144            && [llength [readdir $distpath]] > 0} {
     145            ui_warn [format [msgcat::mc "Distfiles directory '%s' may contain distfiles needed for other ports, use the -f flag to force removal" ] $distpath]
    156146        } else {
     147            lappend dirlist $dist_subdir
    157148            lappend dirlist $name
    158149        }
     
    163154    set count 0
    164155    foreach dir $dirlist {
    165         set distdir [file join $distpath $dir]
     156        if {$usealtworkpath} {
     157            set distdir [file join ${altprefix}${portdbpath} distfiles $dir]
     158        } else {
     159            set distdir [file join ${portdbpath} distfiles $dir]
     160        }
    166161        if {[file isdirectory $distdir]} {
    167162            ui_debug "Removing directory: ${distdir}"
  • trunk/base/src/port1.0/portfetch.tcl

    r65096 r66694  
    538538# Initialize fetch target and call checkfiles.
    539539proc portfetch::fetch_init {args} {
    540     global distpath dist_subdir fetch_init_done
    541540    variable fetch_urls
    542541
    543     if {[info exists distpath] && [info exists dist_subdir] && ![info exists fetch_init_done]} {
    544         set distpath ${distpath}/${dist_subdir}
    545         set fetch_init_done yes
    546     }
    547542    portfetch::checkfiles fetch_urls
    548543}
  • trunk/base/src/port1.0/portmain.tcl

    r66306 r66694  
    161161
    162162    default worksymlink {[file join ${altprefix}${portpath} work]}
    163     default distpath {[file join ${altprefix}${portdbpath} distfiles]}
     163    default distpath {[file join ${altprefix}${portdbpath} distfiles ${dist_subdir}]}
    164164    set portbuildpath "${altprefix}${portbuildpath}"
    165165
     
    169169    set usealtworkpath no
    170170    default worksymlink {[file join $portpath work]}
    171     default distpath {[file join $portdbpath distfiles]}
     171    default distpath {[file join $portdbpath distfiles ${dist_subdir}]}
    172172}
    173173# end gsoc08-privileges
Note: See TracChangeset for help on using the changeset viewer.