[66694] trunk/base/src/port1.0
jmr at macports.org
jmr at macports.org
Tue Apr 20 08:11:38 PDT 2010
Revision: 66694
http://trac.macports.org/changeset/66694
Author: jmr at macports.org
Date: 2010-04-20 08:11:34 -0700 (Tue, 20 Apr 2010)
Log Message:
-----------
incorporate dist_subdir into distpath from the start instead of doing it in fetch_init
Modified Paths:
--------------
trunk/base/src/port1.0/portclean.tcl
trunk/base/src/port1.0/portfetch.tcl
trunk/base/src/port1.0/portmain.tcl
Modified: trunk/base/src/port1.0/portclean.tcl
===================================================================
--- trunk/base/src/port1.0/portclean.tcl 2010-04-20 14:54:53 UTC (rev 66693)
+++ trunk/base/src/port1.0/portclean.tcl 2010-04-20 15:11:34 UTC (rev 66694)
@@ -114,16 +114,12 @@
# This is crude, but works.
#
proc portclean::clean_dist {args} {
- global ports_force name distpath dist_subdir distfiles
+ global ports_force name distpath dist_subdir distfiles usealtworkpath portdbpath altprefix
# remove known distfiles for sure (if they exist)
set count 0
foreach file $distfiles {
- if {[info exist distpath] && [info exists dist_subdir]} {
- set distfile [file join $distpath $dist_subdir $file]
- } else {
- set distfile [file join $distpath $file]
- }
+ set distfile [file join $distpath $file]
if {[file isfile $distfile]} {
ui_debug "Removing file: $distfile"
if {[catch {delete $distfile} result]} {
@@ -142,18 +138,13 @@
# next remove dist_subdir if only needed for this port,
# or if user forces us to
set dirlist [list]
- if {($dist_subdir != $name)} {
- if {[info exists dist_subdir]} {
- set distfullpath [file join $distpath $dist_subdir]
- if {!([info exists ports_force] && $ports_force == "yes")
- && [file isdirectory $distfullpath]
- && [llength [readdir $distfullpath]] > 0} {
- 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]]
- } else {
- lappend dirlist $dist_subdir
- lappend dirlist $name
- }
+ if {$dist_subdir != $name} {
+ if {!([info exists ports_force] && $ports_force == "yes")
+ && [file isdirectory $distpath]
+ && [llength [readdir $distpath]] > 0} {
+ ui_warn [format [msgcat::mc "Distfiles directory '%s' may contain distfiles needed for other ports, use the -f flag to force removal" ] $distpath]
} else {
+ lappend dirlist $dist_subdir
lappend dirlist $name
}
} else {
@@ -162,7 +153,11 @@
# loop through directories
set count 0
foreach dir $dirlist {
- set distdir [file join $distpath $dir]
+ if {$usealtworkpath} {
+ set distdir [file join ${altprefix}${portdbpath} distfiles $dir]
+ } else {
+ set distdir [file join ${portdbpath} distfiles $dir]
+ }
if {[file isdirectory $distdir]} {
ui_debug "Removing directory: ${distdir}"
if {[catch {delete $distdir} result]} {
Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl 2010-04-20 14:54:53 UTC (rev 66693)
+++ trunk/base/src/port1.0/portfetch.tcl 2010-04-20 15:11:34 UTC (rev 66694)
@@ -537,13 +537,8 @@
# Initialize fetch target and call checkfiles.
proc portfetch::fetch_init {args} {
- global distpath dist_subdir fetch_init_done
variable fetch_urls
- if {[info exists distpath] && [info exists dist_subdir] && ![info exists fetch_init_done]} {
- set distpath ${distpath}/${dist_subdir}
- set fetch_init_done yes
- }
portfetch::checkfiles fetch_urls
}
Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl 2010-04-20 14:54:53 UTC (rev 66693)
+++ trunk/base/src/port1.0/portmain.tcl 2010-04-20 15:11:34 UTC (rev 66694)
@@ -160,7 +160,7 @@
set altprefix [file join $userhome .macports]
default worksymlink {[file join ${altprefix}${portpath} work]}
- default distpath {[file join ${altprefix}${portdbpath} distfiles]}
+ default distpath {[file join ${altprefix}${portdbpath} distfiles ${dist_subdir}]}
set portbuildpath "${altprefix}${portbuildpath}"
ui_debug "Going to use alternate build prefix: $altprefix"
@@ -168,7 +168,7 @@
} else {
set usealtworkpath no
default worksymlink {[file join $portpath work]}
- default distpath {[file join $portdbpath distfiles]}
+ default distpath {[file join $portdbpath distfiles ${dist_subdir}]}
}
# end gsoc08-privileges
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100420/ce1fe38a/attachment-0001.html>
More information about the macports-changes
mailing list