summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdesktop/scripts/soffice.sh13
-rwxr-xr-xdesktop/scripts/unopkg.sh13
2 files changed, 6 insertions, 20 deletions
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index f855fe79e8bf..b73d6b30a2e6 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -39,26 +39,19 @@ export SAL_ENABLE_FILE_LOCKING
#@JITC_PROCESSOR_TYPE_EXPORT@
-cd_or_exit() {
- if ! cd "$1"; then
- echo "Can't cd to $1"
- exit 1
- fi
-}
-
# resolve installation directory
sd_cwd=$(pwd)
sd_res="$0"
while [ -h "$sd_res" ] ; do
sd_dirname=$(dirname "$sd_res")
- cd_or_exit "$sd_dirname"
+ cd "$sd_dirname" || exit $?
sd_basename=$(basename "$sd_res")
sd_res=$(ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g")
done
sd_dirname=$(dirname "$sd_res")
-cd_or_exit "$sd_dirname"
+cd "$sd_dirname" || exit $?
sd_prog=$(pwd)
-cd_or_exit "$sd_cwd"
+cd "$sd_cwd" || exit $?
# linked build needs additional settings
if [ -e "${sd_prog}/ooenv" ] ; then
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index c66da9b41ebe..83068d29d35e 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -21,26 +21,19 @@
SAL_ENABLE_FILE_LOCKING=1
export SAL_ENABLE_FILE_LOCKING
-cd_or_exit() {
- if ! cd "$1"; then
- echo "Can't cd to $1"
- exit 1
- fi
-}
-
# resolve installation directory
sd_cwd=$(pwd)
sd_res="$0"
while [ -h "$sd_res" ] ; do
sd_dirname=$(dirname "$sd_res")
- cd_or_exit "$sd_dirname"
+ cd "$sd_dirname" || exit $?
sd_basename=$(basename "$sd_res")
sd_res=$(ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g")
done
sd_dirname=$(dirname "$sd_res")
-cd_or_exit "$sd_dirname"
+cd "$sd_dirname" || exit $?
sd_prog=$(pwd)
-cd_or_exit "$sd_cwd"
+cd "$sd_cwd" || exit $?
# this is a temporary hack until we can live with the default search paths
case "$(uname -s)" in