Index: src/darwinports1.0/darwinports.tcl
===================================================================
RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
retrieving revision 1.212
diff -u -r1.212 darwinports.tcl
--- src/darwinports1.0/darwinports.tcl	5 Apr 2006 23:51:50 -0000	1.212
+++ src/darwinports1.0/darwinports.tcl	25 Apr 2006 16:01:13 -0000
@@ -37,8 +37,8 @@
 
 namespace eval darwinports {
     namespace export bootstrap_options portinterp_options open_dports ui_priorities
-    variable bootstrap_options "portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat portinstalltype portarchivemode portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask variants_conf rsync_server rsync_options rsync_dir startupitem_type xcodeversion xcodebuildcmd"
-    variable portinterp_options "portdbpath portpath portbuildpath auto_path prefix portsharepath registry.path registry.format registry.installtype portarchivemode portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server rsync_options rsync_dir startupitem_type"
+    variable bootstrap_options "portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat portinstalltype portarchivemode remotearchiveurl portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask variants_conf rsync_server rsync_options rsync_dir startupitem_type xcodeversion xcodebuildcmd"
+    variable portinterp_options "portdbpath portpath portbuildpath auto_path prefix portsharepath registry.path registry.format registry.installtype portarchivemode remotearchiveurl portarchivepath portarchivetype portautoclean porttrace portverbose destroot_umask rsync_server rsync_options rsync_dir startupitem_type"
     # deferred options are only computed when needed.
     # they are not exported to the trace thread.
     # they are not exported to the interpreter in system_options array.
@@ -360,6 +360,11 @@
 		global darwinports::portarchivemode
 	}
 
+	if {[info exists remotearchiveurl]} {
+		set darwinports::remotearchiveurl $remotearchiveurl
+		global darwinports::remotearchiveurl
+	}
+
 	# Archive path, where to store/retrieve binary archive packages
 	if {![info exists portarchivepath]} {
 		set darwinports::portarchivepath [file join $portdbpath packages]
Index: src/package1.0/portunarchive.tcl
===================================================================
RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/package1.0/portunarchive.tcl,v
retrieving revision 1.8
diff -u -r1.8 portunarchive.tcl
--- src/package1.0/portunarchive.tcl	27 Aug 2005 00:07:27 -0000	1.8
+++ src/package1.0/portunarchive.tcl	25 Apr 2006 16:01:13 -0000
@@ -62,6 +62,7 @@
 	global ports_force ports_source_only ports_binary_only
 	global portname portversion portrevision portvariants portpath
 	global unarchive.srcpath unarchive.type unarchive.file unarchive.path
+	global remotearchiveurl portverbose
 
 	# Check mode in case archive called directly by user
 	if {[option portarchivemode] != "yes"} {
@@ -108,6 +109,25 @@
 				if {[file exist ${unarchive.path}]} {
 					set found 1
 					break
+				} elseif {[string match "http://*" $remotearchiveurl]} {
+					set platform [option os.platform]
+					set arch [option os.arch]
+					set remotefile "${remotearchiveurl}/${platform}/${arch}/${unarchive.file}"
+					set fetch_options {}
+					if {$portverbose == "yes"} {
+						lappend fetch_options "-v"
+					}
+
+					ui_info "$UI_PREFIX Attempting to fetch ${remotefile}"
+
+					if {![catch {eval curl fetch $fetch_options {$remotefile} ${unarchive.srcpath}/${unarchive.file}.TMP} result] &&
+							![catch {system "mv ${unarchive.srcpath}/${unarchive.file}.TMP ${unarchive.path}"}]} {
+						set found 1
+						break
+					} else {
+						ui_debug "Remote Archive fetching failed: $result"
+						exec rm -f ${unarchive.srcpath}/${unarchive.file}.TMP
+					}
 				} else {
 					ui_debug "No [string toupper ${unarchive.type}] archive: ${unarchive.path}"
 				}

