From 5ec617fa3e4dba53a85cad90d75590fea0abf591 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 11 Mar 2014 22:16:08 +0100 Subject: [PATCH] ignore trailing slashes for comparison of source Signed-off-by: Steven Armstrong --- cdist/conf/type/__link/explorer/state | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__link/explorer/state b/cdist/conf/type/__link/explorer/state index 48278d9e..b8d8fc2b 100755 --- a/cdist/conf/type/__link/explorer/state +++ b/cdist/conf/type/__link/explorer/state @@ -35,7 +35,8 @@ case "$type" in cd "$destination_dir" source_is=$(ls -l "$destination" | sed 's/.*-> //g') if [ -h "$destination" ]; then - if [ "$source_is" = "$source" ]; then + # ignore trailing slashes for comparison + if [ "${source_is%/}" = "${source%/}" ]; then echo present else echo wrongsource