Skip to content

Commit 266fc18

Browse files
authored
Update update-components.sh
1 parent ad3daeb commit 266fc18

File tree

1 file changed

+49
-11
lines changed

1 file changed

+49
-11
lines changed

tools/update-components.sh

+49-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
source ./tools/config.sh
44

5-
CAMERA_REPO_URL="https://github.com/tasmota/esp32-camera.git"
5+
CAMERA_REPO_URL="https://github.com/espressif/esp32-camera.git"
6+
DL_REPO_URL="https://github.com/espressif/esp-dl.git"
7+
SR_REPO_URL="https://github.com/espressif/esp-sr.git"
68
DSP_REPO_URL="https://github.com/espressif/esp-dsp.git"
79
LITTLEFS_REPO_URL="https://github.com/joltwallet/esp_littlefs.git"
810
TINYUSB_REPO_URL="https://github.com/hathach/tinyusb.git"
@@ -16,19 +18,31 @@ if [ ! -d "$AR_COMPS/arduino" ]; then
1618
fi
1719

1820
if [ -z $AR_BRANCH ]; then
19-
has_ar_branch=`git_branch_exists "$AR_COMPS/arduino" "idf-$IDF_BRANCH"`
20-
if [ "$has_ar_branch" == "1" ]; then
21-
export AR_BRANCH="idf-$IDF_BRANCH"
21+
if [ -z $GITHUB_HEAD_REF ]; then
22+
current_branch=`git branch --show-current`
2223
else
23-
has_ar_branch=`git_branch_exists "$AR_COMPS/arduino" "$AR_PR_TARGET_BRANCH"`
24+
current_branch="$GITHUB_HEAD_REF"
25+
fi
26+
echo "Current Branch: $current_branch"
27+
if [[ "$current_branch" != "master" && `git_branch_exists "$AR_COMPS/arduino" "$current_branch"` == "1" ]]; then
28+
export AR_BRANCH="$current_branch"
29+
else
30+
has_ar_branch=`git_branch_exists "$AR_COMPS/arduino" "idf-$IDF_BRANCH"`
2431
if [ "$has_ar_branch" == "1" ]; then
25-
export AR_BRANCH="$AR_PR_TARGET_BRANCH"
32+
export AR_BRANCH="idf-$IDF_BRANCH"
33+
else
34+
has_ar_branch=`git_branch_exists "$AR_COMPS/arduino" "$AR_PR_TARGET_BRANCH"`
35+
if [ "$has_ar_branch" == "1" ]; then
36+
export AR_BRANCH="$AR_PR_TARGET_BRANCH"
37+
fi
2638
fi
2739
fi
2840
fi
2941

3042
if [ "$AR_BRANCH" ]; then
31-
git -C "$AR_COMPS/arduino" checkout "$AR_BRANCH"
43+
git -C "$AR_COMPS/arduino" checkout "$AR_BRANCH" && \
44+
git -C "$AR_COMPS/arduino" fetch && \
45+
git -C "$AR_COMPS/arduino" pull --ff-only
3246
fi
3347
if [ $? -ne 0 ]; then exit 1; fi
3448

@@ -48,6 +62,30 @@ if [ -f "$AR_COMPS/esp32-camera/idf_component.yml" ]; then
4862
fi
4963
if [ $? -ne 0 ]; then exit 1; fi
5064

65+
#
66+
# CLONE/UPDATE ESP-DL
67+
#
68+
69+
#if [ ! -d "$AR_COMPS/esp-dl" ]; then
70+
# git clone $DL_REPO_URL "$AR_COMPS/esp-dl"
71+
#else
72+
# git -C "$AR_COMPS/esp-dl" fetch && \
73+
# git -C "$AR_COMPS/esp-dl" pull --ff-only
74+
#fi
75+
#if [ $? -ne 0 ]; then exit 1; fi
76+
77+
#
78+
# CLONE/UPDATE ESP-SR
79+
#
80+
81+
#if [ ! -d "$AR_COMPS/esp-sr" ]; then
82+
# git clone $SR_REPO_URL "$AR_COMPS/esp-sr"
83+
#else
84+
# git -C "$AR_COMPS/esp-sr" fetch && \
85+
# git -C "$AR_COMPS/esp-sr" pull --ff-only
86+
#fi
87+
#if [ $? -ne 0 ]; then exit 1; fi
88+
5189
#
5290
# CLONE/UPDATE ESP-LITTLEFS
5391
#
@@ -68,10 +106,10 @@ if [ $? -ne 0 ]; then exit 1; fi
68106

69107
if [ ! -d "$AR_COMPS/esp-dsp" ]; then
70108
git clone $DSP_REPO_URL "$AR_COMPS/esp-dsp"
71-
cml=`cat "$AR_COMPS/esp-dsp/CMakeLists.txt"`
72-
echo "if(IDF_TARGET STREQUAL \"esp32\" OR IDF_TARGET STREQUAL \"esp32s2\" OR IDF_TARGET STREQUAL \"esp32s3\")" > "$AR_COMPS/esp-dsp/CMakeLists.txt"
73-
echo "$cml" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
74-
echo "endif()" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
109+
# cml=`cat "$AR_COMPS/esp-dsp/CMakeLists.txt"`
110+
# echo "if(IDF_TARGET STREQUAL \"esp32\" OR IDF_TARGET STREQUAL \"esp32s2\" OR IDF_TARGET STREQUAL \"esp32s3\")" > "$AR_COMPS/esp-dsp/CMakeLists.txt"
111+
# echo "$cml" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
112+
# echo "endif()" >> "$AR_COMPS/esp-dsp/CMakeLists.txt"
75113
else
76114
git -C "$AR_COMPS/esp-dsp" fetch && \
77115
git -C "$AR_COMPS/esp-dsp" pull --ff-only

0 commit comments

Comments
 (0)