[vlc-commits] macosx: codesign: Check whether vlc-cache-gen can be executed

David Fuhrmann git at videolan.org
Mon Dec 14 19:30:00 UTC 2020


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Mon Dec 14 20:27:04 2020 +0100| [c8ab476aa089c71799db5624c809b5c83ceab825] | committer: David Fuhrmann

macosx: codesign: Check whether vlc-cache-gen can be executed

Check whether vlc-cache-gen can actually be executed, to
detect whether it is available for the right architecture.

If it is not available, support the possibility to not
sign the plugins.dat cache file. Also support the case
the cache file is not there from the beginning.

(manual bp of 18271e16182312cc2d0a80848d562e52efc2ebf8)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=c8ab476aa089c71799db5624c809b5c83ceab825
---

 extras/package/macosx/codesign.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/extras/package/macosx/codesign.sh b/extras/package/macosx/codesign.sh
index 36e7213157..76711bae4a 100755
--- a/extras/package/macosx/codesign.sh
+++ b/extras/package/macosx/codesign.sh
@@ -79,13 +79,19 @@ if [ -e "./vlc-cache-gen" ]; then
     VLCCACHEGEN="./vlc-cache-gen"
 fi
 
+$VLCCACHEGEN --help 1>/dev/null 2>&1 && returncode=$? || returncode=$?
+if [ $returncode -ne 0 ]; then
+    info "WARN: Cannot execute vlc-cache-gen with path '$VLCCACHEGEN' (wrong arch?)"
+    VLCCACHEGEN=""
+fi
+
 if [ -z "$VLCCACHEGEN" ]; then
-info "WARN: Cannot find vlc-cache-gen, cache will be corrupt after signing"
+    info "WARN: Cannot find vlc-cache-gen, cache will be removed for signing"
 fi
 
 SCRIPTDIR=$(dirname "$0")
 if [ ! -z "$RUNTIME" ]; then
-RUNTIME_FLAGS="--options runtime --entitlements $SCRIPTDIR/vlc-hardening.entitlements"
+    RUNTIME_FLAGS="--options runtime --entitlements $SCRIPTDIR/vlc-hardening.entitlements"
 fi
 
 # Call with $1 = file or folder
@@ -156,10 +162,11 @@ done
 
 if [ ! -z "$VLCCACHEGEN" ]; then
     $VLCCACHEGEN VLC.app/Contents/MacOS/plugins
+    sign "VLC.app/Contents/MacOS/plugins/plugins.dat"
+else
+    rm "VLC.app/Contents/MacOS/plugins/plugins.dat" || true
 fi
 
-sign "VLC.app/Contents/MacOS/plugins/plugins.dat"
-
 info "Signing the libraries"
 
 for i in $(find VLC.app/Contents/MacOS/lib -type f -exec echo {} \;)



More information about the vlc-commits mailing list