[Android] buildsystem: add --reset flag to compile-remoteaccess.sh to force git reset
Nicolas Pomepuy
git at videolan.org
Tue Nov 3 10:49:50 UTC 2026
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Nov 2 14:27:22 2026 +0100| [436160870128792553790133755db82307fe5fd6] | committer: Nicolas Pomepuy
buildsystem: add --reset flag to compile-remoteaccess.sh to force git reset
> https://code.videolan.org/videolan/vlc-android/commit/436160870128792553790133755db82307fe5fd6
---
buildsystem/compile-remoteaccess.sh | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/buildsystem/compile-remoteaccess.sh b/buildsystem/compile-remoteaccess.sh
index 7f467ccf60..0fb2ccc107 100755
--- a/buildsystem/compile-remoteaccess.sh
+++ b/buildsystem/compile-remoteaccess.sh
@@ -41,12 +41,14 @@ fail()
}
USE_MAIN=0
+RESET=0
while [ $# -gt 0 ]; do
case $1 in
help|--help|-h)
echo "Use --init to only clone/pull without building"
echo "Use --main or -m to build using the main branch"
+ echo "Use --reset or -r to reset code from git"
exit 0
;;
--init)
@@ -55,6 +57,9 @@ while [ $# -gt 0 ]; do
--main|-m)
USE_MAIN=1
;;
+ --reset|-r)
+ RESET=1
+ ;;
*)
diagnostic "$0: Invalid option '$1'."
diagnostic "$0: Try --help for more information."
@@ -99,17 +104,18 @@ if [ ! -d "$VLC_REMOTE_ACCESS_PATH" ] || [ ! -d "$VLC_REMOTE_ACCESS_PATH/.git" ]
git reset --hard ${REMOTE_ACCESS_TESTED_HASH} || fail "Remote access sources: REMOTE_ACCESS_TESTED_HASH ${REMOTE_ACCESS_TESTED_HASH} not found"
fi
cd "$CURRENT_DIR"
-else
- diagnostic "Remote access sources: found in $VLC_REMOTE_ACCESS_PATH"
+elif [ "$RESET" = 1 ]; then
+ diagnostic "Remote access sources: resetting $VLC_REMOTE_ACCESS_PATH"
cd "$VLC_REMOTE_ACCESS_PATH"
+ git fetch origin ${branch}:refs/remotes/origin/${branch}
if [ "$USE_MAIN" = 1 ]; then
- git fetch origin ${branch}:refs/remotes/origin/${branch}
git checkout -B ${branch} origin/${branch}
- elif [ "$(git rev-parse HEAD 2>/dev/null)" != "$REMOTE_ACCESS_TESTED_HASH" ]; then
- git fetch origin ${branch}:refs/remotes/origin/${branch}
+ else
git checkout -B ${branch} ${REMOTE_ACCESS_TESTED_HASH} || fail "Remote access sources: REMOTE_ACCESS_TESTED_HASH ${REMOTE_ACCESS_TESTED_HASH} not found"
fi
cd "$CURRENT_DIR"
+else
+ diagnostic "Remote access sources: found in $VLC_REMOTE_ACCESS_PATH"
fi
if [ "$INIT_ONLY" != 1 ]; then
More information about the Android
mailing list