gettext: fix build with gcc-14; enhance test environment
[oi-userland.git] / components / encumbered / vlc / files / vlc-cache-gen
blob98e273fd5b917d82cc6646936662eb17526d2d6c
1 #! /usr/bin/ksh
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright 2019 Alexander Pyhalov
18 set -e
20 . /lib/svc/share/smf_include.sh
22 VLC_CACHE_GEN=/usr/lib/64/vlc/vlc-cache-gen
23 VLC_PLUGINS_DIR=/usr/lib/64/vlc/plugins
24 VLC_CACHE=/usr/lib/64/vlc/plugins/plugins.dat
25 FIND=/usr/bin/find
27 NEEDS_REGENERATION=0
29 # Always regenerate VLC cache on refresh
30 if [ "$1" = "refresh" ]; then
31 NEEDS_REGENERATION=1
34 if [ ! -f "${VLC_CACHE}" ]; then
35 NEEDS_REGENERATION=1;
36 else
37 FIND_OUTPUT=$($FIND "$VLC_PLUGINS_DIR" -newer "$VLC_CACHE")
38 if [ -n "${FIND_OUTPUT}" ]; then
39 NEEDS_REGENERATION=1;
44 if [ $NEEDS_REGENERATION -eq 1 ]; then
45 printf "Regenerating VLC plugins cache\n"
46 $VLC_CACHE_GEN $VLC_PLUGINS_DIR
49 exit 0