Skip to content

Commit e5e76d6

Browse files
committed
FIX?
1 parent 14fb06c commit e5e76d6

File tree

2 files changed

+49
-12
lines changed

2 files changed

+49
-12
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313

1414
# Setup anaconda
1515
before_install:
16-
- wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh
16+
- wget http://repo.continuum.io/miniconda/Miniconda-3.7.0-Linux-x86_64.sh -O miniconda.sh
1717
- chmod +x miniconda.sh
1818
- ./miniconda.sh -b
1919
- export PATH=/home/travis/anaconda/bin:$PATH
@@ -38,9 +38,11 @@ before_script:
3838
- export DISPLAY=:99.0
3939
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
4040
- cd ~
41-
- wget --quiet http://faculty.washington.edu/larsoner/fsaverage_min.tar.gz
41+
- wget --quiet http://faculty.washington.edu/larsoner/fsaverage_min.zip
4242
- mkdir subjects
43-
- tar --directory subjects -xzf fsaverage_min.tar.gz
43+
- cd subjects
44+
- unzip ../fsaverage_min.tar.gz
45+
- cd ..
4446
- export SUBJECTS_DIR="${PWD}/subjects"
4547

4648
script:

make/install_python.ps1

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,41 @@
33
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
44

55
$MINICONDA_URL = "http://repo.continuum.io/miniconda/"
6-
$BASE_URL = "https://www.python.org/ftp/python/"
6+
$FSAVERAGE_URL = "http://faculty.washington.edu/larsoner/fsaverage_min.tar.gz"
7+
8+
function DownloadExtractFsaverage () {
9+
$webclient = New-Object System.Net.WebClient
10+
$basedir = $pwd.Path + "\"
11+
$filepath = $basedir + "fsaverage_min.zip"
12+
# Download and retry up to 3 times in case of network transient errors.
13+
$url = $FSAVERAGE_URL
14+
Write-Host "Downloading" $url
15+
$retry_attempts = 2
16+
for($i=0; $i -lt $retry_attempts; $i++){
17+
try {
18+
$webclient.DownloadFile($url, $filepath)
19+
break
20+
}
21+
Catch [Exception]{
22+
Start-Sleep 1
23+
}
24+
}
25+
if (Test-Path $filepath) {
26+
Write-Host "File saved at" $filepath
27+
} else {
28+
# Retry once to get the error message if any at the last try
29+
$webclient.DownloadFile($url, $filepath)
30+
}
31+
# Now we extract
32+
$subjects_dir = $basedir + "\subjects"
33+
New-Item -ItemType directory -Path $subjects_dir
34+
$shell = new-object -com shell.application
35+
$zip = $shell.NameSpace($filepath)
36+
foreach($item in $zip.items())
37+
{
38+
$shell.Namespace($subjects_dir).copyhere($item)
39+
}
40+
}
741

842

943
function DownloadMiniconda ($python_version, $platform_suffix) {
@@ -33,14 +67,14 @@ function DownloadMiniconda ($python_version, $platform_suffix) {
3367
Catch [Exception]{
3468
Start-Sleep 1
3569
}
36-
}
37-
if (Test-Path $filepath) {
38-
Write-Host "File saved at" $filepath
39-
} else {
40-
# Retry once to get the error message if any at the last try
41-
$webclient.DownloadFile($url, $filepath)
42-
}
43-
return $filepath
70+
}
71+
if (Test-Path $filepath) {
72+
Write-Host "File saved at" $filepath
73+
} else {
74+
# Retry once to get the error message if any at the last try
75+
$webclient.DownloadFile($url, $filepath)
76+
}
77+
return $filepath
4478
}
4579

4680

@@ -86,6 +120,7 @@ function InstallMinicondaPip ($python_home) {
86120

87121

88122
function main () {
123+
DownloadExtractFsaverage
89124
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
90125
InstallMinicondaPip $env:PYTHON
91126
}

0 commit comments

Comments
 (0)