Files
makemkv/scripts/build-ld-cache
Daniel Llewellyn b4e60fa878 Fix broken build-ld-cache script
Fix reference to LD_LIBRARY_PATH missing last H.

Signed-off-by: Daniel Llewellyn <daniel@bowlhat.net>
2020-05-15 20:58:18 +01:00

17 lines
619 B
Bash
Executable File

#!/bin/bash -ex
# delete empty entries in the LD_LIBRARY_PATH
# i.e. change "/a/b/c:/1/2/3::/other" into "/a/b/c:/1/2/3:/other"
# if we don't do this, then ldconfig gets confused with "" as arguments of dirs
# to add to the cache
LD_LIBRARY_PATH="${LD_LIBRARY_PATH//::/:}"
# Remove leading empty element if it exists
LD_LIBRARY_PATH="${LD_LIBRARY_PATH#:}"
# Remove trailing empty element if it exists
LD_LIBRARY_PATH="${LD_LIBRARY_PATH%:}"
# run ldconfig on our LD_LIBRARY_PATH lib dirs
IFS=':' read -ra PATHS <<< "$LD_LIBRARY_PATH"
mkdir -p "$SNAP_DATA/etc"
ldconfig -v -C "$SNAP_DATA/etc/ld.so.cache" "${PATHS[@]}"