Skip to content

Commit e8594f5

Browse files
committed
Fix TRUST link & exit $? bugs
- Updated TRUST URL - Fixed all instances of `echo; exit $?`. This always returns success (since $? refers to echo's exist status)
1 parent d1c8f58 commit e8594f5

File tree

13 files changed

+78
-88
lines changed

13 files changed

+78
-88
lines changed

easy_setup/install_ext_software/alf.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set -euo pipefail # exit on errors and undefined vars
1919
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
2020
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
2121
echo "configTRAL_path.cfg not found"
22-
exit $?
22+
exit 1
2323
}
2424

2525
[[ ":$PATH:" != *"$TRAL_EXT_SOFTWARE/bin:$PATH"* ]] && export PATH="$TRAL_EXT_SOFTWARE/bin:$PATH"
@@ -35,7 +35,7 @@ if [ ! -d "$TRAL_EXT_SOFTWARE/ALF_standalone" ]; then # test if not already in d
3535
tar -xvzf "$TRAL_EXT_SOFTWARE/ALF_standalone.tar.gz" -C "$TRAL_EXT_SOFTWARE"
3636
} || {
3737
echo "Couldn't download or unzip ALF."
38-
exit $?
38+
exit 1
3939
}
4040

4141
fi
@@ -52,5 +52,3 @@ ln -sf "$INSTALLATION_PATH/bin/alfdarwin" "$INSTALLATION_PATH"
5252
# rm -rf /usr/local/bin/alfdarwin.linux64
5353
# rm -rf /usr/local/bin/alfsim
5454
# rm -rf /usr/local/share/alfdarwin
55-
56-

easy_setup/install_ext_software/castor.sh

+21-22
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ shopt -s nocasematch # making comparisons case-insensitive
1616
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
1717
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
1818
echo "configTRAL_path.cfg not found"
19-
exit $?
19+
exit 1
2020
}
2121

2222
mkdir -p "$TRAL_EXT_SOFTWARE/castor"
@@ -26,7 +26,7 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
2626

2727
(
2828
cd "$TRAL_EXT_SOFTWARE/castor"
29-
{
29+
{
3030
{
3131
## bpp-core http://biopp.univ-montp2.fr/
3232
(
@@ -41,9 +41,9 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
4141
make clean
4242
sudo make install
4343
)
44-
} || {
44+
} || {
4545
echo "A problem occured while trying to install bpp-core."
46-
exit $?
46+
exit 1
4747
}
4848
} && {
4949
{
@@ -60,9 +60,9 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
6060
make clean
6161
sudo make install
6262
)
63-
} || {
63+
} || {
6464
echo "A problem occured while trying to install bpp-seq."
65-
exit $?
65+
exit 1
6666
}
6767
} && {
6868
{
@@ -79,9 +79,9 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
7979
make clean
8080
sudo make install
8181
)
82-
} || {
82+
} || {
8383
echo "A problem occured while trying to install bpp-phy."
84-
exit $?
84+
exit 1
8585
}
8686
} && {
8787
{
@@ -95,26 +95,26 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
9595
./b2
9696
sudo ./b2 install
9797
)
98-
} || {
98+
} || {
9999
echo "A problem occured while trying to install boost."
100-
exit $?
100+
exit 1
101101
}
102102
} && {
103-
{
103+
{
104104
## glog - Google Logging Library https://github.com/google/glog
105105
(
106106
git clone https://github.com/google/glog
107107
cd glog
108108
cmake -H. -Bbuild -G "Unix Makefiles"
109109
sudo cmake --build build --target install
110110
)
111-
} || {
111+
} || {
112112
echo "A problem occured while trying to install glog."
113-
exit $?
113+
exit 1
114114
}
115-
} && {
115+
} && {
116116
{
117-
## TSHLib - Tree Search Heuristics Library
117+
## TSHLib - Tree Search Heuristics Library
118118
(
119119
echo ls
120120
git clone https://github.com/acg-team/tshlib.git # do not use the bitbucket
@@ -124,9 +124,9 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
124124
cmake -- -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
125125
sudo make install
126126
)
127-
} || {
127+
} || {
128128
echo "A problem occured while trying to install TSHLib."
129-
exit $?
129+
exit 1
130130
}
131131
} && {
132132
{
@@ -136,9 +136,9 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
136136
sudo wget https://github.com/01org/tbb/releases/download/2018_U5/tbb2018_20180618oss_lin.tgz
137137
sudo tar -xvf tbb2018_20180618oss_lin.tgz
138138
)
139-
} || {
139+
} || {
140140
echo "A problem occured while trying to install Intel TBB."
141-
exit $?
141+
exit 1
142142
}
143143
} && {
144144
{
@@ -150,10 +150,9 @@ mkdir -p "$TRAL_EXT_SOFTWARE/castor"
150150
sudo make
151151
ln -sf "$TRAL_EXT_SOFTWARE/castor/castor_aligner/Castor" "$INSTALLATION_PATH" # copy executable into system path
152152
)
153-
} || {
153+
} || {
154154
echo "A problem occured while trying to compile Castor."
155-
exit $?
155+
exit 1
156156
}
157157
}
158158
)
159-

easy_setup/install_ext_software/hhrepid.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ set -euo pipefail # exit on errors and undefined vars
4545
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
4646
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
4747
echo "configTRAL_path.cfg not found"
48-
exit $?
48+
exit 1
4949
}
5050

5151
######################
@@ -60,7 +60,7 @@ if [ ! -f "$TRAL_EXT_SOFTWARE/HHrepID/hhrepid_64" ]; then # test if not already
6060
wget "$LINK_HHREPID/README" -P "$TRAL_EXT_SOFTWARE/HHrepID" # download README
6161
} || {
6262
echo "Couldn't download HHrepID."
63-
exit $?
63+
exit 1
6464
}
6565
fi
6666

easy_setup/install_ext_software/hmmer.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -euo pipefail # exit on errors and undefined vars
2020
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
2121
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
2222
echo "configTRAL_path.cfg not found"
23-
exit $?
23+
exit 1
2424
}
2525

2626
######################
@@ -32,16 +32,16 @@ for directory in "$TRAL_EXT_SOFTWARE/hmmer"*; do # test if hmmer files not alre
3232
if [ -d "$directory" ]; then
3333
echo "HMMER is already downloaded and in "$directory""
3434
else
35-
{
35+
{
3636
LINK_HMMER="http://eddylab.org/software/hmmer/hmmer.tar.gz" # HHrepID Nov 22 2007
3737
wget "$LINK_HMMER" -P "$TRAL_EXT_SOFTWARE" # download execution file
3838
tar -xvzf "$TRAL_EXT_SOFTWARE/hmmer.tar.gz" -C "$TRAL_EXT_SOFTWARE"
3939
rm -rf "$TRAL_EXT_SOFTWARE/hmmer.tar.gz"
4040
} || {
4141
echo "Couldn't download HMMER."
42-
exit $?
42+
exit 1
4343
}
44-
44+
4545
fi
4646
done
4747

@@ -66,7 +66,7 @@ done
6666
)
6767
} || {
6868
echo "Couldn't compile and install HMMER."
69-
exit $?
69+
exit 1
7070
}
7171

7272
###############i#######
@@ -76,7 +76,7 @@ done
7676

7777
# {
7878
# ( cd "$TRAL_EXT_SOFTWARE/hmmer-"* && make uninstall )
79-
# rm -rf "$TRAL_EXT_SOFTWARE/hmmer-"*
79+
# rm -rf "$TRAL_EXT_SOFTWARE/hmmer-"*
8080
# rm -rf "$INSTALLATION_PATH/hmmbuild"
8181
# } || {
8282
# echo -e "HMMER removed."

easy_setup/install_ext_software/mafft.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ set -euo pipefail # exit on errors and undefined vars
2525
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
2626
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
2727
echo "configTRAL_path.cfg not found"
28-
exit $?
28+
exit 1
2929
}
3030

3131
# ######################
@@ -39,13 +39,13 @@ echo "Change version in tral/easy_setup/install_ext_software/mafft.sh to"
3939
echo "the latest version from https://mafft.cbrc.jp/alignment/software/source.html"
4040
echo "---------------------------------------------------------------------"
4141

42-
sleep 5
42+
sleep 5
4343

44-
if [ ! -d "$TRAL_EXT_SOFTWARE/$mafftVer" ]; then
44+
if [ ! -d "$TRAL_EXT_SOFTWARE/$mafftVer" ]; then
4545
{
4646
wget "https://mafft.cbrc.jp/alignment/software/"$mafftVer -P "$TRAL_EXT_SOFTWARE" || { # download
4747
echo "Was not able to download mafft."
48-
exit $?
48+
exit 1
4949
}
5050
tar -xvzf "$TRAL_EXT_SOFTWARE/$mafftVer" -C "$TRAL_EXT_SOFTWARE"
5151
sed -i "s#PREFIX = /usr/local#PREFIX = \"$INSTALLATION_PATH\"#" "$TRAL_EXT_SOFTWARE/$latestVer/core/Makefile" # change default installation path in Makefile

easy_setup/install_ext_software/not_supported/tred.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ set -euo pipefail # exit on errors and undefined vars
3939
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
4040
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
4141
echo "configTRAL_path.cfg not found"
42-
exit $?
42+
exit 1
4343
}
4444

4545
# check if virtualenv is installed
@@ -71,7 +71,7 @@ virtualenv "$TRAL_ENV/python2" -p ${PYTHON2:-python2}
7171

7272
. "$TRAL_ENV/python2/bin/activate" || {
7373
echo "Was not able to activate the virtual environment with Python2 to install tredparse"
74-
exit $?
74+
exit 1
7575
}
7676

7777
# install ipython within the virtual environment
@@ -83,7 +83,8 @@ pip install ipython
8383
### Installation tredparse
8484

8585
"$TRAL_ENV/python2/bin/pip" install tredparse || {
86-
echo "Was not able to install tredparse.; exit $?"
86+
echo "Was not able to install tredparse."
87+
exit 1
8788
}
8889

8990
# Wrapper, sourcing tral2, call tred.py with all arguments "$@"

easy_setup/install_ext_software/not_supported/tredparse.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ set -euo pipefail # exit on errors and undefined vars
3939
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
4040
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
4141
echo "configTRAL_path.cfg not found"
42-
exit $?
42+
exit 1
4343
}
4444

4545
# check if virtualenv is installed
@@ -71,7 +71,7 @@ virtualenv "$TRAL_ENV/python2" -p ${PYTHON2:-python2}
7171

7272
. "$TRAL_ENV/python2/bin/activate" || {
7373
echo "Was not able to activate the virtual environment with Python2 to install tredparse"
74-
exit $?
74+
exit 1
7575
}
7676

7777
# install ipython within the virtual environment
@@ -83,7 +83,8 @@ pip install ipython
8383
### Installation tredparse
8484

8585
"$TRAL_ENV/python2/bin/pip" install tredparse || {
86-
echo "Was not able to install tredparse.; exit $?"
86+
echo "Was not able to install tredparse."
87+
exit 1
8788
}
8889

8990
# Wrapper, sourcing tral2, call tred.py with all arguments "$@"

easy_setup/install_ext_software/phobos.sh

+9-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -euo pipefail # exit on errors and undefined vars
2222
PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other files are located one directory above
2323
. "$PARENT_PATH/configTRAL_path.cfg" || { # provide paths from config file
2424
echo "configTRAL_path.cfg not found"
25-
exit $?
25+
exit 1
2626
}
2727

2828
######################
@@ -31,7 +31,7 @@ PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) # other fi
3131
## TODO: Does the test work if phobos not installed in a system path?
3232

3333
if [ ! -x "$(command -v phobos_64_libstdc++6)" ]; then # test if not already in directory
34-
34+
3535
if [[ "${ACCEPT_ALL:-no}" = "yes" ]]; then
3636
ma=a
3737
else
@@ -51,17 +51,17 @@ if [ ! -x "$(command -v phobos_64_libstdc++6)" ]; then # test if not already in
5151
then
5252
gnome-open "https://www.ruhr-uni-bochum.de/ecoevo/cm/regist_form.htm"
5353
fi
54-
54+
5555
echo -e "\nAfter downloading your version of choice you can unzip it and put the binaries into your PATH.\n"
5656
;;
5757
[Aa]* )
5858
echo -e "\nDo you confirm to the authors copyright (Copyright (c) Christoph Mayer 2006-2017)?\n This program is for academic and non-commercial usage only."
59-
59+
6060
if [[ "${ACCEPT_ALL:-no}" = "yes" ]]; then
6161
yn=y
6262
else read -p "Would you like to download the phobos-v3.3.12-linux version? yes(y) or no (n):" yn
6363
fi
64-
64+
6565
case $yn in
6666
[Yy]* )
6767
{
@@ -70,12 +70,12 @@ if [ ! -x "$(command -v phobos_64_libstdc++6)" ]; then # test if not already in
7070
tar zxf "$TRAL_EXT_SOFTWARE/phobos-v3.3.12-linux.tar.gz" -C "$TRAL_EXT_SOFTWARE"
7171
rm -rf "$TRAL_EXT_SOFTWARE/phobos-v3.3.12-linux.tar.gz"
7272
cp "$TRAL_EXT_SOFTWARE/phobos-v3.3.12-linux/bin/phobos_64_libstdc++6" "$INSTALLATION_PATH" # copies binaries to system path $INSTALLATION_PATH/
73-
if [ ! -h "$INSTALLATION_PATH/phobos" ]; then
73+
if [ ! -h "$INSTALLATION_PATH/phobos" ]; then
7474
ln -s "$INSTALLATION_PATH/phobos_64_libstdc++6" "$INSTALLATION_PATH/phobos" # create symlink to executable file
7575
fi
7676
} || {
7777
echo -e "Something went wrong with downloading or installing phobos."
78-
exit $?
78+
exit 1
7979
}
8080
echo -e "\nPHOBOS binaries are now in the user path $INSTALLATION_PATH"
8181
;;
@@ -85,10 +85,10 @@ if [ ! -x "$(command -v phobos_64_libstdc++6)" ]; then # test if not already in
8585
esac
8686
;;
8787
esac
88-
88+
8989
else
9090
echo "PHOBOS already installed." && exit 0
91-
91+
9292
fi
9393

9494

@@ -102,5 +102,3 @@ fi
102102
# rm -rf "$TRAL_EXT_SOFTWARE/phobos_64_libstdc++6"
103103
# rm -rf "$INSTALLATION_PATH/phobos_64_libstdc++6"
104104
# rm -rf "$INSTALLATION_PATH/phobos"
105-
106-

0 commit comments

Comments
 (0)