GUACAMOLE-1540: Merge changes correcting Docker-specific search for FreeRDP install location.
This commit is contained in:
commit
dc9dfe562f
@ -30,29 +30,20 @@
|
|||||||
##
|
##
|
||||||
|
|
||||||
##
|
##
|
||||||
## Given the full path to a FreeRDP plugin, locates the base directory of the
|
## Locates the base directory of the FreeRDP installation (where the FreeRDP library
|
||||||
## associated FreeRDP installation (where the FreeRDP library .so files are
|
## .so files are located), printing the result to STDOUT. If the directory cannot be
|
||||||
## located), printing the result to STDOUT. If the directory cannot be
|
|
||||||
## determined, an error is printed.
|
## determined, an error is printed.
|
||||||
##
|
##
|
||||||
## @param PLUGIN_FILE
|
|
||||||
## The full path to the FreeRDP plugin to check.
|
|
||||||
##
|
|
||||||
where_is_freerdp() {
|
where_is_freerdp() {
|
||||||
|
|
||||||
PLUGIN_FILE="$1"
|
# Determine the location of any freerdp2 .so files
|
||||||
|
PATHS="$(find / -iname '*libfreerdp2.so.*' \
|
||||||
# Determine the location of all libfreerdp* libraries explicitly linked
|
|
||||||
# to given file
|
|
||||||
PATHS="$(ldd "$PLUGIN_FILE" \
|
|
||||||
| awk '/=>/{print $(NF-1)}' \
|
|
||||||
| grep 'libfreerdp' \
|
|
||||||
| xargs -r dirname \
|
| xargs -r dirname \
|
||||||
| xargs -r realpath \
|
| xargs -r realpath \
|
||||||
| sort -u)"
|
| sort -u)"
|
||||||
|
|
||||||
# Verify that exactly one location was found
|
# Verify that exactly one location was found
|
||||||
if [ "$(echo "$PATHS" | wc -l)" != 1 ]; then
|
if [ -z "$PATHS" -o "$(echo "$PATHS" | wc -l)" != 1 ]; then
|
||||||
echo "$1: Unable to locate FreeRDP install location." >&2
|
echo "$1: Unable to locate FreeRDP install location." >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -66,11 +57,11 @@ where_is_freerdp() {
|
|||||||
# search path of FreeRDP
|
# search path of FreeRDP
|
||||||
#
|
#
|
||||||
|
|
||||||
while [ -n "$1" ]; do
|
# Determine correct install location for FreeRDP plugins
|
||||||
|
FREERDP_DIR="$(where_is_freerdp)"
|
||||||
|
FREERDP_PLUGIN_DIR="${FREERDP_DIR}/freerdp2"
|
||||||
|
|
||||||
# Determine correct install location for FreeRDP plugins
|
while [ -n "$1" ]; do
|
||||||
FREERDP_DIR="$(where_is_freerdp "$1")"
|
|
||||||
FREERDP_PLUGIN_DIR="${FREERDP_DIR}/freerdp2"
|
|
||||||
|
|
||||||
# Add symbolic link if necessary
|
# Add symbolic link if necessary
|
||||||
if [ ! -e "$FREERDP_PLUGIN_DIR/$(basename "$1")" ]; then
|
if [ ! -e "$FREERDP_PLUGIN_DIR/$(basename "$1")" ]; then
|
||||||
@ -83,4 +74,3 @@ while [ -n "$1" ]; do
|
|||||||
shift
|
shift
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user