[66697] trunk/base/src/port1.0

jmr at macports.org jmr at macports.org
Tue Apr 20 10:12:37 PDT 2010


Revision: 66697
          http://trac.macports.org/changeset/66697
Author:   jmr at macports.org
Date:     2010-04-20 10:12:31 -0700 (Tue, 20 Apr 2010)
Log Message:
-----------
if distfiles are not present in the normal location, look for them in ~/.macports

Modified Paths:
--------------
    trunk/base/src/port1.0/portchecksum.tcl
    trunk/base/src/port1.0/portextract.tcl
    trunk/base/src/port1.0/portfetch.tcl

Modified: trunk/base/src/port1.0/portchecksum.tcl
===================================================================
--- trunk/base/src/port1.0/portchecksum.tcl	2010-04-20 16:39:28 UTC (rev 66696)
+++ trunk/base/src/port1.0/portchecksum.tcl	2010-04-20 17:12:31 UTC (rev 66697)
@@ -188,6 +188,7 @@
 #
 proc portchecksum::checksum_main {args} {
     global UI_PREFIX all_dist_files checksum_types checksums_array portverbose checksum.skip
+    global usealtworkpath altprefix
 
     # If no files have been downloaded, there is nothing to checksum.
     if {![info exists all_dist_files]} {
@@ -217,6 +218,13 @@
 
             # get the full path of the distfile.
             set fullpath [file join $distpath $distfile]
+            if {![file isfile $fullpath]} {
+                if {!$usealtworkpath && [file isfile "${altprefix}${fullpath}"]} {
+                    set fullpath "${altprefix}${fullpath}"
+                } else {
+                    return -code error "$distfile does not exist in $distpath"
+                }
+            }
 
             # check that there is at least one checksum for the distfile.
             if {![info exists checksums_array($distfile)]} {
@@ -261,6 +269,9 @@
             }
 
             set fullpath [file join $distpath $distfile]
+            if {![file isfile $fullpath] && (!$usealtworkpath && [file isfile "${altprefix}${fullpath}"])} {
+                set fullpath "${altprefix}${fullpath}"
+            }
             foreach type $checksum_types {
                 lappend sums [format "%-8s%s" $type [calc_$type $fullpath]]
             }

Modified: trunk/base/src/port1.0/portextract.tcl
===================================================================
--- trunk/base/src/port1.0/portextract.tcl	2010-04-20 16:39:28 UTC (rev 66696)
+++ trunk/base/src/port1.0/portextract.tcl	2010-04-20 17:12:31 UTC (rev 66697)
@@ -116,7 +116,7 @@
 }
 
 proc portextract::extract_main {args} {
-    global UI_PREFIX filespath worksrcpath extract.dir
+    global UI_PREFIX filespath worksrcpath extract.dir usealtworkpath altprefix
 
     if {![exists distfiles] && ![exists extract.only]} {
         # nothing to do
@@ -127,6 +127,8 @@
         ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile]"
         if {[file exists $filespath/$distfile]} {
             option extract.args "$filespath/$distfile"
+        } elseif {![file exists "[option distpath]/$distfile"] && !$usealtworkpath && [file exists "${altprefix}[option distpath]/$distfile"]} {
+            option extract.args "${altprefix}[option distpath]/$distfile"
         } else {
             option extract.args "[option distpath]/$distfile"
         }

Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl	2010-04-20 16:39:28 UTC (rev 66696)
+++ trunk/base/src/port1.0/portfetch.tcl	2010-04-20 17:12:31 UTC (rev 66697)
@@ -422,7 +422,7 @@
 proc portfetch::fetchfiles {args} {
     global distpath all_dist_files UI_PREFIX
     global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert fetch.remote_time
-    global fallback_mirror_site portverbose
+    global fallback_mirror_site portverbose usealtworkpath altprefix
     variable fetch_urls
     variable urlmap
 
@@ -460,7 +460,7 @@
     set sorted no
 
     foreach {url_var distfile} $fetch_urls {
-        if {![file isfile $distpath/$distfile]} {
+        if {![file isfile $distpath/$distfile] && ($usealtworkpath || ![file isfile ${altprefix}${distpath}/$distfile])} {
             ui_info "$UI_PREFIX [format [msgcat::mc "%s doesn't seem to exist in %s"] $distfile $distpath]"
             if {![file writable $distpath]} {
                 return -code error [format [msgcat::mc "%s must be writable"] $distpath]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100420/50448612/attachment.html>


More information about the macports-changes mailing list