[69041] trunk/base/src
jmr at macports.org
jmr at macports.org
Mon Jun 21 15:04:56 PDT 2010
Revision: 69041
http://trac.macports.org/changeset/69041
Author: jmr at macports.org
Date: 2010-06-21 15:04:56 -0700 (Mon, 21 Jun 2010)
Log Message:
-----------
factor out archive subdir, add os.major to it, and use it in archivefetch
Modified Paths:
--------------
trunk/base/src/package1.0/portarchive.tcl
trunk/base/src/package1.0/portarchivefetch.tcl
trunk/base/src/package1.0/portunarchive.tcl
trunk/base/src/port1.0/portutil.tcl
Modified: trunk/base/src/package1.0/portarchive.tcl
===================================================================
--- trunk/base/src/package1.0/portarchive.tcl 2010-06-21 21:56:08 UTC (rev 69040)
+++ trunk/base/src/package1.0/portarchive.tcl 2010-06-21 22:04:56 UTC (rev 69041)
@@ -78,11 +78,7 @@
# Define archive destination directory and target filename
if {![string equal ${archive.destpath} ${workpath}] && ![string equal ${archive.destpath} ""]} {
- if {[llength [get_canonical_archs]] > 1} {
- set archive.fulldestpath [file join ${archive.destpath} [option os.platform] "universal"]
- } else {
- set archive.fulldestpath [file join ${archive.destpath} [option os.platform] [get_canonical_archs]]
- }
+ set archive.fulldestpath [file join ${archive.destpath} [option archive.subdir]]
} else {
set archive.fulldestpath ${archive.destpath}
}
Modified: trunk/base/src/package1.0/portarchivefetch.tcl
===================================================================
--- trunk/base/src/package1.0/portarchivefetch.tcl 2010-06-21 21:56:08 UTC (rev 69040)
+++ trunk/base/src/package1.0/portarchivefetch.tcl 2010-06-21 22:04:56 UTC (rev 69041)
@@ -47,7 +47,8 @@
options archive_sites archivefetch.user archivefetch.password \
archivefetch.use_epsv archivefetch.ignore_sslcert \
- archive_sites.mirror_subdir archivefetch.pubkeys
+ archive_sites.mirror_subdir archivefetch.pubkeys \
+ archive.subdir
# user name & password
default archivefetch.user ""
@@ -61,9 +62,19 @@
default archive_sites macports_archives
default archive_sites.listfile {"archive_sites.tcl"}
default archive_sites.listpath {"port1.0/fetch"}
+default archive.subdir {[portarchivefetch::get_archive_subdir]}
set_ui_prefix
+proc portarchivefetch::get_archive_subdir {} {
+ set archs [get_canonical_archs]
+ if {[llength $archs] > 1} {
+ return [file join [option os.platform]_[option os.major] "universal" [option name]]
+ } else {
+ return [file join [option os.platform]_[option os.major] $archs [option name]]
+ }
+}
+
# Checks possible archive files to assemble url lists for later fetching
proc portarchivefetch::checkarchivefiles {urls} {
global all_archive_files archivefetch.fulldestpath \
@@ -71,11 +82,7 @@
upvar $urls fetch_urls
# Define archive directory, file, and path
- if {[llength [get_canonical_archs]] > 1} {
- set archivefetch.fulldestpath [file join ${portarchivepath} [option os.platform] "universal"]
- } else {
- set archivefetch.fulldestpath [file join ${portarchivepath} [option os.platform] [get_canonical_archs]]
- }
+ set archivefetch.fulldestpath [file join ${portarchivepath} [option archive.subdir]]
set unsupported 0
set found 0
@@ -193,7 +200,12 @@
}
unset -nocomplain fetched
foreach site $urlmap($url_var) {
- ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $archive $site]"
+ if {[string index $site end] != "/"} {
+ append site "/[option archive.subdir]"
+ } else {
+ append site [option archive.subdir]
+ }
+ ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $archive ${site}]"
set file_url [portfetch::assemble_url $site $archive]
set effectiveURL ""
if {![catch {eval curl fetch --effective-url effectiveURL $fetch_options {$file_url} {"${incoming_path}/${archive}.TMP"}} result]} {
Modified: trunk/base/src/package1.0/portunarchive.tcl
===================================================================
--- trunk/base/src/package1.0/portunarchive.tcl 2010-06-21 21:56:08 UTC (rev 69040)
+++ trunk/base/src/package1.0/portunarchive.tcl 2010-06-21 22:04:56 UTC (rev 69041)
@@ -73,11 +73,7 @@
# Define archive directory, file, and path
if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} {
- if {[llength [get_canonical_archs]] > 1} {
- set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] "universal"]
- } else {
- set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] [get_canonical_archs]]
- }
+ unarchive.fullsrcpath [file join ${unarchive.srcpath} [option archive.subdir]]
} else {
set unarchive.fullsrcpath ${unarchive.srcpath}
}
Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl 2010-06-21 21:56:08 UTC (rev 69040)
+++ trunk/base/src/port1.0/portutil.tcl 2010-06-21 22:04:56 UTC (rev 69041)
@@ -2623,11 +2623,7 @@
# Define archive directory, file, and path
if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} {
- if {[llength [get_canonical_archs]] > 1} {
- set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] "universal"]
- } else {
- set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] [get_canonical_archs]]
- }
+ unarchive.fullsrcpath [file join ${unarchive.srcpath} [option archive.subdir]]
} else {
set unarchive.fullsrcpath ${unarchive.srcpath}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100621/866c3435/attachment.html>
More information about the macports-changes
mailing list