-
Notifications
You must be signed in to change notification settings - Fork 3
/
update_sifdecode
executable file
·39 lines (34 loc) · 1.01 KB
/
update_sifdecode
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
#!/usr/bin/env 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.'
}
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
. $SIFDECODE/bin/sifdecode_envcheck
cd $SIFDECODE
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 $SIFDECODE/makefiles/$version
if [[ $? != 0 ]]; then
(( fails++ ))
error "Compilation error for version $version"
fi
done
(( $fails > 0 )) && error "$fails failures." || success "All requested versions rebuilt."