-
Notifications
You must be signed in to change notification settings - Fork 4
/
update_cutest
executable file
·46 lines (40 loc) · 1.17 KB
/
update_cutest
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
#!/bin/bash
helpmsg() {
echo 'This script fetches source code updates (if any) and rebuilds'
echo 'the architectures supplied as arguments. If no architecture'
echo 'is passed as argument, $MYARCH is rebuilt. If no architecture'
echo 'should be rebuilt, the single argument 'none' should be passed.'
}
if [[ ! -e ./install_cutest ]]; then
echo 'Error: This script must be run from the top-level CUTEst directory.'
exit 1
fi
. ./bin/cutest_envcheck
[[ $? != 0 ]] && exit $?
. $ARCHDEFS/bin/helper_functions
to_rebuild="$@"
if (( $# == 0 )); then
[[ ! -z "$MYARCH" ]] && to_rebuild="$MYARCH"
fi
if (( $# == 1 )); then
if [[ "$1" == '-h' || "$1" == '--help' ]]; then
helpmsg
exit 1
fi
[[ "$1" == 'none' ]] && to_rebuild=''
fi
cd $CUTEST
message "Fetching updates (if any)"
svn update >/dev/null 2>&1
cd src
fails=0
for version in $to_rebuild
do
message "Rebuilding version $version"
make -s -f $CUTEST/makefiles/$version
if [[ $? != 0 ]]; then
(( fails++ ))
error "Compilation error for version $version"
fi
done
(( $fails > 0 )) && error "$fails failures." || success "All requested versions rebuilt."