-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathhyrax_clone.sh
executable file
·117 lines (102 loc) · 2 KB
/
hyrax_clone.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
#
# Clone all of Hyrax from the OpenDAP organization page on GitHub
# This is fairly rough...
function help {
echo "Usage: $0 [options] where options are:"
echo "-h: help; this message"
echo "-v: verbose"
echo "-n: print what would be done"
echo "-D: do not get the hyrax-dependencies repo (defult is to get it)"
}
args=`getopt hvnD $*`
if [ $? != 0 ]
then
help
exit 2
fi
set -- $args
# Set verbose and do_nothing to false
verbose="";
dry_run="no"
get_deps="yes"
for i in $*
do
case "$i"
in
-h)
help
exit 0;;
-v)
verbose="--verbose"
shift;;
-n)
dry_run="yes"
shift;;
-D)
get_deps="no"
shift;;
--)
shift; break;;
esac
done
function verbose {
if test -n "$verbose"
then
echo "$*"
fi
}
function do_command {
if test "$dry_run" = "yes"
then
echo "$*"
else
# if test -n "$verbose"; then echo "$*"; fi
verbose "$*"
$*
fi
}
repo_root=https://github.com/opendap
# On CentOS the fileout_netcdf tests fail when the RPM netcdf and
# hyrax-dependencies netcdf libraries are mixed. jhrg 1/2/15
if test "$get_deps" = "yes"
then
if test ! -d hyrax-dependencies
then
do_command "git clone $repo_root/hyrax-dependencies.git $verbose"
else
(
cd hyrax-dependencies
verbose "In hyrax-dependencies..."
do_command "git pull $verbose"
)
fi
fi
libdap="libdap4"
bes_module_branch="master"
if test ! -d $libdap
then
do_command "git clone ${repo_root}/${libdap}.git $verbose"
else
(
cd $libdap
verbose "In ${libdap}..."
do_command "git pull $verbose"
)
fi
if test ! -d bes
then
do_command "git clone $repo_root/bes.git $verbose"
do_command "git checkout $bes_module_branch"
do_command "git pull $verbose"
fi
if test ! -d olfs
then
do_command "git clone $repo_root/olfs.git $verbose"
else
(
cd olfs
verbose "In olfs..."
do_command "git pull $verbose"
)
fi