-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstep_1_get_latest_sources.sh
executable file
·61 lines (53 loc) · 1.74 KB
/
step_1_get_latest_sources.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
#!/bin/sh
r_1 () {
echo ""
}
verify_cleanup() {
# Make sure cleanup went as expected
if [ -d $DIRECTORY ]; then
echo "#-------------------------------------------------------------------#"
echo "Clean Failed"
echo "#-------------------------------------------------------------------#"
exit 5
else
echo "#-------------------------------------------------------------------#"
echo "Cleanup complete."
echo "#-------------------------------------------------------------------#"
fi
}
DIRECTORY="wolfssl"
echo "#===================================================================#"
echo " Step 1: Begin"
echo "#===================================================================#"
r_1
if [ -d $DIRECTORY ]; then
echo "#-------------------------------------------------------------------#"
echo "Debris left over from previous release..."
echo "Cleaning up old libraries..."
echo "#-------------------------------------------------------------------#"
rm -rf $DIRECTORY
verify_cleanup
fi
git clone https://github.com/wolfssl/wolfssl.git $DIRECTORY
RESULT=$?
# test that git clone returned a 0 for success
if [ $RESULT != 0 ]; then
echo "#===================================================================#"
echo "Step 1: FAILED"
echo "#===================================================================#"
# if git clone got some of the files but not all cleanup
if [ -d $DIRECTORY ]; then
rm -rf $DIRECTORY
fi
r_1
exit 5
else
echo "#===================================================================#"
echo "Step 1: SUCCESS"
echo "#===================================================================#"
fi
r_1
r_1
r_1
r_1
exit 0