[Libreoffice-commits] core.git: desktop/scripts

2021-01-19 Thread Stephan Bergmann (via logerrit)
 desktop/scripts/unoinfo-mac.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 304126915661efde8994595af0813a7f5cdc162d
Author: Stephan Bergmann 
AuthorDate: Tue Jan 19 12:31:34 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Jan 19 14:38:18 2021 +0100

Fix unoinfo on macOS

...after 4b9190fc29aec0f005f08c0269bb9ff081f19fe3 "mac: don't put script 
files
into Contents/MacOS or framework-bin directory" moved it from 
Contents/MacOS/ to
Contents/Resources/

Change-Id: I90da34f73463baa516e81f6d06bd718f08e93af0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109627
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/desktop/scripts/unoinfo-mac.sh b/desktop/scripts/unoinfo-mac.sh
index b67882db0015..9b37d1b7d86b 100755
--- a/desktop/scripts/unoinfo-mac.sh
+++ b/desktop/scripts/unoinfo-mac.sh
@@ -38,7 +38,7 @@ c++)
 java)
 printf '0%s\0%s' \
 "$sd_prog/../Resources/java/libreoffice.jar" \
-"$sd_prog"
+"$sd_prog/../MacOS"
 ;;
 *)
 exit 1
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2020-11-23 Thread Michael Stahl (via logerrit)
 desktop/scripts/soffice.sh |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1ab938155c875e65470b9f6b3b3ef65885462f7a
Author: Michael Stahl 
AuthorDate: Thu Nov 19 13:35:28 2020 +0100
Commit: Michael Stahl 
CommitDate: Mon Nov 23 14:35:25 2020 +0100

desktop: rr --ignore-nested was renamed to --nested=ignore

Change-Id: Id1c1789c24b8eec27db0b24e1e43e2eb7d562509
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106291
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 5538c968ee18..67cc0b89751f 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -78,8 +78,8 @@ for arg in "$@" $EXTRAOPT ; do
 case "$arg" in
 --record)
 if which rr >/dev/null 2>&1 ; then
-# smoketest may already be recorded => use ignore-nested
-RRCHECK="rr record --ignore-nested"
+# smoketest may already be recorded => ignore nested
+RRCHECK="rr record --nested=ignore"
 checks="c$checks"
 else
 echo "Error: Can't find the tool \"rr\", --record option will 
be ignored."
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2020-02-05 Thread Michael Weghorn (via logerrit)
 desktop/scripts/soffice.sh |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 25649502e08a52087dea5e482d34a1d4150f0930
Author: Michael Weghorn 
AuthorDate: Wed Feb 5 09:40:56 2020 +0100
Commit: Michael Weghorn 
CommitDate: Wed Feb 5 15:46:15 2020 +0100

tdf#130080 soffice.sh: Avoid exporting empty LC_ALL

The previous way of doing

LO_SAVE_LC_ALL="$LC_ALL"
LC_ALL=C
export LC_ALL
# ... (call some tools,...)
LC_ALL="$LO_SAVE_LC_ALL"

resulted in the LC_ALL environment variable explicity being
set to an empty string in case it was not set at all previously.

For some reason, an LC_ALL explicitly set to an empty string
(other than an unset LC_ALL) makes the system ICU on various
Linux distributions assume an "US-ASCII" encoding, even if the
locale is otherwise configured to be a UTF-8 one.
Since the corresponding detection from ICU is used in the
KF5/Qt stack, that resulted in the Plasma-native file picker
assuming an ASCII-encoding, and thus having problems with
files containing non-ASCII characters.

To avoid this, don't export LC_ALL if unset or set to an
empty string.

A big thanks to frinring on IRC #kde-devel for the analysis
of why the Plasma-native file picker is affected by LC_ALL being
set to an empty string!

I could also reproduce that the following sample program run
with 'LC_ALL=' on KDE Neon Developer edition printed "US-ASCII"
when using the system ICU, while it printed "UTF-8" when using
a self-built ICU as of current master (commit
d6b88d49e3be7096baf3828776c2b482a8ed1780) instead, but did not
further investigate why:

#include 
#include 

int main() {
std::cout << ucnv_getDefaultName();
}

Change-Id: Idee88f200b6edecdb2633ed6e6fa70b370ffcf0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88003
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 026f7f022c78..415ea047361d 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -169,8 +169,12 @@ AIX)
 ;;
 esac
 
-# restore locale setting
-LC_ALL="$LO_SAVE_LC_ALL"
+# restore locale setting, avoiding to export empty LC_ALL, s. tdf#130080
+if [ -n "$LO_SAVE_LC_ALL" ]; then
+LC_ALL="$LO_SAVE_LC_ALL"
+else
+unset LC_ALL
+fi
 
 # run soffice.bin directly when you want to get the backtrace
 if [ -n "$GDBTRACECHECK" ] ; then
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2019-07-13 Thread Ilmari Lauhakangas (via logerrit)
 desktop/scripts/soffice.sh |4 
 1 file changed, 4 insertions(+)

New commits:
commit 35463d886e15d13a81bce36610140e40ae742416
Author: Ilmari Lauhakangas 
AuthorDate: Mon Jun 10 19:27:05 2019 +0300
Commit: Xisco Faulí 
CommitDate: Sat Jul 13 16:17:16 2019 +0200

Add more useful exports to soffice's callgrind mode

Moved from TDF wiki to avoid duplication.

These three stop us getting poor performance from unusual allocators:
unset MALLOC_CHECK_ MALLOC_PERTURB_ G_SLICE

If we wedge, at least we don't do it while grabbing the mouse:
export SAL_DISABLE_FLOATGRAB=1

Turns off recovery dialog, which can be a pain:
export OOO_DISABLE_RECOVERY=1

Turns off GL watchdog. It normally kills the application, if it
seems to hang in a GL block:
export SAL_DISABLE_GL_WATCHDOG=1

Change-Id: I4ec30d363280b727cd305a6a81ccb85849697159
Reviewed-on: https://gerrit.libreoffice.org/73773
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Xisco Faulí 

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 579915d1d6b3..026f7f022c78 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -127,6 +127,10 @@ for arg in "$@" $EXTRAOPT ; do
 export GLIBCXX_FORCE_NEW=1
 ;;
 callgrind)
+unset MALLOC_CHECK_ MALLOC_PERTURB_ G_SLICE
+export SAL_DISABLE_FLOATGRAB=1
+export OOO_DISABLE_RECOVERY=1
+export SAL_DISABLE_GL_WATCHDOG=1
 export LD_BIND_NOW=1
 ;;
 esac
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: desktop/scripts

2019-06-03 Thread Luboš Luňák (via logerrit)
 desktop/scripts/soffice.sh |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a5fa2d2d64c7fc2ef096ae61fe2db327a42db2b4
Author: Luboš Luňák 
AuthorDate: Mon Jun 3 13:38:27 2019 +0200
Commit: Luboš Luňák 
CommitDate: Mon Jun 3 20:49:56 2019 +0200

LD_BIND_NOW=1 if running under callgrind

It avoids all those calls to _dl_runtime_resolve_xsave that
in KCachegrind's call graph lead to nowhere and make navigating harder.

Change-Id: Ie3843676298d92b8ed6d598ead16f4d410ba8b2b
Reviewed-on: https://gerrit.libreoffice.org/73382
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 6f969b5af321..579915d1d6b3 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -126,6 +126,9 @@ for arg in "$@" $EXTRAOPT ; do
 export G_SLICE=always-malloc
 export GLIBCXX_FORCE_NEW=1
 ;;
+callgrind)
+export LD_BIND_NOW=1
+;;
 esac
 else
 echo "Error: Can't find the tool \"valgrind\", --valgrind 
option will be ignored"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: desktop/scripts solenv/gbuild

2018-09-05 Thread Libreoffice Gerrit user
 desktop/scripts/soffice.sh   |3 ++-
 solenv/gbuild/CppunitTest.mk |7 ++-
 solenv/gbuild/PythonTest.mk  |2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit ad6286ce92e7536f0aec9fd1bd9e2eec8ccc21bf
Author: Michael Stahl 
AuthorDate: Wed May 20 13:18:42 2015 +0200
Commit: Michael Stahl 
CommitDate: Wed Sep 5 16:01:07 2018 +0200

gbuild: allow recording of CppunitTests and PythonTests too

Since these don't use soffice they need to be tweaked to use RR variable.

A rr git master build from some weeks ago can record all tests, except
CppunitTest_dbaccess_firebird_test which fails.

smoketest is a bit tricky because it spawns soffice which checks RR
variable again and starts a nested rr, but fortunately there's a
flag to prevent it from aborting in this situation.

For UITests currently only the soffice.bin is recorded, not the python
test process.

The size of all the recording is about 35G per run in a --enable-dbgutil
build.

Change-Id: I2143618fa2181e36b6aaeded43637cb3481f5e47
Reviewed-on: https://gerrit.libreoffice.org/60032
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index df295cb76250..6f969b5af321 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -78,7 +78,8 @@ for arg in "$@" $EXTRAOPT ; do
 case "$arg" in
 --record)
 if which rr >/dev/null 2>&1 ; then
-RRCHECK="rr record"
+# smoketest may already be recorded => use ignore-nested
+RRCHECK="rr record --ignore-nested"
 checks="c$checks"
 else
 echo "Error: Can't find the tool \"rr\", --record option will 
be ignored."
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 1ac3b210e149..8e130d481802 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -63,6 +63,10 @@ gb_CppunitTest_VALGRINDTOOL += --vgdb=yes --vgdb-error=0
 endif
 endif
 
+ifneq ($(strip $(RR)),)
+gb_CppunitTest_RR := rr record
+endif
+
 # defined by platform
 #  gb_CppunitTest_get_filename
 gb_CppunitTest_RUNTIMEDEPS := $(call 
gb_Executable_get_runtime_dependencies,cppunittester)
@@ -134,7 +138,8 @@ else
$(gb_CppunitTest_malloc_check) \
$(if $(strip $(PYTHON_URE)),\
PYTHONDONTWRITEBYTECODE=1) \
-   $(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) 
$(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \
+   $(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) 
$(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_RR) \
+   $(gb_CppunitTest_CPPTESTCOMMAND) \
$(call gb_LinkTarget_get_target,$(call 
gb_CppunitTest_get_linktarget,$*)) \
$(call gb_CppunitTest__make_args) "-env:CPPUNITTESTTARGET=$@" \
$(if $(gb_CppunitTest_POSTGDBTRACE), \
diff --git a/solenv/gbuild/PythonTest.mk b/solenv/gbuild/PythonTest.mk
index c579a34ea6d5..a2bac3819e02 100644
--- a/solenv/gbuild/PythonTest.mk
+++ b/solenv/gbuild/PythonTest.mk
@@ -55,7 +55,7 @@ else
$(if $(filter-out MACOSX WNT,$(OS_FOR_BUILD)),$(if 
$(DISABLE_GUI),, \
SAL_USE_VCLPLUGIN=svp \
)) \
-   $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) \
+   $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) 
$(gb_CppunitTest_RR) \
$(gb_PythonTest_COMMAND) \
$(if 
$(PYTHON_TEST_NAME),$(PYTHON_TEST_NAME),$(MODULES)) \
$(if $(gb_CppunitTest__interactive),, \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts svx/source

2018-06-25 Thread Thomas Klausner
 desktop/scripts/soffice.sh  |7 ++-
 desktop/scripts/unopkg.sh   |6 +-
 svx/source/gengal/gengal.sh |6 +-
 3 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 8db53bfd74e48f60e3002b2ae5f7f13c9387725a
Author: Thomas Klausner 
Date:   Mon Jun 25 23:42:44 2018 +0200

Fix "javaPathHelper: not found" errors during startup.

javaPathHelper is a tool from OpenBSD ports, so there is no point
looking for it on other operating systems.

Change-Id: I763d717fdf7172b412d527fcd88347b2e54a8fe9

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 5c76b6e2211d..df295cb76250 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -141,7 +141,7 @@ if echo "$checks" | grep -q "cc" ; then
 fi
 
 case "$(uname -s)" in
-NetBSD|OpenBSD|DragonFly)
+OpenBSD)
 # this is a temporary hack until we can live with the default search paths
 LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
 JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
@@ -150,6 +150,11 @@ NetBSD|OpenBSD|DragonFly)
 export JAVA_HOME
 fi
 ;;
+NetBSD|DragonFly)
+# this is a temporary hack until we can live with the default search paths
+LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+export LD_LIBRARY_PATH
+;;
 AIX)
 LIBPATH="$sd_prog${LIBPATH:+:$LIBPATH}"
 export LIBPATH
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 83068d29d35e..3adf69c2e56e 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -37,7 +37,7 @@ cd "$sd_cwd" || exit $?
 
 # this is a temporary hack until we can live with the default search paths
 case "$(uname -s)" in
-NetBSD|OpenBSD|FreeBSD|DragonFly)
+OpenBSD)
 LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
 JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
 export LD_LIBRARY_PATH
@@ -45,6 +45,10 @@ NetBSD|OpenBSD|FreeBSD|DragonFly)
 export JAVA_HOME
 fi
 ;;
+NetBSD|FreeBSD|DragonFly)
+LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
+export LD_LIBRARY_PATH
+;;
 AIX)
 LIBPATH="$sd_prog${LIBPATH:+:${LIBPATH}}"
 export LIBPATH
diff --git a/svx/source/gengal/gengal.sh b/svx/source/gengal/gengal.sh
index b4d10458650a..3970ab1fa9c8 100755
--- a/svx/source/gengal/gengal.sh
+++ b/svx/source/gengal/gengal.sh
@@ -35,7 +35,7 @@ cd "$sd_cwd"
 
 # this is a temporary hack until we can live with the default search paths
 case "$(uname -s)" in
-NetBSD|OpenBSD|FreeBSD|DragonFly)
+OpenBSD)
 LD_LIBRARY_PATH=$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
 JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
 export LD_LIBRARY_PATH
@@ -43,6 +43,10 @@ NetBSD|OpenBSD|FreeBSD|DragonFly)
 export JAVA_HOME
 fi
 ;;
+NetBSD|FreeBSD|DragonFly)
+LD_LIBRARY_PATH=$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+export LD_LIBRARY_PATH
+;;
 AIX)
 LIBPATH=$sd_prog${LIBPATH:+:${LIBPATH}}
 export LIBPATH
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2017-03-07 Thread Michael Stahl
 desktop/scripts/soffice.sh |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4722bb82f8f2a181d882b8ad683ee5740da95cfa
Author: Michael Stahl 
Date:   Tue Mar 7 13:31:34 2017 +0100

desktop: unbreak soffice --valgrind

(regression from e6a9dc22a4e58b565894f8cdb6a19755af7b14de)

Change-Id: Ib394a64fb70a3b578d462c351eb9d68e9ac55d62

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index b73d6b3..5c76b6e 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -110,8 +110,8 @@ for arg in "$@" $EXTRAOPT ; do
 test -z "$VALGRIND" && VALGRIND="memcheck"
 # --trace-children-skip is pretty useful but supported only 
with valgrind >= 3.6.0
 valgrind_ver=$(valgrind --version | sed -e "s/valgrind-//")
-valgrind_ver_maj=$(echo "$valgrind_ver" | awk -F. '{ print \$1 
}')
-valgrind_ver_min=$(echo "$valgrind_ver" | awk -F. '{ print \$2 
}')
+valgrind_ver_maj=$(echo "$valgrind_ver" | awk -F. '{ print $1 
}')
+valgrind_ver_min=$(echo "$valgrind_ver" | awk -F. '{ print $2 
}')
 valgrind_skip=
 if [ "$valgrind_ver_maj" -gt 3 ] || ( [ "$valgrind_ver_maj" 
-eq 3 ] && [ "$valgrind_ver_min" -ge 6 ] ) ; then
 valgrind_skip='--trace-children-skip=*/java,*/gij'
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2017-02-11 Thread Stephan Bergmann
 desktop/scripts/soffice.sh |   13 +++--
 desktop/scripts/unopkg.sh  |   13 +++--
 2 files changed, 6 insertions(+), 20 deletions(-)

New commits:
commit 709709962d09a22c9594c7a440c6543ad4843ecf
Author: Stephan Bergmann 
Date:   Sat Feb 11 12:54:24 2017 +0100

Upon failure, 'cd' itself already prints a message to stderr

Change-Id: Iabe3a6bb14ca3e83a0792d7fc131ae0ac74e578c

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index f855fe7..b73d6b3 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 c66da9b..83068d2 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
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2017-02-06 Thread Stephan Bergmann
 desktop/scripts/soffice.sh |2 +-
 desktop/scripts/unopkg.sh  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ccedfa046aad9eb411a1298c2572496768a039aa
Author: Stephan Bergmann 
Date:   Mon Feb 6 13:50:59 2017 +0100

Revert "fix desktop scripts"

This reverts commit f52eb759f61e1806014972cb736e07479f157aa6.  I assume 
this was
intented to be a fix for e6a9dc22a4e58b565894f8cdb6a19755af7b14de 
"tdf#105204
fix shellcheck warnings in desktop/scripts" (later addressed with
7ba0b28cc3ac82f5c5c6d7e2536cb89771041893 "Unbreak soffice.sh").  But I think
these quotations are actually useful parts of that original commit.  I fail 
to
see how pathname expansion (aka globbing; nor field splitting, if that is 
what
was actually meant in "we want globbing here") should be a useful feature 
here.

Change-Id: I5c33c40cfe2a817f628442fed70a07f06dd275cc

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index aafc985..f855fe7 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -81,7 +81,7 @@ test -n "$VALGRIND" && EXTRAOPT="--valgrind"
 # force the --record option if the RR variable is set
 test -n "$RR" && EXTRAOPT="--record"
 
-for arg in $@ $EXTRAOPT ; do
+for arg in "$@" $EXTRAOPT ; do
 case "$arg" in
 --record)
 if which rr >/dev/null 2>&1 ; then
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index c90a7db..c66da9b 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -58,7 +58,7 @@ AIX)
 ;;
 esac
 
-for arg in $@
+for arg in "$@"
 do
   case "$arg" in
#collect all bootstrap variables specified on the command line
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2017-02-04 Thread Stephan Bergmann
 desktop/scripts/soffice.sh |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7ba0b28cc3ac82f5c5c6d7e2536cb89771041893
Author: Stephan Bergmann 
Date:   Sat Feb 4 16:34:15 2017 +0100

Unbreak soffice.sh

Change-Id: I8c827db4c16a4a169dd710787bf9beb123ddc7b6

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index c6d630a..aafc985 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -168,7 +168,7 @@ LC_ALL="$LO_SAVE_LC_ALL"
 
 # run soffice.bin directly when you want to get the backtrace
 if [ -n "$GDBTRACECHECK" ] ; then
-exec "$GDBTRACECHECK" "$sd_prog/soffice.bin" "$@"
+exec $GDBTRACECHECK "$sd_prog/soffice.bin" "$@"
 fi
 
 # valgrind --log-file=valgrind.log does not work well with --trace-children=yes
@@ -178,4 +178,4 @@ if [ -n "$VALGRINDCHECK" ] && [ -z "$VALGRIND" ] ; then
 fi
 
 # oosplash does the rest: forcing pages in, javaldx etc. are
-exec "$RRCHECK" "$VALGRINDCHECK" "$STRACECHECK" "$sd_prog/oosplash" "$@"
+exec $RRCHECK $VALGRINDCHECK $STRACECHECK "$sd_prog/oosplash" "$@"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2017-02-04 Thread Jochen Nitschke
 desktop/scripts/soffice.sh |2 +-
 desktop/scripts/unopkg.sh  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f52eb759f61e1806014972cb736e07479f157aa6
Author: Jochen Nitschke 
Date:   Sat Feb 4 11:14:56 2017 +

fix desktop scripts

reverts parts of e6a9dc22a4e58b565894f8cdb6a19755af7b14de
we want globbing here

Change-Id: Ibe4672f41b0fe6a75d1aca898cc55414e138f6ef
Reviewed-on: https://gerrit.libreoffice.org/33913
Reviewed-by: Jochen Nitschke 
Tested-by: Jochen Nitschke 

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 1f7d7a23..c6d630a 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -81,7 +81,7 @@ test -n "$VALGRIND" && EXTRAOPT="--valgrind"
 # force the --record option if the RR variable is set
 test -n "$RR" && EXTRAOPT="--record"
 
-for arg in "$@" $EXTRAOPT ; do
+for arg in $@ $EXTRAOPT ; do
 case "$arg" in
 --record)
 if which rr >/dev/null 2>&1 ; then
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index c66da9b..c90a7db 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -58,7 +58,7 @@ AIX)
 ;;
 esac
 
-for arg in "$@"
+for arg in $@
 do
   case "$arg" in
#collect all bootstrap variables specified on the command line
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2017-02-04 Thread qarkai
 desktop/scripts/sbase.sh   |2 -
 desktop/scripts/scalc.sh   |2 -
 desktop/scripts/sdraw.sh   |2 -
 desktop/scripts/simpress.sh|2 -
 desktop/scripts/smath.sh   |2 -
 desktop/scripts/soffice.sh |   42 +
 desktop/scripts/swriter.sh |2 -
 desktop/scripts/unoinfo-mac.sh |   12 ++-
 desktop/scripts/unoinfo.sh |   12 ++-
 desktop/scripts/unopkg.sh  |   34 -
 10 files changed, 67 insertions(+), 45 deletions(-)

New commits:
commit e6a9dc22a4e58b565894f8cdb6a19755af7b14de
Author: qarkai 
Date:   Fri Feb 3 22:05:44 2017 +0300

tdf#105204 fix shellcheck warnings in desktop/scripts

Use $(..) instead of `..`,
use && and || instead of -a and -o,
double quote to prevent word splitting,
handle cd failure.

Change-Id: I860891323a81ac4a46c868ab028df1e1f837c115
Reviewed-on: https://gerrit.libreoffice.org/33897
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/desktop/scripts/sbase.sh b/desktop/scripts/sbase.sh
index e3a8ed0..82e5e4b 100755
--- a/desktop/scripts/sbase.sh
+++ b/desktop/scripts/sbase.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-cmd=`dirname "$0"`/soffice
+cmd=$(dirname "$0")/soffice
 exec "$cmd" --base "$@"
diff --git a/desktop/scripts/scalc.sh b/desktop/scripts/scalc.sh
index c9c3cde..ff3d597 100755
--- a/desktop/scripts/scalc.sh
+++ b/desktop/scripts/scalc.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-cmd=`dirname "$0"`/soffice
+cmd=$(dirname "$0")/soffice
 exec "$cmd" --calc "$@"
diff --git a/desktop/scripts/sdraw.sh b/desktop/scripts/sdraw.sh
index 4131a25..9f7c1e4 100755
--- a/desktop/scripts/sdraw.sh
+++ b/desktop/scripts/sdraw.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-cmd=`dirname "$0"`/soffice
+cmd=$(dirname "$0")/soffice
 exec "$cmd" --draw "$@"
diff --git a/desktop/scripts/simpress.sh b/desktop/scripts/simpress.sh
index d78ea14..a1808c3 100755
--- a/desktop/scripts/simpress.sh
+++ b/desktop/scripts/simpress.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-cmd=`dirname "$0"`/soffice
+cmd=$(dirname "$0")/soffice
 exec "$cmd" --impress "$@"
diff --git a/desktop/scripts/smath.sh b/desktop/scripts/smath.sh
index 454fa13..9c05223 100755
--- a/desktop/scripts/smath.sh
+++ b/desktop/scripts/smath.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-cmd=`dirname "$0"`/soffice
+cmd=$(dirname "$0")/soffice
 exec "$cmd" --math "$@"
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 83e2263..1f7d7a23 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -39,20 +39,30 @@ 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_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"`
+sd_dirname=$(dirname "$sd_res")
+cd_or_exit "$sd_dirname"
+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"
+sd_dirname=$(dirname "$sd_res")
+cd_or_exit "$sd_dirname"
+sd_prog=$(pwd)
+cd_or_exit "$sd_cwd"
 
 # linked build needs additional settings
 if [ -e "${sd_prog}/ooenv" ] ; then
+# shellcheck source=../../instsetoo_native/ooenv
 . "${sd_prog}/ooenv"
 fi
 
@@ -71,7 +81,7 @@ test -n "$VALGRIND" && EXTRAOPT="--valgrind"
 # force the --record option if the RR variable is set
 test -n "$RR" && EXTRAOPT="--record"
 
-for arg in $@ $EXTRAOPT ; do
+for arg in "$@" $EXTRAOPT ; do
 case "$arg" in
 --record)
 if which rr >/dev/null 2>&1 ; then
@@ -106,11 +116,11 @@ for arg in $@ $EXTRAOPT ; do
 # another valgrind tool might be forced via the environment 
variable
 test -z "$VALGRIND" && VALGRIND="memcheck"
 # --trace-children-skip is pretty useful but supported only 
with valgrind >= 3.6.0
-valgrind_ver=`valgrind --version | sed -e "s/valgrind-//"`
-valgrind_ver_maj=`echo $valgrind_ver | awk -F. '{ print \$1 }'`
-valgrind_ver_min=`echo $valgrind_ver | awk -F. '{ print \$2 }'`
+valgrind_ver=$(valgrind --version | sed -e "s/valgrind-//")
+valgrind_ver_maj=$(echo "$valgrind_ver" | awk -F. '{ print \$1 
}')
+valgrind_ver_min=$(echo "$valgrind_ver" | awk -F. '{ print \$2 
}')
 valgrind_skip=
-if [ "$valgrind_ver_maj" -gt 3 -o \( "$valgrind_ver_maj" -eq 3 
-a "$valgrind_ver_min" -ge 6 \) ] ; then
+if [ "$valgrind_ver_maj" -gt 3 ] || ( [ "$valgrind_ver_maj" 
-eq 3 ] && [ "$valgrind_ver_min" -ge 6 ] ) ; then
 valgrind_skip='--trace-children-skip=*/java,*/gij'
 fi
 # finally set the valgrind 

[Libreoffice-commits] core.git: desktop/scripts

2016-11-07 Thread Michael Stahl
 desktop/scripts/soffice.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8f232026f0d6e320792ca7b65aa356724cbc945b
Author: Michael Stahl 
Date:   Fri Nov 4 20:34:11 2016 +0100

soffice.sh: can't hurt to force system allocator for massif

Change-Id: Ib999ed36befae52894c04eaa95be76f2a7cfdd3b

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 2532b1e..83e2263 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -118,7 +118,7 @@ for arg in $@ $EXTRAOPT ; do
 echo "use kill -SIGUSR2 pid to dump traces of active 
allocations"
 checks="c$checks"
 case "$VALGRIND" in
-helgrind|memcheck)
+helgrind|memcheck|massif|exp-dhat)
 export G_SLICE=always-malloc
 export GLIBCXX_FORCE_NEW=1
 ;;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2015-12-14 Thread Baptiste Daroussin
 desktop/scripts/soffice.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3a8b00910e0dbcad29e8af74f3ab1dff4645e867
Author: Baptiste Daroussin 
Date:   Sat Dec 12 00:59:50 2015 +0100

FreeBSD can live with default search path

Change-Id: I3fa26aaf57d9620e952823c303ee77e2fc642045
Reviewed-on: https://gerrit.libreoffice.org/20651
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 06a7ff7..a8c5004 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -142,7 +142,7 @@ if echo "$checks" | grep -q "cc" ; then
 fi
 
 case "`uname -s`" in
-NetBSD|OpenBSD|FreeBSD|DragonFly)
+NetBSD|OpenBSD|DragonFly)
 # this is a temporary hack until we can live with the default search paths
 LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
 JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts desktop/source

2015-06-19 Thread Katarina Behrens
 desktop/scripts/unopkg.sh   |   19 +--
 desktop/source/pkgchk/unopkg/unopkg_app.cxx |   19 +++
 2 files changed, 20 insertions(+), 18 deletions(-)

New commits:
commit c15b96a4b9ad0c37e7848e8460732e7d088529e3
Author: Katarina Behrens 
Date:   Thu Jun 18 17:00:55 2015 +0200

C++ solution of 'unopkg can't be used by root'

This way should cover all un*x-like OSes (unopkg.sh excludes
e.g. OS X)
This effectively reverts commits 723e099972c1645 and
9444ffc93a3335

Change-Id: I0b4425d1c9eff8e51e5d9a4dab35775084106a23
(cherry picked from commit faa2c06226146e3ab4b7fa8096cf213ea9d52a23)

diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index ca1e3bc..18d0a73 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -49,8 +49,6 @@ AIX)
 ;;
 esac
 
-help_mode=0
-isnotuser=0
 for arg in $@
 do
   case "$arg" in
@@ -59,25 +57,10 @@ do
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
 
# make sure shared extensions will be readable by all users
-   --shared)
-   umask 0022
-   isnotuser=1
-   ;;
-
-   --bundled) isnotuser=1;;
-   -h|--help) help_mode=1;;
+   --shared) umask 0022;;
   esac
 done
 
-# we don't really want root to run unopkg without --shared or --bundled option
-# but we might at least let him read help
-if [ "$(id -u)" -eq "0" ]; then
-if [ $isnotuser -eq 0 ] && [ $help_mode -eq 0 ]; then
- echo "Cannot run '${0} $*' as root without --shared or --bundled 
option."
- exit 1
-fi
-fi
-
 # extend the ld_library_path for java: javaldx checks the sofficerc for us
 if [ -x "${sd_prog}/javaldx" ] ; then
 my_path=`"${sd_prog}/javaldx" $BOOTSTRAPVARS \
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx 
b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index b1330da..dc79adc 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -42,6 +42,9 @@
 #include 
 #include 
 #include 
+#if defined(UNX)
+  #include 
+#endif
 #include 
 
 
@@ -186,6 +189,7 @@ extern "C" int unopkg_main()
 bool option_verbose = false;
 bool option_bundled = false;
 bool option_suppressLicense = false;
+bool option_help = false;
 bool subcmd_gui = false;
 OUString logFile;
 OUString repository;
@@ -252,6 +256,7 @@ extern "C" int unopkg_main()
  !readOption( &option_force, info_force, &nPos ) &&
  !readOption( &option_bundled, info_bundled, &nPos ) &&
  !readOption( &option_suppressLicense, 
info_suppressLicense, &nPos ) &&
+ !readOption( &option_help, info_help, &nPos ) &&
  !readArgument( &repository, info_context, &nPos ) &&
  !isBootstrapVariable(&nPos))
 {
@@ -304,6 +309,20 @@ extern "C" int unopkg_main()
 toString( info_shared ) + "!\n" );
 }
 }
+#if defined(UNX)
+if ( geteuid() == 0 )
+{
+if ( !(option_shared || option_bundled || option_help) )
+{
+dp_misc::writeConsoleError(
+"ERROR: cannot run "  APP_NAME  " as root without " +
+toString( info_shared ) + " or " + toString( info_bundled )
++ " option.\n");
+return 1;
+}
+
+}
+#endif
 
 if (subCommand == "reinstall")
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: [Libreoffice-commits] core.git: desktop/scripts

2015-06-16 Thread Stephan Bergmann
Note that any changes to the unopkg script only affect Linux, but 
neither Mac OS X (which might be unexpected) nor Windows (which is 
probably expected).


On 06/14/2015 11:26 PM, Katarina Behrens wrote:

commit 723e099972c16458af79ec0a86097d58576725d6
Author: Katarina Behrens 
Date:   Fri Jun 12 14:03:35 2015 +0200

 Don't let root run unopkg without --shared option

 with the exception of -h|--help.

 It only makes sense to run unopkg with root priviledges if adding,
 deleting etc. extensions system-wide for all users (i.e with --shared
 switch ). In all other cases it only messes up access rights to
 extensions, so prevent that. Furtheron, running LibO from the root
 account (and installing root-user-local extensions) is not a
 supported scenario.

 Change-Id: I2817f62ae0bb400cefed240e792873f563fbe76e
 Reviewed-on: https://gerrit.libreoffice.org/16250
 Reviewed-by: Thorsten Behrens 
 Tested-by: Thorsten Behrens 

diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index a9d43bf..6deb032 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh

[...]
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: desktop/scripts

2015-06-15 Thread Katarina Behrens
 desktop/scripts/unopkg.sh |   27 +++
 1 file changed, 15 insertions(+), 12 deletions(-)

New commits:
commit 9444ffc93a3335ee3f63df36512f5b278dd7596c
Author: Katarina Behrens 
Date:   Mon Jun 15 13:28:09 2015 +0200

Remove bash-ism, allow also --bundled option for root

Change-Id: I34511c7947ff78654a34a3d2bd21754b6d004420

diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 6deb032..ca1e3bc 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -49,28 +49,31 @@ AIX)
 ;;
 esac
 
-HELP_MODE=0
-SHARED_MODE=0
-#collect all bootstrap variables specified on the command line
-#so that they can be passed as arguments to javaldx later on
+help_mode=0
+isnotuser=0
 for arg in $@
 do
   case "$arg" in
+   #collect all bootstrap variables specified on the command line
+   #so that they can be passed as arguments to javaldx later on
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
+
+   # make sure shared extensions will be readable by all users
--shared)
umask 0022
-   SHARED_MODE=1
+   isnotuser=1
;;
-   # make sure shared extensions will be readable by all users
-   -h|--help) HELP_MODE=1;;
+
+   --bundled) isnotuser=1;;
+   -h|--help) help_mode=1;;
   esac
 done
 
-# we don't really want root to run unopkg without --shared option
-if [ "$EUID" -eq 0 ]; then
-# but we might at least let him read help
-if [ $SHARED_MODE -eq 0 ] && [ $HELP_MODE -eq 0 ]; then
- echo "Cannot run '${0} $*' as root (did you forget --shared option?)"
+# we don't really want root to run unopkg without --shared or --bundled option
+# but we might at least let him read help
+if [ "$(id -u)" -eq "0" ]; then
+if [ $isnotuser -eq 0 ] && [ $help_mode -eq 0 ]; then
+ echo "Cannot run '${0} $*' as root without --shared or --bundled 
option."
  exit 1
 fi
 fi
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2015-06-14 Thread Katarina Behrens
 desktop/scripts/unopkg.sh |   17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 723e099972c16458af79ec0a86097d58576725d6
Author: Katarina Behrens 
Date:   Fri Jun 12 14:03:35 2015 +0200

Don't let root run unopkg without --shared option

with the exception of -h|--help.

It only makes sense to run unopkg with root priviledges if adding,
deleting etc. extensions system-wide for all users (i.e with --shared
switch ). In all other cases it only messes up access rights to
extensions, so prevent that. Furtheron, running LibO from the root
account (and installing root-user-local extensions) is not a
supported scenario.

Change-Id: I2817f62ae0bb400cefed240e792873f563fbe76e
Reviewed-on: https://gerrit.libreoffice.org/16250
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index a9d43bf..6deb032 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -49,17 +49,32 @@ AIX)
 ;;
 esac
 
+HELP_MODE=0
+SHARED_MODE=0
 #collect all bootstrap variables specified on the command line
 #so that they can be passed as arguments to javaldx later on
 for arg in $@
 do
   case "$arg" in
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
-   --shared) umask 0022;;
+   --shared)
+   umask 0022
+   SHARED_MODE=1
+   ;;
# make sure shared extensions will be readable by all users
+   -h|--help) HELP_MODE=1;;
   esac
 done
 
+# we don't really want root to run unopkg without --shared option
+if [ "$EUID" -eq 0 ]; then
+# but we might at least let him read help
+if [ $SHARED_MODE -eq 0 ] && [ $HELP_MODE -eq 0 ]; then
+ echo "Cannot run '${0} $*' as root (did you forget --shared option?)"
+ exit 1
+fi
+fi
+
 # extend the ld_library_path for java: javaldx checks the sofficerc for us
 if [ -x "${sd_prog}/javaldx" ] ; then
 my_path=`"${sd_prog}/javaldx" $BOOTSTRAPVARS \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2015-05-12 Thread Thorsten Behrens
 desktop/scripts/soffice.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 27491725a689d98e6b327bd1faaf4258b923783f
Author: Thorsten Behrens 
Date:   Tue May 12 10:36:51 2015 +0200

Fixup my earlier quoting fix.

Change-Id: I9a7afb28e09f7f8aa577e180f647839d67964bdf

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 3a83c22..8729368 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -57,7 +57,7 @@ cd "$sd_cwd"
 
 # linked build needs additional settings
 if [ -e "${sd_prog}/ooenv" ] ; then
-. "${sd_prog}/ooenv}"
+. "${sd_prog}/ooenv"
 fi
 
 # try to get some debug output?
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2015-05-11 Thread Thorsten Behrens
 desktop/scripts/soffice.sh |   14 +++---
 desktop/scripts/unoinfo-mac.sh |4 ++--
 desktop/scripts/unoinfo.sh |4 ++--
 desktop/scripts/unopkg.sh  |   16 
 4 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 23c0e00b50f7fae7a82134ef064eabf9514a941b
Author: Thorsten Behrens 
Date:   Mon May 11 22:58:25 2015 +0200

Add some quoting to shell scripts.

I'd be surprised if the places given want globs and word
splitting...

Change-Id: I0eb9f2d39ac43479ee06a2477ba309a8e1944d20

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index b1ab4c9..3a83c22 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -18,7 +18,7 @@
 #
 
 # use POSIX locale for well-defined tool output
-LO_SAVE_LC_ALL=$LC_ALL
+LO_SAVE_LC_ALL="$LC_ALL"
 LC_ALL=C
 export LC_ALL
 
@@ -45,7 +45,7 @@ export SAL_ENABLE_FILE_LOCKING
 
 # resolve installation directory
 sd_cwd=`pwd`
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
 cd "`dirname "$sd_res"`"
 sd_basename=`basename "$sd_res"`
@@ -56,8 +56,8 @@ sd_prog=`pwd`
 cd "$sd_cwd"
 
 # linked build needs additional settings
-if [ -e $sd_prog/ooenv ] ; then
-. $sd_prog/ooenv
+if [ -e "${sd_prog}/ooenv" ] ; then
+. "${sd_prog}/ooenv}"
 fi
 
 # try to get some debug output?
@@ -107,7 +107,7 @@ for arg in $@ $VALGRINDOPT ; do
 VALGRINDCHECK="valgrind --tool=$VALGRIND --trace-children=yes 
$valgrind_skip --num-callers=50 --error-limit=no"
 echo "use kill -SIGUSR2 pid to dump traces of active 
allocations"
 checks="c$checks"
-case $VALGRIND in
+case "$VALGRIND" in
 helgrind|memcheck)
 export G_SLICE=always-malloc
 export GLIBCXX_FORCE_NEW=1
@@ -130,7 +130,7 @@ fi
 case "`uname -s`" in
 NetBSD|OpenBSD|FreeBSD|DragonFly)
 # this is a temporary hack until we can live with the default search paths
-LD_LIBRARY_PATH=$sd_prog${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
 JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
 export LD_LIBRARY_PATH
 if [ -n "${JAVA_HOME}" ]; then
@@ -138,7 +138,7 @@ NetBSD|OpenBSD|FreeBSD|DragonFly)
 fi
 ;;
 AIX)
-LIBPATH=$sd_prog${LIBPATH:+:$LIBPATH}
+LIBPATH="$sd_prog${LIBPATH:+:$LIBPATH}"
 export LIBPATH
 ;;
 esac
diff --git a/desktop/scripts/unoinfo-mac.sh b/desktop/scripts/unoinfo-mac.sh
index 3c482fc..ca15291 100755
--- a/desktop/scripts/unoinfo-mac.sh
+++ b/desktop/scripts/unoinfo-mac.sh
@@ -20,7 +20,7 @@
 set -e
 
 # resolve installation directory
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
 cd "`dirname "$sd_res"`"
 sd_basename=`basename "$sd_res"`
@@ -29,7 +29,7 @@ done
 cd "`dirname "$sd_res"`"
 sd_prog=`pwd`
 
-case $1 in
+case "$1" in
 c++)
 printf '%s' "$sd_prog/../Frameworks"
 ;;
diff --git a/desktop/scripts/unoinfo.sh b/desktop/scripts/unoinfo.sh
index 464d1b8..bf5b14f 100755
--- a/desktop/scripts/unoinfo.sh
+++ b/desktop/scripts/unoinfo.sh
@@ -20,7 +20,7 @@
 set -e
 
 # resolve installation directory
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
 cd "`dirname "$sd_res"`"
 sd_basename=`basename "$sd_res"`
@@ -29,7 +29,7 @@ done
 cd "`dirname "$sd_res"`"
 sd_prog=`pwd`
 
-case $1 in
+case "$1" in
 c++)
 printf '%s' "$sd_prog"
 ;;
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index f21e4d1..a9d43bf 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -23,7 +23,7 @@ export SAL_ENABLE_FILE_LOCKING
 
 # resolve installation directory
 sd_cwd=`pwd`
-sd_res=$0
+sd_res="$0"
 while [ -h "$sd_res" ] ; do
 cd "`dirname "$sd_res"`"
 sd_basename=`basename "$sd_res"`
@@ -36,7 +36,7 @@ cd "$sd_cwd"
 # this is a temporary hack until we can live with the default search paths
 case "`uname -s`" in
 NetBSD|OpenBSD|FreeBSD|DragonFly)
-LD_LIBRARY_PATH=$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+LD_LIBRARY_PATH="$sd_prog${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
 JAVA_HOME=$(javaPathHelper -h libreoffice-java 2> /dev/null)
 export LD_LIBRARY_PATH
 if [ -n "${JAVA_HOME}" ]; then
@@ -44,7 +44,7 @@ NetBSD|OpenBSD|FreeBSD|DragonFly)
 fi
 ;;
 AIX)
-LIBPATH=$sd_prog${LIBPATH:+:${LIBPATH}}
+LIBPATH="$sd_prog${LIBPATH:+:${LIBPATH}}"
 export LIBPATH
 ;;
 esac
@@ -61,18 +61,18 @@ do
 done
 
 # extend the ld_library_path for java: javaldx checks the sofficerc for us
-if [ -x "$sd_prog/javaldx" ] ; then
-my_path=`"$sd_prog/javaldx" $BOOTSTRAPVARS \
+if [ -x "${sd_prog}/javaldx" ] ; then
+my_path=`"${sd_prog}/javaldx" $BOOTSTRAPVARS \
 "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
 if [ -n "$my_path" ] ; then
 sd_platform=`uname -s`
-case $sd_platform in
+case "$sd_platform" in
   AIX)
-LIBPAT

[Libreoffice-commits] core.git: desktop/scripts

2014-05-08 Thread Stephan Bergmann
 desktop/scripts/soffice.sh |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 95343c998a078b30ca83d2e1be40149f7f56fed7
Author: Stephan Bergmann 
Date:   Thu May 8 12:11:24 2014 +0200

Disable rtl/alloc.h also for Helgrind

Change-Id: I472d11d50a3b0810779108f3f81624ab9880fe8b

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 6d5dc38..26fb776 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -107,10 +107,12 @@ for arg in $@ $VALGRINDOPT ; do
 VALGRINDCHECK="valgrind --tool=$VALGRIND --trace-children=yes 
$valgrind_skip --num-callers=50 --error-limit=no"
 echo "use kill -SIGUSR2 pid to dump traces of active 
allocations"
 checks="c$checks"
-if [ "$VALGRIND" = "memcheck" ] ; then
+case $VALGRIND in
+helgrind|memcheck)
 export G_SLICE=always-malloc
 export GLIBCXX_FORCE_NEW=1
-fi
+;;
+esac
 else
 echo "Error: Can't find the tool \"valgrind\", --valgrind 
option will be ignored"
 exit 1
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2013-10-17 Thread Stephan Bergmann
 desktop/scripts/unopkg.sh |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 1fc195f7e830619d56cc4c56043b154bc3a72b02
Author: Stephan Bergmann 
Date:   Thu Oct 17 15:34:53 2013 +0200

Simplify code (VERBOSE was unused)

Change-Id: I281be165fe110fee3e174e96e11cdbc4aa5671e0

diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 846c2eb..d16d226 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -59,15 +59,11 @@ for arg in $@
 do
   case "$arg" in
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
-   -v) VERBOSE=true;;
-   --verbose) VERBOSE=true;;
-   --shared) SHARED=true;;
+   --shared) umask 0022;;
+   # make sure shared extensions will be readable by all users
   esac
 done
 
-#make sure shared extensions will be readable by all users
-[ "$SHARED" = true ] && umask 0022
-
 # extend the ld_library_path for java: javaldx checks the sofficerc for us
 if [ -x "$sd_prog/../ure-link/bin/javaldx" ] ; then
 my_path=`"$sd_prog/../ure-link/bin/javaldx" $BOOTSTRAPVARS \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2013-10-17 Thread Stephan Bergmann
 desktop/scripts/unopkg.sh |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 15be40969c107f073a3fa7f5fd67e8012ffdcbb3
Author: Stephan Bergmann 
Date:   Thu Oct 17 11:51:15 2013 +0200

Fix quoting

Change-Id: Ie2228247f5edc107ed183a25ef30256d8041e000

diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index 295f874..846c2eb 100755
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -66,7 +66,7 @@ do
 done
 
 #make sure shared extensions will be readable by all users
-[ $SHARED = true ] && umask 0022
+[ "$SHARED" = true ] && umask 0022
 
 # extend the ld_library_path for java: javaldx checks the sofficerc for us
 if [ -x "$sd_prog/../ure-link/bin/javaldx" ] ; then
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2013-10-17 Thread Stephan Bergmann
 0 files changed

New commits:
commit d879a74ee2d8baad5de4edc4e13144d3cc0c6bf0
Author: Stephan Bergmann 
Date:   Thu Oct 17 11:44:02 2013 +0200

Scripts need executable bit

...or else they would end up non-executable in instdir, now that they are
directly copied there via desktop/Package_scripts_install.mk.

Change-Id: I8d2add1fd7f13ae9080d2f710b5fbb60d1e8ad1a

diff --git a/desktop/scripts/unoinfo.sh b/desktop/scripts/unoinfo.sh
old mode 100644
new mode 100755
diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
old mode 100644
new mode 100755
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2013-08-20 Thread Björgvin Ragnarsson
 desktop/scripts/unopkg.sh |4 
 1 file changed, 4 insertions(+)

New commits:
commit d2ed00f711d71cd2efe87e19dadfb0b413a7b5fe
Author: Björgvin Ragnarsson 
Date:   Tue Aug 20 00:33:37 2013 +

unopkg: use default umask when installing shared extensions

This makes sure shared extensions are readable by users when root's umask 
has been
set to a value such as 0027.

Change-Id: If495afae8eaf3a640c99ecb7598b79b59363c12c
Reviewed-on: https://gerrit.libreoffice.org/5521
Reviewed-by: Petr Mladek 
Tested-by: Petr Mladek 

diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh
index d0bb430..295f874 100644
--- a/desktop/scripts/unopkg.sh
+++ b/desktop/scripts/unopkg.sh
@@ -61,9 +61,13 @@ do
-env:*) BOOTSTRAPVARS=$BOOTSTRAPVARS" ""$arg";;
-v) VERBOSE=true;;
--verbose) VERBOSE=true;;
+   --shared) SHARED=true;;
   esac
 done
 
+#make sure shared extensions will be readable by all users
+[ $SHARED = true ] && umask 0022
+
 # extend the ld_library_path for java: javaldx checks the sofficerc for us
 if [ -x "$sd_prog/../ure-link/bin/javaldx" ] ; then
 my_path=`"$sd_prog/../ure-link/bin/javaldx" $BOOTSTRAPVARS \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/scripts

2013-07-09 Thread Erik Auerswald
 desktop/scripts/soffice.sh |8 
 1 file changed, 8 insertions(+)

New commits:
commit e75b8e9b4bf720f3bcf479c6915d7815bf8f3e6e
Author: Erik Auerswald 
Date:   Tue Jul 9 23:37:39 2013 +0200

fdo#62192: broken launch script, bork in March in Germany

Change-Id: I0b726a696fe64ffb80a0cf367d5fa6225619ec92

diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index d34f1c3..d08f52a 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -17,6 +17,11 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 
+# use POSIX locale for well-defined tool output
+LO_SAVE_LC_ALL=$LC_ALL
+LC_ALL=C
+export LC_ALL
+
 #
 # STAR_PROFILE_LOCKING_DISABLED=1
 # export STAR_PROFILE_LOCKING_DISABLED
@@ -138,6 +143,9 @@ AIX)
 ;;
 esac
 
+# restore locale setting
+LC_ALL="$LO_SAVE_LC_ALL"
+
 # run soffice.bin directly when you want to get the backtrace
 if [ -n "$GDBTRACECHECK" ] ; then
 exec $GDBTRACECHECK "$sd_prog/soffice.bin" "$@"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits