summaryrefslogtreecommitdiff
path: root/desktop/scripts/unopkg.sh
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/scripts/unopkg.sh')
-rw-r--r--desktop/scripts/unopkg.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 5a8ee262ae..8a9f638df0 100644
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -31,15 +31,14 @@ SAL_ENABLE_FILE_LOCKING=1
export SAL_ENABLE_FILE_LOCKING
# resolve installation directory
-sd_cwd="`pwd`"
-if [ -h "$0" ] ; then
- sd_basename=`basename "$0"`
- sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"`
- cd "`dirname "$0"`"
- cd "`dirname "$sd_script"`"
-else
- cd "`dirname "$0"`"
-fi
+sd_cwd=`pwd`
+sd_res=$0
+while [ -h "$sd_res" ] ; do
+ cd "`dirname "$sd_res"`"
+ sd_basename=`basename "$sd_res"`
+ sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"`
+done
+cd "`dirname "$sd_res"`"
sd_prog=`pwd`
cd "$sd_cwd"