blob: 7d3ba9a28aa3273586cd652ae09ee6da4afe0836 (
plain)
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
#!/bin/sh
set -x
date
#
# This script should be run nightly from cron. It checks out hdf5
# from the CVS source tree and compares it against the previous
# snapshot. If anything significant changed then a new snapshot is
# created, the minor version number is incremented, and the change is
# checked back into the CVS repository.
#
# The path isn't properly initialized on hawkwind -- /usr/local/bin is
# either missing or is after /usr/bin when it should be before.
PATH="/usr/local/bin:$PATH"
# Where are the snapshots stored?
ARCHIVES_default=/afs/ncsa/ftp/HDF/pub/outgoing/hdf5/snapshots
ARCHIVES=$ARCHIVES_default
# Where are the HDF4 library?
# At NCSA, the standard place to find HDF4 software is in /usr/ncsa/.
HDF4LIB_default="/usr/ncsa/include,/usr/ncsa/lib"
HDF4LIB="--with-hdf4=$HDF4LIB_default"
# What compression methods to use?
METHODS="gzip bzip2"
# Make sure cvs would work
if [ -z "$CVSROOT" ]; then
echo "Where is the CVS repository?" 1>&2
exit 1
fi
#
# Command options
cmd="all"
errcode=0
echo '$#=' $# '$*="' $* '"'
while [ $# -gt 0 ] ; do
case "$1" in
all)
cmd="all"
;;
test)
cmdtest="test"
cmd=""
;;
release)
cmdrel="release"
cmd=""
;;
help)
cmd="help"
break
;;
hdf4)
shift
if [ $# -lt 1 ]; then
echo "HDF4LIB information missing"
errcode=1
cmd="help"
break
fi
# an empty $1 resets HDF4LIB to "", disabling hdf4lib usage
HDF4LIB="$1"
HDF4LIB=${HDF4LIB:+"--with-hdf4="$HDF4LIB}
;;
archive)
shift
if [ $# -lt 1 ]; then
echo "Archive pathname missing"
errcode=1
cmd="help"
break
fi
ARCHIVES="$1"
;;
*)
echo "Unkown option $1"
errcode=1
cmd="help"
break
;;
esac
shift
done
if [ "$cmd" = help ]; then
set -
echo "Usage: $0 [all] [test] [release] [help] [hdf4 <hdf4lib_path>] [archive <arch_path> ]"
echo " all: Run all commands (test & release)"
echo " [Default is all]"
echo " test: Run test"
echo " release: Run release"
echo " help: Print this message"
echo " hdf4 <hdf4lib_path>:"
echo " Use <hdf4lib_path> as the HDF4LIB locations"
echo " [Default is $HDF4LIB_default]"
echo " archive <arch_path>: "
echo " Use <arch_path> as the release ARCHIVE area"
echo " [<arch_path> default as $ARCHIVES_default]"
exit $errcode
fi
# Execute the requests
snapshot=yes
#
# Test the HDF5 library
if [ -n "$cmd" -o -n "$cmdtest" ]; then
CONFIGURE="./configure $HDF4LIB"
# Create a working directory. Hopefully one is left over from last
# time that still has the contents of the previous release. But if
# not, just create one and assume that a snapshot is necessary.
COMPARE=${HOME}/hdf5-snapshots
test -d ${COMPARE} || mkdir -p ${COMPARE} || exit 1
# Check out the current version from CVS
cvs -Q co -d ${COMPARE}/current hdf5 || exit 1
# Compare it with the previous version. Compare only files listed in
# the MANIFEST plus the MANIFEST itself.
if [ -d ${COMPARE}/previous ]; then
if (diff -c ${COMPARE}/previous/MANIFEST ${COMPARE}/current/MANIFEST); then
snapshot=no
for src in `grep '^\.' ${COMPARE}/current/MANIFEST|expand|cut -f1 -d' '`; do
diff -I H5_VERS_RELEASE -I " released on " \
-I " currently under development" \
${COMPARE}/previous/$src ${COMPARE}/current/$src || \
snapshot=yes
# Don't break because we want to see all the diffs.
done
fi
fi
# Make sure all the serial tests work.
if [ "$snapshot" = "yes" ]; then
if (cd ${COMPARE}/current; \
${CONFIGURE}; \
make _test); then
:
else
snapshot=no
fi
(cd ${COMPARE}/current; make distclean)
fi
fi # Test the HDF5 library
#
# Release snapshot, update version, and commit to cvs and tag
# Turn on exit on error in the sub-shell so that it does not
# cvs commit if errors encounter here.
if [ -n "$cmd" -o -n "$cmdrel" ]; then
if [ "$snapshot" = "yes" ]; then
(
set -e
cd ${COMPARE}/current
cvs -Q tag hdf5-`perl -w bin/h5vers |tr . _`
bin/release -d $ARCHIVES $METHODS
RELEASE_VERSION="`perl -w bin/h5vers -v`"
perl -w bin/h5vers -i
cvs -Q commit -m "Snapshot $RELEASE_VERSION"
)
fi
# Replace the previous version with the current version.
rm -rf ${COMPARE}/previous
mv ${COMPARE}/current ${COMPARE}/previous
fi #Release snapshot
exit 0
|