Lines 1835-1841
Link Here
|
1835 |
mycommand=mycommand+" --exclude-from "+portage.settings["RSYNC_EXCLUDEFROM"] |
1835 |
mycommand=mycommand+" --exclude-from "+portage.settings["RSYNC_EXCLUDEFROM"] |
1836 |
else: |
1836 |
else: |
1837 |
print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist." |
1837 |
print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist." |
1838 |
mycommand=mycommand+" "+mysyncuri+"/* "+myportdir |
1838 |
|
|
|
1839 |
# this is a rewrite of the old emerge-webrsync code |
1840 |
if mysyncuri[:7] == "http://" or mysyncuri[:6] == "ftp://": |
1841 |
attempts = 0 |
1842 |
downloaded = False |
1843 |
minsize=1024*1024 |
1844 |
while attempts < 40 and not downloaded: |
1845 |
mytime = time.localtime() - (attempts*24*60*60) |
1846 |
mysnapshot = time.strftime("%d%m%Y", mytime)+".tar.bz2" |
1847 |
syncdir=portage.settings["PORTAGE_TMPDIR"]+"/websync" |
1848 |
for m in mysyncuri.split(): |
1849 |
if not os.path.exists(syncdir): |
1850 |
os.mkdir(syncdir) |
1851 |
os.chdir(syncdir) |
1852 |
myfetchcmd=portage.settings["FETCH_COMMAND"]+" "+m+"/snapshots/"+mysnapshot |
1853 |
print yellow("*"), "trying to download snapshot "+mysnapshot+" from "+m |
1854 |
if portage.spawn(mycmd, free=1) == 0: |
1855 |
if os.path.exists(mysnapshot) and os.lstat(mysnapshot)[6] > minsize: |
1856 |
print green("*"), mysnapshot+" successfully downloaded" |
1857 |
downloaded = True |
1858 |
attempts += 1 |
1859 |
if not downloaded: |
1860 |
print red("*"), "could not download a complete snapshot" |
1861 |
sys.exit(1) |
1862 |
portage.spawn("tar xjf "+mysnapshot, free=1) |
1863 |
mycommand=mycommand+" "+syncdir+"/portage/* "+myportdir |
1864 |
else: |
1865 |
mycommand=mycommand+" "+mysyncuri+"/* "+myportdir |
1839 |
print ">>> starting rsync with "+mysyncuri+"..." |
1866 |
print ">>> starting rsync with "+mysyncuri+"..." |
1840 |
exitcode=portage.spawn(mycommand,free=1) |
1867 |
exitcode=portage.spawn(mycommand,free=1) |
1841 |
#exitcode=0 |
1868 |
#exitcode=0 |