diff options
author | Aaron M. Ucko <ucko@debian.org> | 2023-02-01 23:28:49 -0500 |
---|---|---|
committer | Aaron M. Ucko <ucko@debian.org> | 2023-02-01 23:28:49 -0500 |
commit | 6177c74909e50914210c8431f2fa77aa6fbd64ae (patch) | |
tree | 8235093b50cc33cb3eb30d27efed265ac013d1b2 /download-ncbi-software | |
parent | c1994a0c51757123d8649a83505480df6d1c3b80 (diff) |
New upstream version 15.5.20210827+dfsg
Diffstat (limited to 'download-ncbi-software')
-rwxr-xr-x | download-ncbi-software | 111 |
1 files changed, 97 insertions, 14 deletions
diff --git a/download-ncbi-software b/download-ncbi-software index 923622d..d1dac58 100755 --- a/download-ncbi-software +++ b/download-ncbi-software @@ -6,28 +6,38 @@ cmd="$1" shift -suffix="" - osname=`uname -s` cputype=`uname -m` -case "$osname-$cputype" in - Linux-x86_64 ) suffix=linux ;; - Darwin-x86_64 ) suffix=macosx ;; - Darwin-*arm* ) suffix=macosx ;; - CYGWIN_NT-* | MINGW*-* ) suffix=win64 ;; - Linux-*arm* ) suffix= ;; - * ) suffix= ;; -esac case "$cmd" in -h | -help | --help | help ) cat <<EOF -USAGE: $0 - magic-blast +USAGE: download-ncbi-software [ magic-blast | datasets | sra-toolkit ] EOF exit 0 ;; - magic-blast | -magic-blast ) + magicblast | magic-blast | -magicblast | -magic-blast ) + suffix="" + case "$osname-$cputype" in + Linux-x86_64 ) + suffix=linux + ;; + Darwin-x86_64 ) + suffix=macosx + ;; + Darwin-*arm* ) + suffix=macosx + ;; + CYGWIN_NT-* | MINGW*-* ) + suffix=win64 + ;; + Linux-*arm* ) + suffix= + ;; + * ) + suffix= + ;; + esac if [ -n "$suffix" ] then dir="ftp://ftp.ncbi.nlm.nih.gov/blast/executables/magicblast/LATEST" @@ -47,7 +57,80 @@ EOF fi exit 0 ;; + datasets | dataformat | -datasets | -dataformat ) + suffix="" + extnsn="" + case "$osname-$cputype" in + Linux-x86_64 ) + suffix=linux-amd64 + ;; + Darwin-x86_64 ) + suffix=mac + ;; + Darwin-*arm* ) + suffix=mac + ;; + CYGWIN_NT-* | MINGW*-* ) + suffix=win64 + extnsn=".exe" + ;; + Linux-*arm* ) + suffix= + ;; + * ) + suffix= + ;; + esac + if [ -n "$suffix" ] + then + dir="ftp://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/LATEST" + nquire -dwn "$dir" "$suffix" "datasets${extnsn}" + nquire -dwn "$dir" "$suffix" "dataformat${extnsn}" + if [ -z "$extnsn" ] + then + chmod +x datasets dataformat + fi + fi + exit 0 + ;; + sratoolkit | sra-toolkit | -sratoolkit | -sra-toolkit ) + suffix="" + case "$osname-$cputype" in + Linux-x86_64 ) + suffix= + ;; + Darwin-x86_64 ) + suffix=mac64 + ;; + Darwin-*arm* ) + suffix=mac64 + ;; + CYGWIN_NT-* | MINGW*-* ) + suffix= + ;; + Linux-*arm* ) + suffix= + ;; + * ) + suffix= + ;; + esac + if [ -n "$suffix" ] + then + dir="ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/current" + fl=$( + nquire -lst "$dir" | + grep "sratoolkit.current" | + grep "$suffix" + ) + nquire -dwn "$dir" "$fl" + gunzip "$fl" + tr="${fl%.gz}" + tar -xf "$tr" + rm -rf "./${tr}" + fi + exit 0 + ;; * ) - break ;; esac |