Skip to content
Permalink
Browse files

fallback to the opendarwin mirror list. The opendarwin mirror list

(currently these are 'distfiles.opendarwin.org', 'distfiles-od.opendarwin.org'
and 'distfiles-msn.opendarwin.org') is appended to the master_sites listing
given in the Portfile. The OpenDarwin site is tried at last before failing.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@3884 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Felix Kronlage
Felix Kronlage committed Nov 3, 2003
1 parent a79dc46 commit c8459538f624e573e7123186ec7eb5c9ccd03f92
Showing with 28 additions and 5 deletions.
  1. +17 −4 src/port1.0/portfetch.tcl
  2. +11 −1 src/port1.0/resources/fetch/mirror_sites.tcl
@@ -62,6 +62,7 @@ default fetch.args {"-o ${distfile}.TMP"}
default fetch.pre_args {"-f -L"}
default fetch.post_args {[portfetch::assemble_url ${site} ${distfile}]}

default fallback_mirror_site "opendarwin"
default mirror_sites.listfile {"mirror_sites.tcl"}
default mirror_sites.listpath {"${portresourcepath}/fetch/"}

@@ -154,20 +155,30 @@ proc mirror_sites {mirrors tag subdir} {
ui_warn "[format [msgcat::mc "No mirror sites on file for class %s"] $mirrors]"
return {}
}

set ret [list]
foreach element $portfetch::mirror_sites::sites($mirrors) {
if {"$subdir" == ""} {

# here we have the chance to take a look at tags, that possibly
# have been assigned in mirror_sites.tcl
set splitlist [split $element :]
if {[llength $splitlist] > 1} {
set element "[lindex $splitlist 0]:[lindex $splitlist 1]"
set mirror_tag "[lindex $splitlist 2]"
}

if {$subdir == "" && $mirror_tag != "nosubdir"} {
set subdir ${portname}
}

if {"$tag" != ""} {
if {"$tag" != ""} {
eval append element "${subdir}:${tag}"
} else {
eval append element "${subdir}"
}
eval lappend ret $element
}

return $ret
}

@@ -179,7 +190,9 @@ proc mirror_sites {mirrors tag subdir} {
proc checkfiles {args} {
global distdir distfiles patchfiles all_dist_files patch_sites fetch_urls \
master_sites filespath master_sites.mirror_subdir \
patch_sites.mirror_subdir
patch_sites.mirror_subdir fallback_mirror_site

append master_sites " ${fallback_mirror_site}"

foreach list {master_sites patch_sites} {
upvar #0 $list uplist
@@ -1,9 +1,13 @@
# $Id: mirror_sites.tcl,v 1.3 2003/09/12 23:48:35 fkr Exp $
# $Id: mirror_sites.tcl,v 1.4 2003/11/03 17:36:42 fkr Exp $
# mirror_sites.tcl
#
# List of master site classes for use in Portfiles
# Most of these are taken shamelessly from FreeBSD.
#
# Appending :nosubdir as a tag to a mirror, means that
# the portfetch target will NOT append a subdirectory to
# the mirror site.
#
# Please keep this list sorted.

namespace eval portfetch::mirror_sites { }
@@ -101,6 +105,12 @@ set portfetch::mirror_sites::sites(kde) {
ftp://ftp.chg.ru/pub/X11/kde/
}

set portfetch::mirror_sites::sites(opendarwin) {
http://distfiles.opendarwin.org/
http://distfiles-od.opendarwin.org/:nosubdir
http://distfiles-msn.opendarwin.org/:nosubdir
}

set portfetch::mirror_sites::sites(perl_cpan) {
http://www.cpan.dk/CPAN/modules/by-module/
ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module/

0 comments on commit c845953

Please sign in to comment.
You can’t perform that action at this time.