Skip to content

Commit 804938b

Browse files
committed
use similar path, reduce checks
1 parent edca7f8 commit 804938b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

install-clara

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@ do
8888
esac
8989
done
9090

91-
# Check requested installation path:
91+
# Check installation path:
9292
clara_home="$args"
93-
[ "${#args[@]}" -lt 1 ] && error "Missing PATH argument"
93+
[ "${#args[@]}" -lt 1 ] && error "Missing PATH argument."
9494
[ "${#args[@]}" -gt 1 ] && error "Extra PATH arguments: ${args[@]:1}"
9595
[ -e "$clara_home" ] && error "Installation PATH already exists: $clara_home"
9696
mkdir -p $clara_home || error "Cannot create installation PATH: $clara_home"
9797
clara_home=$(cd $clara_home && pwd) && rmdir $clara_home
98+
echo -e "\nConfigured for a CLARA_HOME installation at:\n\t$clara_home"
9899

99100
# Detect local COATJAVA installation and convert into an absolute path:
100101
if compgen -G "$coatjava/lib/clas/coat-libs-*.jar" > /dev/null
@@ -103,12 +104,11 @@ then
103104
echo -e "\nUsing local COATJAVA installation:\n\t$coatjava"
104105
elif ! [[ "$coatjava" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)t?$ ]] # must be semver, or semver+"t"
105106
then
106-
echo -e "\n\nWARNING: COATJAVA doesn't look like a local installation nor version number: $coatjava"
107+
echo -e "\nWARNING: COATJAVA doesn't look like a local installation nor version number: $coatjava"
107108
fi
108109

109110
# Do everything inside a new, temporary directory:
110-
[ -w "." ] || error "Current working directory is not writeable: \$PWD=$PWD"
111-
tmp_dir=$(mktemp -d tmp.install-clara.XXXXXX)
111+
tmp_dir=$(mktemp -d $clara_home.tmp.XXXXXX)
112112
[ $? -ne 0 ] && error "Cannot create temporary directory: $tmp_dir"
113113
tmp_dir=$(cd $tmp_dir && pwd)
114114
echo -e "\nCreating temporary build directory:\n\t$tmp_dir"
@@ -127,16 +127,15 @@ fi
127127
# COATJAVA:
128128
if ! compgen -G "$coatjava/lib/clas/coat-libs-*.jar" > /dev/null
129129
then
130-
echo -e "\nRetrieving COATJAVA version $coatjava ..."
130+
echo -e "\nRetrieving COATJAVA/$coatjava ..."
131131
get https://clasweb.jlab.org/clas12offline/distribution/coatjava/coatjava-$coatjava.tar.gz
132132
coatjava=./coatjava
133133
fi
134134
mkdir -p clara-cre/plugins/clas12/config
135135
cp -Lr $coatjava/etc $coatjava/bin $coatjava/lib* clara-cre/plugins/clas12
136136

137137
# GRAPES:
138-
echo -e "\nRetrieving GRAPES version $grapes ..."
138+
echo -e "\nRetrieving GRAPES/$grapes ..."
139139
get https://clasweb.jlab.org/clas12offline/distribution/grapes/grapes-$grapes.tar.gz
140140
mv grapes-$grapes clara-cre/plugins/grapes
141141
mv -f clara-cre/plugins/grapes/bin/clara-grapes clara-cre/bin/
142-

0 commit comments

Comments
 (0)