[vlc-commits] [Git][videolan/vlc][master] extras: ci: fix get-contrib-sha for debian/android

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Feb 24 07:29:24 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0dffba0e by Alexandre Janniaux at 2024-02-24T06:17:55+00:00
extras: ci: fix get-contrib-sha for debian/android

Running

    ./extras/ci/get-contrib-sha.sh debian-meson

is currently failing with:

    fatal: empty string is not a valid pathspec. please use . instead if
    you meant to match all paths

because "${VLC_BUILD_TARGET}" would count for an empty parameter, as
opposed to being discarded without quotes. In some shells, like zsh, it
would also count as a parameter regardless of the presence of the
quotes.

Instead of using an intermediate variable to store an optional path,
this commit directly adds to the bash array containing the path checked
to find the contrib ancestor, allowing to both submit multiple files if
necessary, or none if unnecessary.

Regression from 4ac6168d4740b6416fa6abbff30b50b14d370ef9.

- - - - -


1 changed file:

- extras/ci/get-contrib-sha.sh


Changes:

=====================================
extras/ci/get-contrib-sha.sh
=====================================
@@ -28,37 +28,33 @@ VLC_SRC_ROOT_DIR=$(git rev-parse --show-toplevel)
 [ -n "${VLC_SRC_ROOT_DIR}" ] || abort_err "This script must be run in the VLC Git repo and git must be available"
 [ -f "${VLC_SRC_ROOT_DIR}/src/libvlc.h" ] || abort_err "This script must be run in the VLC Git repository"
 
-VLC_BUILD_TARGET="extras/package"
 case $1 in
     win32*|win64*|uwp*)
-        VLC_BUILD_TARGET="extras/package/win32"
-        ;;
-    debian*)
-        VLC_BUILD_TARGET=""
+        VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/win32" )
         ;;
     ios*|tvos*)
-        VLC_BUILD_TARGET="extras/package/apple"
+        VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/apple" )
         ;;
     macos*)
-        VLC_BUILD_TARGET="extras/package/macosx"
+        VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/macos" )
         ;;
     raspbian*)
-        VLC_BUILD_TARGET="extras/package/raspberry"
+        VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/raspberry" )
         ;;
     snap*)
-        VLC_BUILD_TARGET="extras/package/snap"
+        VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/snap" )
         ;;
     wasm*)
-        VLC_BUILD_TARGET="extras/package/wasm-emscripten"
+        VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/wasm-emscripten" )
         ;;
-    android*)
-        VLC_BUILD_TARGET=""
+    debian*|android*)
         ;;
+    *)
+        VLC_CONTRIB_REBUILD_PATHS+=( "extras/package" )
 esac
 
 VLC_LAST_CONTRIB_SHA=$(
-    cd "$VLC_SRC_ROOT_DIR" &&
-    git rev-list -1 "${VLC_START_REVISION}" -- "${VLC_CONTRIB_REBUILD_PATHS[@]}" "${VLC_BUILD_TARGET}"
+    cd "${VLC_SRC_ROOT_DIR} && git rev-list -1 "${VLC_START_REVISION}" -- "${VLC_CONTRIB_REBUILD_PATHS[@]}"
 )
 
 [ -n "${VLC_LAST_CONTRIB_SHA}" ] || abort_err "Failed to determine last contrib SHA using Git!"



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0dffba0ebaf05d236e02f0b24ec9ca19786eb842

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0dffba0ebaf05d236e02f0b24ec9ca19786eb842
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list