On 03/07/2013 02:52 PM, Jiri Moskovcak wrote:
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/plugins/abrt-action-analyze-ccpp-local | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/plugins/abrt-action-analyze-ccpp-local
b/src/plugins/abrt-action-analyze-ccpp-local
index 0c5ab34..1c36f15 100755
--- a/src/plugins/abrt-action-analyze-ccpp-local
+++ b/src/plugins/abrt-action-analyze-ccpp-local
@@ -1,9 +1,18 @@
#! /bin/sh
-if [ "`id -u`x" == "0x" ]; then
- abrt-action-analyze-core --core=coredump | abrt-action-install-debuginfo --ids=-
--size_mb=4096
-else
- abrt-action-analyze-core --core=coredump |
/usr/libexec/abrt-action-install-debuginfo-to-abrt-cache --ids=- --size_mb=4096
-fi;
+
+INSTALL_DI=true
+for opt in "$@"; do
+ if [ $opt = "--without-di" ]; then
+ INSTALL_DI=false
+ fi;
+done
+if $INSTALL_DI; then
+ if [ "`id -u`x" == "0x" ]; then
The "x" trick should prepend x, not append:
if [ x"`id -u`" == x"0" ]; then
It is meant to defeat the case when $var or `cmd` resolves
to a string with leading dash, i.e. a string which looks like an option.
+ abrt-action-analyze-core --core=coredump |
abrt-action-install-debuginfo --ids=- --size_mb=4096
+ else
+ abrt-action-analyze-core --core=coredump |
/usr/libexec/abrt-action-install-debuginfo-to-abrt-cache --ids=- --size_mb=4096
+ fi
+fi
if [ "$?x" == "0x" ]; then
abrt-action-generate-backtrace &&
Pushed to git with small edits. Thanks!