Skip to content

Commit 4103a71

Browse files
committed
Update to work from behind a firewall using the --with-packages-dir=directory option
Funded-by: IDEAS Project: xSDK Time: .3 hours
1 parent 290173d commit 4103a71

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ as well as some commonly needed external packages
4444

4545
```no-highlight
4646
--help List all the possible options (most you will never need)
47+
48+
--with-packages-dir=adirectory For use from behind a firewall, will not download needed packages but instead will direct user to download the packages to the given directory and then use those found in the directory
4749
4850
--download-mpich Useful if you do not have an MPI installed on your machine.
4951

installxSDK.sh

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
PREFIX="notset"
44
WITHGIT="git"
55
SKIPMAKE="0"
6+
PACKAGEDIR="0"
67
for i in "$@"
78
do
89
case $i in
@@ -26,6 +27,9 @@ for i in "$@"
2627
--with-git=*)
2728
WITHGIT="${i#*=}"
2829
;;
30+
--with-packages-dir=*)
31+
PACKAGEDIR="${i#*=}"
32+
;;
2933
--download-pflotran|--download-ideas)
3034
SKIPMAKE="1"
3135
;;
@@ -53,7 +57,23 @@ cd xsdk
5357
#PETSC_BRANCH='barry/downloads'
5458
# Get PETSc
5559
if [ ! -d petsc ]; then
56-
if [ "${WITHGIT}" != "0" ]; then
60+
if [ "${PACKAGEDIR}" != "0" ]; then
61+
if [ ! -f ${PACKAGEDIR}/petsc.tar.gz ]; then
62+
echo " "
63+
echo "Running in firewall mode"
64+
echo " "
65+
echo "Obtain the tarball https://bitbucket.org/petsc/petsc/get/master.tar.gz"
66+
echo "put it in the directory ${PACKAGEDIR}"
67+
echo "Do not uncompress or untar it. Then run the script again"
68+
echo " "
69+
exit
70+
else
71+
dir=`tar -tzf ${PACKAGEDIR}/petsc.tar.gz | head -1`
72+
tar zxf ${PACKAGEDIR}/petsc.tar.gz
73+
mv -f ${dir} petsc
74+
cd petsc
75+
fi
76+
elif [ "${WITHGIT}" != "0" ]; then
5777
${WITHGIT} clone https://bitbucket.org/petsc/petsc.git petsc
5878
else
5979
curl https://bitbucket.org/petsc/petsc/get/master.tar.gz > petsc.tar.gz
@@ -75,8 +95,10 @@ fi
7595
# Install the packages
7696
export PETSC_DIR=`pwd`
7797
./configure --download-xsdk $*
78-
if [ "${SKIPMAKE}" == "0" ]; then
79-
make
80-
make install
98+
if [ "$?" == "0" ]; then
99+
if [ "${SKIPMAKE}" == "0" ]; then
100+
make
101+
make install
102+
fi
81103
fi
82104

0 commit comments

Comments
 (0)