-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathupdate-components.sh
executable file
·53 lines (50 loc) · 1.88 KB
/
update-components.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
#/bin/bash
source ./tools/config.sh
#
# CLONE/UPDATE TINYUSB
#
echo "Updating TinyUSB..."
TINYUSB_REPO_URL="https://github.com/hathach/tinyusb.git"
TINYUSB_REPO_DIR="$AR_COMPS/arduino_tinyusb/tinyusb"
if [ ! -d "$TINYUSB_REPO_DIR" ]; then
git clone "$TINYUSB_REPO_URL" "$TINYUSB_REPO_DIR"
else
git -C "$TINYUSB_REPO_DIR" fetch && \
git -C "$TINYUSB_REPO_DIR" pull --ff-only
fi
if [ $? -ne 0 ]; then exit 1; fi
echo "Updating Matter v1.3 repository..."
MATTER_REPO_URL="https://github.com/espressif/esp-matter.git"
MATTER_REPO_DIR="$AR_COMPS/espressif__esp_matter"
MATTER_REPO_BRANCH="release/v1.3"
if [ ! -d "$MATTER_REPO_DIR" ]; then
git clone --depth 1 -b "$MATTER_REPO_BRANCH" "$MATTER_REPO_URL" "$MATTER_REPO_DIR"
else
git -C "$MATTER_REPO_DIR" fetch && \
git -C "$MATTER_REPO_DIR" pull --ff-only
fi
if [ $? -ne 0 ]; then exit 1; fi
echo "Updating CHIP v1.3 repository..."
CHIP_REPO_URL="https://github.com/espressif/connectedhomeip.git"
CHIP_REPO_DIR="$MATTER_REPO_DIR/connectedhomeip/connectedhomeip"
CHIP_REPO_BRANCH="v1.3-branch"
if [ -d "$CHIP_REPO_DIR" ]; then
# Check if directory is empty
if [ -z "$(ls -A "$CHIP_REPO_DIR")" ]; then
rm -rf "$CHIP_REPO_DIR"
git clone --depth 1 -b "$CHIP_REPO_BRANCH" "$CHIP_REPO_URL" "$CHIP_REPO_DIR"
if [ $? -ne 0 ]; then exit 1; fi
$CHIP_REPO_DIR/scripts/checkout_submodules.py --platform esp32 --shallow
if [ $? -ne 0 ]; then exit 1; fi
echo "Patching CHIP v1.3 repository..."
CHIP_BAD_FILE="$CHIP_REPO_DIR/src/platform/ESP32/bluedroid/ChipDeviceScanner.cpp"
CHIP_PATCH="$AR_PATCHES/matter_chip_ChipDeviceScanner.diff"
if [ -f "$CHIP_BAD_FILE" ]; then
patch $CHIP_BAD_FILE $CHIP_PATCH
else
echo "Error: $CHIP_BAD_FILE not found. Check the script."
exit 1
fi
fi
fi
echo "Matter v1.3 component is installed and updated."