[Android] Compile: add reset option

Duncan McNamara git at videolan.org
Wed Sep 1 12:02:28 UTC 2021


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Fri Aug 13 10:43:08 2021 +0200| [32f9d8bc13aaa68074a2a7722092322b88bd6423] | committer: Nicolas Pomepuy

Compile: add reset option

Resets the submodules medialibrary and vlc to the tested hash

> https://code.videolan.org/videolan/vlc-android/commit/32f9d8bc13aaa68074a2a7722092322b88bd6423
---

 buildsystem/compile-medialibrary.sh |  7 +++++++
 buildsystem/compile.sh              | 11 +++++++++++
 2 files changed, 18 insertions(+)

diff --git a/buildsystem/compile-medialibrary.sh b/buildsystem/compile-medialibrary.sh
index fee4de9d0..3fd0aed6e 100755
--- a/buildsystem/compile-medialibrary.sh
+++ b/buildsystem/compile-medialibrary.sh
@@ -103,6 +103,13 @@ if [ ! -d "${MEDIALIBRARY_MODULE_DIR}/medialibrary" ]; then
   # TODO: remove when switching to VLC 4.0
   cd libvlcpp
   git am ${SRC_DIR}/buildsystem/patches/libvlcpp/*
+elif [ $RESET -eq 1 ]; then
+    cd ${SRC_DIR}/medialibrary/medialibrary
+    git reset --hard ${MEDIALIBRARY_HASH}
+    git submodule update --init libvlcpp
+    # TODO: remove when switching to VLC 4.0
+    cd libvlcpp
+    git am ${SRC_DIR}/buildsystem/patches/libvlcpp/*
 else
   cd ${MEDIALIBRARY_MODULE_DIR}/medialibrary
   if ! git cat-file -e ${MEDIALIBRARY_HASH}; then
diff --git a/buildsystem/compile.sh b/buildsystem/compile.sh
index be42b91e1..f7cce1ee2 100755
--- a/buildsystem/compile.sh
+++ b/buildsystem/compile.sh
@@ -102,6 +102,9 @@ while [ $# -gt 0 ]; do
         stub)
             STUB=1
             ;;
+        --reset)
+            RESET=1
+            ;;
         --no-ml)
             NO_ML=1
             ;;
@@ -297,6 +300,14 @@ else
 fi
 if [ "$BYPASS_VLC_SRC_CHECKS" = 1 ]; then
     diagnostic "VLC sources: Bypassing checks (required by option)"
+elif [ $RESET -eq 1 ]; then
+    cd vlc
+    git reset --hard ${TESTED_HASH} || fail "VLC sources: TESTED_HASH ${TESTED_HASH} not found"
+    for patch_file in ../libvlc/patches/vlc3/*.patch; do
+        git am --message-id $patch_file
+        check_patch_is_applied "$patch_file"
+    done
+    cd ..
 else
     diagnostic "VLC sources: Checking TESTED_HASH and patches presence"
     diagnostic "NOTE: checks can be bypass by adding '-b' option to this script."



More information about the Android mailing list