From 59f9242e0ce4e8739f967ec2364e20ec939bf8dd Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 15 Jan 2025 09:45:59 +0900 Subject: [PATCH] Update from upstream script updated --- update_from_upstream.sh | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/update_from_upstream.sh b/update_from_upstream.sh index 5b6a7fe..6ed53be 100755 --- a/update_from_upstream.sh +++ b/update_from_upstream.sh @@ -1,4 +1,32 @@ #!/bin/bash -git fetch https://github.com/flathub/net.rpcs3.RPCS3 master # Fetch the latest changes from the remote master branch -git merge FETCH_HEAD # Merge the fetched changes into your current branch \ No newline at end of file +target_branch="master" +update_submodules="true" + +# Get the repository name +repo_url=$(git remote get-url origin) +repo_name=$(basename -s .git "$repo_url") + +echo "Fetching https://github.com/flathub/$repo_name $target_branch" +if [ "$update_submodules" = "true" ]; then + echo "And updating submodules also" +fi +echo "" + +# Fetch the latest changes from the remote master branch +git fetch https://github.com/flathub/"$repo_name" "$target_branch" + +# Merge the fetched changes into your current branch +git merge FETCH_HEAD + +if [ "$update_submodules" = "true" ]; then + # Update submodules to the versions specified in the repo + git submodule update --init --recursive + + # Update submodules to the versions specified in the fetched repo + git submodule update --remote + git add shared-modules + git commit -m "Update shared modules" +fi + +