--- bin/emerge.org 2003-09-30 05:29:17.000000000 +0200 +++ bin/emerge 2003-09-30 20:36:53.000000000 +0200 @@ -1835,7 +1835,34 @@ mycommand=mycommand+" --exclude-from "+portage.settings["RSYNC_EXCLUDEFROM"] else: print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist." - mycommand=mycommand+" "+mysyncuri+"/* "+myportdir + + # this is a rewrite of the old emerge-webrsync code + if mysyncuri[:7] == "http://" or mysyncuri[:6] == "ftp://": + attempts = 0 + downloaded = False + minsize=1024*1024 + while attempts < 40 and not downloaded: + mytime = time.localtime() - (attempts*24*60*60) + mysnapshot = time.strftime("%d%m%Y", mytime)+".tar.bz2" + syncdir=portage.settings["PORTAGE_TMPDIR"]+"/websync" + for m in mysyncuri.split(): + if not os.path.exists(syncdir): + os.mkdir(syncdir) + os.chdir(syncdir) + myfetchcmd=portage.settings["FETCH_COMMAND"]+" "+m+"/snapshots/"+mysnapshot + print yellow("*"), "trying to download snapshot "+mysnapshot+" from "+m + if portage.spawn(mycmd, free=1) == 0: + if os.path.exists(mysnapshot) and os.lstat(mysnapshot)[6] > minsize: + print green("*"), mysnapshot+" successfully downloaded" + downloaded = True + attempts += 1 + if not downloaded: + print red("*"), "could not download a complete snapshot" + sys.exit(1) + portage.spawn("tar xjf "+mysnapshot, free=1) + mycommand=mycommand+" "+syncdir+"/portage/* "+myportdir + else: + mycommand=mycommand+" "+mysyncuri+"/* "+myportdir print ">>> starting rsync with "+mysyncuri+"..." exitcode=portage.spawn(mycommand,free=1) #exitcode=0