Skip to content
Snippets Groups Projects
Commit 0dffba0e authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Steve Lhomme
Browse files

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 4ac6168d.
parent 410d5999
No related branches found
No related tags found
1 merge request!4988extras: ci: fix get-contrib-sha for debian/android
Pipeline #441405 passed with warnings with stage
in 46 minutes and 57 seconds
...@@ -28,37 +28,33 @@ VLC_SRC_ROOT_DIR=$(git rev-parse --show-toplevel) ...@@ -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" [ -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" [ -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 case $1 in
win32*|win64*|uwp*) win32*|win64*|uwp*)
VLC_BUILD_TARGET="extras/package/win32" VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/win32" )
;;
debian*)
VLC_BUILD_TARGET=""
;; ;;
ios*|tvos*) ios*|tvos*)
VLC_BUILD_TARGET="extras/package/apple" VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/apple" )
;; ;;
macos*) macos*)
VLC_BUILD_TARGET="extras/package/macosx" VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/macos" )
;; ;;
raspbian*) raspbian*)
VLC_BUILD_TARGET="extras/package/raspberry" VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/raspberry" )
;; ;;
snap*) snap*)
VLC_BUILD_TARGET="extras/package/snap" VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/snap" )
;; ;;
wasm*) wasm*)
VLC_BUILD_TARGET="extras/package/wasm-emscripten" VLC_CONTRIB_REBUILD_PATHS+=( "extras/package/wasm-emscripten" )
;; ;;
android*) debian*|android*)
VLC_BUILD_TARGET=""
;; ;;
*)
VLC_CONTRIB_REBUILD_PATHS+=( "extras/package" )
esac esac
VLC_LAST_CONTRIB_SHA=$( VLC_LAST_CONTRIB_SHA=$(
cd "$VLC_SRC_ROOT_DIR" && cd "${VLC_SRC_ROOT_DIR} && git rev-list -1 "${VLC_START_REVISION}" -- "${VLC_CONTRIB_REBUILD_PATHS[@]}"
git rev-list -1 "${VLC_START_REVISION}" -- "${VLC_CONTRIB_REBUILD_PATHS[@]}" "${VLC_BUILD_TARGET}"
) )
[ -n "${VLC_LAST_CONTRIB_SHA}" ] || abort_err "Failed to determine last contrib SHA using Git!" [ -n "${VLC_LAST_CONTRIB_SHA}" ] || abort_err "Failed to determine last contrib SHA using Git!"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment