From c153438a7e6cb58d24d1ad6ab015f80e4c8d21a0 Mon Sep 17 00:00:00 2001 From: patovm04 <58536680+patovm04@users.noreply.github.com> Date: Fri, 4 Dec 2020 20:00:22 -0300 Subject: [PATCH] Fix missing readlink -e option error on FreeBSD (#7) Taken from: https://github.com/PCMan/gtk3-nocsd/pull/56 --- gtk3-nocsd.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtk3-nocsd.in b/gtk3-nocsd.in index bf3ca73..5655e31 100644 --- a/gtk3-nocsd.in +++ b/gtk3-nocsd.in @@ -16,10 +16,13 @@ # program to call as its arguments. # +OS=$(uname | tr "[:upper:]" "[:lower:]") +RLINK_ARGS=$([ "$OS" = "freebsd" ] && echo "-f" || echo "-fe") + GTK3_NOCSD_NAME=libgtk3-nocsd.so.0 # Determine if this script are installed in the system path -GTK3_NOCSD_BINARY="$(readlink -fe "$(which "$0")")" +GTK3_NOCSD_BINARY="$(readlink ${RLINK_ARGS} "$(which "$0")")" case "${GTK3_NOCSD_BINARY%/*}" in /sbin|/bin|/usr/bin|/usr/sbin|/usr/local/bin|/usr/local/sbin) IN_SYSTEM_PATH=1 ;; *) IN_SYSTEM_PATH=0 ;; @@ -73,7 +76,7 @@ fi # Find the real program (the first one that's not symlinked to get3-nocsd) APPNAME="$(basename "$0")" for APPPATH in $(which -a "$APPNAME") /bin/false; do - APPPATH_LINK="$(readlink -fe "$APPPATH")" + APPPATH_LINK="$(readlink ${RLINK_ARGS} "$APPPATH")" [ x"${APPPATH_LINK##*/}"x = x"gtk3-nocsd"x ] || break done