Skip to content

Commit 39797a9

Browse files
committed
Change ubuntu_install_script.sh to add the path without clobbering existing path. Also move this definition to /etc/profile.d/.
1 parent 11d2ec5 commit 39797a9

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

bin/ubuntu_install_script.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1+
echo "Super user authentication required to add packages (you will be \
2+
prompted for confirmation)."
13
sudo bash install-ubuntu-packages.sh
24
bash install-fftw.sh
35
bash install-sundials-2.5.sh
46
sudo pip install cython --upgrade
5-
cd ..
7+
pushd .. > /dev/null
68
make
7-
echo "export PYTHONPATH=$(dirname $PWD):$PYTHONPATH" >> $HOME/.bashrc
9+
10+
# Adds Fidimag environment variables to profile.d, if they're not already
11+
# there.
12+
FIDIMAG_PROFILE_PATH=/etc/profile.d/fidimag.sh
13+
if [ ! -e "$FIDIMAG_PROFILE_PATH" ]; then
14+
echo "Super user authentication required to add paths."
15+
sudo mkdir --parents "$(dirname $FIDIMAG_PROFILE_PATH)"
16+
sudo bash -c "echo \"export PYTHONPATH=$PWD/:\\\$PYTHONPATH\"\
17+
> $FIDIMAG_PROFILE_PATH"
18+
sudo bash -c "echo \"export LD_LIBRARY_PATH=$PWD/local/lib:\
19+
\\\$LD_LIBRARY_PATH\" >> $FIDIMAG_PROFILE_PATH"
20+
sudo chmod 0644 "$FIDIMAG_PROFILE_PATH"
21+
echo "Path written to $FIDIMAG_PROFILE_PATH."
22+
else
23+
echo "Path added previously. Skipping."
24+
fi

0 commit comments

Comments
 (0)