Skip to content

Commit f24bca5

Browse files
authored
Update ChibiOS-Contrib, mirroring script. (#13896)
1 parent 538d9d7 commit f24bca5

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

lib/chibios-contrib

Submodule chibios-contrib updated 43 files

util/update_chibios_mirror.sh

+37-9
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
################################
44
# Configuration
55

6-
# The branches to mirror
7-
branches="trunk stable_20.3.x stable_21.6.x"
6+
# The ChibiOS branches to mirror
7+
chibios_branches="trunk stable_20.3.x stable_21.6.x"
88

9-
# The tags to mirror
10-
tags="ver19.1.3 ver20.3.1 ver20.3.2 ver20.3.3 ver21.6.0"
9+
# The ChibiOS tags to mirror
10+
chibios_tags="ver20.3.1 ver20.3.2 ver20.3.3 ver21.6.0"
11+
12+
# The ChibiOS-Contrib branches to mirror
13+
contrib_branches="master chibios-20.3.x"
1114

1215
################################
1316
# Actions
@@ -19,9 +22,12 @@ this_script="$(realpath "${BASH_SOURCE[0]}")"
1922
script_dir="$(realpath "$(dirname "$this_script")")"
2023
qmk_firmware_dir="$(realpath "$script_dir/../")"
2124
chibios_dir="$qmk_firmware_dir/lib/chibios"
25+
contrib_dir="$qmk_firmware_dir/lib/chibios-contrib"
2226

2327
chibios_git_location=$(realpath "$chibios_dir/$(cat "$chibios_dir/.git" | awk '/gitdir:/ {print $2}')")
2428
chibios_git_config=$(realpath "$chibios_git_location/config")
29+
contrib_git_location=$(realpath "$contrib_dir/$(cat "$contrib_dir/.git" | awk '/gitdir:/ {print $2}')")
30+
contrib_git_config=$(realpath "$contrib_git_location/config")
2531

2632
cd "$chibios_dir"
2733

@@ -40,16 +46,38 @@ git fetch --all --tags --prune
4046
echo "Fetching latest from subversion..."
4147
git svn fetch
4248

43-
echo "Updating branches..."
44-
for branch in $branches ; do
49+
echo "Updating ChibiOS branches..."
50+
for branch in $chibios_branches ; do
4551
echo "Creating branch 'svn-mirror/$branch' from 'svn/$branch'..."
4652
git branch -f svn-mirror/$branch svn/$branch \
4753
&& git push qmk svn-mirror/$branch
4854
done
4955

50-
echo "Updating tags..."
51-
for tagname in $tags ; do
56+
echo "Updating ChibiOS tags..."
57+
for tagname in $chibios_tags ; do
5258
echo "Creating tag 'svn-mirror/$tagname' from 'svn/tags/$tagname'..."
5359
GIT_COMMITTER_DATE="$(git log -n1 --pretty=format:'%ad' svn/tags/$tagname)" git tag -f -a -m "Tagging $tagname" svn-mirror/$tagname svn/tags/$tagname
5460
git push qmk svn-mirror/$tagname
55-
done
61+
done
62+
63+
cd "$contrib_dir"
64+
65+
if [[ -z "$(cat "$contrib_git_config" | grep '\[remote "qmk"\]')" ]] ; then
66+
git remote add qmk git@github.com:qmk/ChibiOS-Contrib.git
67+
git remote set-url qmk git@github.com:qmk/ChibiOS-Contrib.git --push
68+
fi
69+
70+
if [[ -z "$(cat "$contrib_git_config" | grep '\[remote "upstream"\]')" ]] ; then
71+
git remote add upstream git@github.com:ChibiOS/ChibiOS-Contrib.git
72+
git remote set-url upstream git@github.com:ChibiOS/ChibiOS-Contrib.git --push
73+
fi
74+
75+
echo "Updating remotes..."
76+
git fetch --all --tags --prune
77+
78+
echo "Updating ChibiOS-Contrib branches..."
79+
for branch in $contrib_branches ; do
80+
echo "Creating branch 'mirror/$branch' from 'upstream/$branch'..."
81+
git branch -f mirror/$branch upstream/$branch \
82+
&& git push qmk mirror/$branch
83+
done

0 commit comments

Comments
 (0)