[SCM] vlc/experimental: Check if there are files first

sramacher at users.alioth.debian.org sramacher at users.alioth.debian.org
Mon Oct 9 19:28:15 UTC 2017


The following commit has been merged in the experimental branch:
commit 671a711c8243c3e53d14ad2e9f022ed8efe52e86
Author: Sebastian Ramacher <sramacher at debian.org>
Date:   Mon Oct 9 20:58:16 2017 +0200

    Check if there are files first

diff --git a/debian/libvlc-bin.postinst.in b/debian/libvlc-bin.postinst.in
index 241bd15..f25aaad 100644
--- a/debian/libvlc-bin.postinst.in
+++ b/debian/libvlc-bin.postinst.in
@@ -2,9 +2,18 @@
 set -e
 
 run_vlc_cache_gen() {
-    if ! /usr/lib/#DEB_HOST_MULTIARCH#/vlc/vlc-cache-gen /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins ; then
-        echo "WARNING: Regenerating VLC plugin cache failed."
-        echo "Please run '/usr/lib/#DEB_HOST_MULTIARCH#/vlc/vlc-cache-gen -f /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins' manually."
+    files = `find /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins -name '*.so' -type -f -print -quit`
+    if test -n "$files"
+    then
+      # run vlc-cache-gen since there are plugins
+      if ! /usr/lib/#DEB_HOST_MULTIARCH#/vlc/vlc-cache-gen /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins
+      then
+          echo "WARNING: Regenerating VLC plugin cache failed."
+          echo "Please run '/usr/lib/#DEB_HOST_MULTIARCH#/vlc/vlc-cache-gen /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins' manually."
+      fi
+    else
+      # no plugins, so remove plugins.dat
+      rm -f /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins/plugins.dat
     fi
 }
 

-- 
VLC media player packaging



More information about the pkg-multimedia-commits mailing list