merge_upstream.sh --checkout: re-apply our patches

This commit is contained in:
SpiritCroc 2024-05-05 09:19:54 +02:00
parent b353040947
commit f67822feab
2 changed files with 37 additions and 5 deletions

View File

@ -249,3 +249,22 @@ get_current_mxsdk_tags() {
current_mxreactsdk_tag="v$(cat "$SCHILDI_ROOT/element-web/package.json" | jq '.dependencies["matrix-react-sdk"]' -r)"
current_mxjssdk_tag="v$(cat "$SCHILDI_ROOT/element-web/package.json" | jq '.dependencies["matrix-js-sdk"]' -r)"
}
apply_patches() {
local repo="$(realpath "$1")"
local patch_dir="$SCHILDI_ROOT/patches/$(basename "$1")"
if [ ! -d "$repo" ]; then
echo "Unknown repo: $repo"
return 1
fi
if [ ! -d "$patch_dir" ]; then
echo "No patches found at $patch_dir"
return 1
fi
pushd "$repo"
for patch in "$patch_dir"/*; do
echo "Applying $patch to $repo..."
git am "$patch" || read -p "Applying $patch failed, please commit manually, then press enter: "
done
popd
}

View File

@ -15,12 +15,18 @@ pushd "$mydir" > /dev/null
source ./merge_helpers.sh
# Check branch
check_branch $branch
forall_repos check_branch $branch
if [ "$git_action" = "checkout" ]; then
# Abandon all local submodule state
forall_repos git reset --hard
git submodule update -f --recursive
else
# Check branch
check_branch $branch
forall_repos check_branch $branch
# Ensure clean git state
forall_repos check_clean_git
# Ensure clean git state
forall_repos check_clean_git
fi
# Fetch upstream
forall_repos git fetch upstream
@ -55,6 +61,13 @@ popd > /dev/null
make clean
make setup
# Apply our patches
if [ "$git_action" = "checkout" ]; then
#apply_patches matrix-react-sdk
#apply_patches element-web
apply_patches element-desktop
fi
# Automatic adjustments
#automatic_i18n_adjustment
automatic_packagejson_adjustment