Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MOABS with build 1: fix post-link.sh #19496

Merged
merged 1 commit into from
Dec 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipes/moabs/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package:
version: {{ version }}

build:
number: 0
number: 1

source:
url: https://github.com/sunnyisgalaxy/moabs/archive/v{{ version }}.tar.gz
Expand Down
33 changes: 19 additions & 14 deletions recipes/moabs/post-link.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,39 @@ function cmd {
local f=$PREFIX/bin/$1
local url=$2
local sha256=$3
wget -q -O "$f" "$url"
local os=$(uname -s)

SUCCESS=0
os=$(uname -s)
if [ "$os" == "Linux" ]
if [ -f "$f" ]
then
shash=$(sha256sum "$f" | cut -f 1 -d ' ')
if [ "$shash" == "$sha256" ]
if [ "$os" == "Linux" ]
then
shash=$(sha256sum "$f" | cut -f 1 -d ' ')
elif [ "$os" == "Darwin" ]
then
SUCCESS=1
shash=$(shasum -a 256 "$f" | cut -f 1 -d ' ')
fi
elif [ "$os" == "Darwin" ]
then
shash=$(shasum -a 256 "$f" | cut -f 1 -d ' ')
if [ "$shash" == "$sha256" ]
then
SUCCESS=1
return 0
fi
fi

if [ $SUCCESS != 1 ]
wget -q -O "$f" "$url"

if [ "$os" == "Linux" ]
then
shash=$(sha256sum "$f" | cut -f 1 -d ' ')
elif [ "$os" == "Darwin" ]
then
shash=$(shasum -a 256 "$f" | cut -f 1 -d ' ')
fi
if [ "$shash" != "$sha256" ]
then
echo "ERROR: post-link.sh was unable to download $f with the sha256 $sha256 from $url at $os." >> "$PREFIX/.messages.txt"
exit -1
fi
}

cmd lut_fet.dat 'https://ndownloader.figshare.com/files/16527371?private_link=44c546b05dd9fa0aee3d' 2f9099e79d6a23764b51220362634acd7412a025464001717ae58acca24a8eb3
# cmd lut_fet.dat 'https://ndownloader.figshare.com/files/16527371?private_link=44c546b05dd9fa0aee3d' 2f9099e79d6a23764b51220362634acd7412a025464001717ae58acca24a8eb3
cmd lut_pdiffCI.dat 'https://ndownloader.figshare.com/files/16527389?private_link=44c546b05dd9fa0aee3d' 98cd92911c9a73267129cb010b1186db7cd248267b58614cc836f78db331902f
cmd lut_pdiffInRegion.dat 'https://ndownloader.figshare.com/files/16527443?private_link=44c546b05dd9fa0aee3d' 6410f059842c11dc62e9452f36f6869edda25d44afc2bd51f9b495c4c3c128e4