|
@@ -30,24 +30,37 @@ echo "This script downloads all Configurations and builds Marlin with each one."
|
30
|
30
|
echo "On failure the last-built configs will be left in your working copy."
|
31
|
31
|
echo "Restore your configs with 'git checkout -f' or 'git reset --hard HEAD'."
|
32
|
32
|
|
|
33
|
+unset BRANCH
|
|
34
|
+unset FIRST_CONF
|
|
35
|
+if [[ -f "$STAT_FILE" ]]; then
|
|
36
|
+ IFS='*' read BRANCH FIRST_CONF <"$STAT_FILE"
|
|
37
|
+fi
|
|
38
|
+
|
33
|
39
|
# If -c is given start from the last attempted build
|
34
|
40
|
if [[ $1 == '-c' ]]; then
|
35
|
|
- if [[ -f "$STAT_FILE" ]]; then
|
36
|
|
- read BRANCH FIRST_CONF <"$STAT_FILE"
|
37
|
|
- else
|
|
41
|
+ if [[ -z $BRANCH || -z $FIRST_CONF ]]; then
|
38
|
42
|
echo "Nothing to continue"
|
39
|
43
|
exit
|
40
|
44
|
fi
|
|
45
|
+elif [[ $1 == '-s' ]]; then
|
|
46
|
+ if [[ -n $BRANCH && -n $FIRST_CONF ]]; then
|
|
47
|
+ SKIP_CONF=1
|
|
48
|
+ else
|
|
49
|
+ echo "Nothing to skip"
|
|
50
|
+ exit
|
|
51
|
+ fi
|
41
|
52
|
else
|
42
|
53
|
BRANCH=${1:-"import-2.0.x"}
|
43
|
54
|
FIRST_CONF=$2
|
44
|
55
|
fi
|
45
|
56
|
|
46
|
57
|
# Check if the current repository has unmerged changes
|
47
|
|
-if [[ -z "$FIRST_CONF" ]]; then
|
48
|
|
- git diff --quiet || { echo "The working copy is modified. Commit or stash changes before proceeding."; exit ; }
|
49
|
|
-else
|
|
58
|
+if [[ $SKIP_CONF ]]; then
|
|
59
|
+ echo "Skipping $FIRST_CONF"
|
|
60
|
+elif [[ $FIRST_CONF ]]; then
|
50
|
61
|
echo "Resuming from $FIRST_CONF"
|
|
62
|
+else
|
|
63
|
+ git diff --quiet || { echo "The working copy is modified. Commit or stash changes before proceeding."; exit ; }
|
51
|
64
|
fi
|
52
|
65
|
|
53
|
66
|
# Create a temporary folder inside .pio
|
|
@@ -67,12 +80,19 @@ shopt -s nullglob
|
67
|
80
|
IFS='
|
68
|
81
|
'
|
69
|
82
|
CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/config/examples/*/*/*/ "$TMP"/config/examples/*/*/*/*/ | grep -vE ".+\.(\w+)$" )
|
|
83
|
+DOSKIP=0
|
70
|
84
|
for CONF in $CONF_TREE ; do
|
|
85
|
+ # Get a config's directory name
|
71
|
86
|
DIR=$( echo $CONF | sed "s|$TMP/config/examples/||" )
|
72
|
|
- [[ ! -z $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue
|
|
87
|
+ # If looking for a config, skip others
|
|
88
|
+ [[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue
|
|
89
|
+ # Once found, stop looking
|
73
|
90
|
unset FIRST_CONF
|
|
91
|
+ # If skipping, don't build the found one
|
|
92
|
+ [[ $SKIP_CONF ]] && { unset SKIP_CONF ; continue ; }
|
|
93
|
+ # ...if skipping, don't build this one
|
74
|
94
|
compgen -G "${CONF}Con*.h" > /dev/null || continue
|
75
|
|
- echo -e "$BRANCH\n$DIR" >"$STAT_FILE"
|
|
95
|
+ echo "${BRANCH}*${DIR}" >"$STAT_FILE"
|
76
|
96
|
"$HERE/build_example" "internal" "$TMP" "$DIR" || { echo "Failed to build $DIR"; exit ; }
|
77
|
97
|
done
|
78
|
98
|
|