|
|
baab13 |
From 40823feb83cc2a7ad7aac8fb0da1ff7c0773eb2a Mon Sep 17 00:00:00 2001
|
|
|
baab13 |
From: Jakub Filak <jfilak@redhat.com>
|
|
|
baab13 |
Date: Mon, 14 Jul 2014 16:06:17 +0200
|
|
|
baab13 |
Subject: [ABRT PATCH 44/66] localization fixes
|
|
|
baab13 |
|
|
|
baab13 |
commit fc0f32d878bb93e7498340224281fa526b4aeaf7
|
|
|
baab13 |
Author: Jakub Filak <jfilak@redhat.com>
|
|
|
baab13 |
Date: Wed Apr 16 12:03:31 2014 +0200
|
|
|
baab13 |
|
|
|
baab13 |
localization: fix gettext
|
|
|
baab13 |
|
|
|
baab13 |
https://www.gnu.org/software/gettext/manual/html_node/Libraries.html
|
|
|
baab13 |
|
|
|
baab13 |
commit f8533576b349f346acafdc7c0182a995a569a443
|
|
|
baab13 |
Author: Jakub Filak <jfilak@redhat.com>
|
|
|
baab13 |
Date: Wed Apr 16 21:08:29 2014 +0200
|
|
|
baab13 |
|
|
|
baab13 |
do not clear LANG env variable
|
|
|
baab13 |
abrt-action-install-debuginfo-to-abrt-cache
|
|
|
baab13 |
|
|
|
baab13 |
commit d05e231eaf05dc6680be031741d1d7593445f70d
|
|
|
baab13 |
Author: Jakub Filak <jfilak@redhat.com>
|
|
|
baab13 |
Date: Wed Apr 16 21:13:44 2014 +0200
|
|
|
baab13 |
|
|
|
baab13 |
a-a-a-core: fix localization
|
|
|
baab13 |
|
|
|
baab13 |
The strings of that file are not translated at all because
|
|
|
baab13 |
the file was not included in POTFILES.in
|
|
|
baab13 |
|
|
|
baab13 |
Resolves rhbz#1087880
|
|
|
baab13 |
|
|
|
baab13 |
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
|
|
baab13 |
---
|
|
|
baab13 |
po/POTFILES.in | 1 +
|
|
|
baab13 |
src/configuration-gui/system-config-abrt.c | 4 +-
|
|
|
baab13 |
src/include/Makefile.am | 3 +
|
|
|
baab13 |
src/include/internal_libabrt.h | 50 ++++++
|
|
|
baab13 |
src/include/libabrt.h | 15 --
|
|
|
baab13 |
src/lib/Makefile.am | 3 +
|
|
|
baab13 |
src/lib/hooklib.c | 4 +-
|
|
|
baab13 |
src/lib/ignored_problems.c | 4 +-
|
|
|
baab13 |
src/lib/libabrt_init.c | 28 ++++
|
|
|
baab13 |
src/lib/problem_api_dbus.c | 10 +-
|
|
|
baab13 |
src/plugins/Makefile.am | 8 +-
|
|
|
baab13 |
src/plugins/abrt-action-analyze-core | 186 ---------------------
|
|
|
baab13 |
src/plugins/abrt-action-analyze-core.in | 186 +++++++++++++++++++++
|
|
|
baab13 |
.../abrt-action-install-debuginfo-to-abrt-cache.c | 3 +-
|
|
|
baab13 |
14 files changed, 298 insertions(+), 207 deletions(-)
|
|
|
baab13 |
create mode 100644 src/include/internal_libabrt.h
|
|
|
baab13 |
create mode 100644 src/lib/libabrt_init.c
|
|
|
baab13 |
delete mode 100644 src/plugins/abrt-action-analyze-core
|
|
|
baab13 |
create mode 100644 src/plugins/abrt-action-analyze-core.in
|
|
|
baab13 |
|
|
|
baab13 |
diff --git a/po/POTFILES.in b/po/POTFILES.in
|
|
|
baab13 |
index 2c36802..ff9b97a 100644
|
|
|
baab13 |
--- a/po/POTFILES.in
|
|
|
baab13 |
+++ b/po/POTFILES.in
|
|
|
baab13 |
@@ -21,6 +21,7 @@ src/lib/problem_api_dbus.c
|
|
|
baab13 |
src/lib/ignored_problems.c
|
|
|
baab13 |
src/plugins/abrt-action-analyze-backtrace.c
|
|
|
baab13 |
src/plugins/abrt-action-analyze-c.c
|
|
|
baab13 |
+src/plugins/abrt-action-analyze-core.in
|
|
|
baab13 |
src/plugins/abrt-action-analyze-oops.c
|
|
|
baab13 |
src/plugins/abrt-action-analyze-xorg.c
|
|
|
baab13 |
src/plugins/abrt-action-analyze-python.c
|
|
|
baab13 |
diff --git a/src/configuration-gui/system-config-abrt.c b/src/configuration-gui/system-config-abrt.c
|
|
|
baab13 |
index b15a5ef..bd9f13f 100644
|
|
|
baab13 |
--- a/src/configuration-gui/system-config-abrt.c
|
|
|
baab13 |
+++ b/src/configuration-gui/system-config-abrt.c
|
|
|
baab13 |
@@ -18,7 +18,7 @@
|
|
|
baab13 |
#include "system-config-abrt.h"
|
|
|
baab13 |
#include "abrt-config-widget.h"
|
|
|
baab13 |
|
|
|
baab13 |
-#include <libabrt.h>
|
|
|
baab13 |
+#include "internal_libabrt.h"
|
|
|
baab13 |
|
|
|
baab13 |
#define CLOSE_BUTTON_DATA_NAME_CALLBACK "my-close-callback"
|
|
|
baab13 |
#define CLOSE_BUTTON_DATA_NAME_USER_DATA "my-close-user-data"
|
|
|
baab13 |
@@ -105,6 +105,8 @@ system_config_abrt_dialog_delete_event(GtkWidget *dialog, GdkEvent *event, gpoin
|
|
|
baab13 |
|
|
|
baab13 |
void show_system_config_abrt_dialog(GtkWindow *parent)
|
|
|
baab13 |
{
|
|
|
baab13 |
+ INITIALIZE_LIBABRT();
|
|
|
baab13 |
+
|
|
|
baab13 |
GtkWidget *dialog = gtk_dialog_new();
|
|
|
baab13 |
|
|
|
baab13 |
gtk_window_set_title(GTK_WINDOW(dialog), _("Problem Reporting Configuration"));
|
|
|
baab13 |
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
|
|
|
baab13 |
index 49a6f5c..c1952cb 100644
|
|
|
baab13 |
--- a/src/include/Makefile.am
|
|
|
baab13 |
+++ b/src/include/Makefile.am
|
|
|
baab13 |
@@ -6,3 +6,6 @@ libabrt_include_HEADERS = \
|
|
|
baab13 |
abrt-dbus.h \
|
|
|
baab13 |
hooklib.h \
|
|
|
baab13 |
problem_api.h
|
|
|
baab13 |
+
|
|
|
baab13 |
+EXTRA_DIST = \
|
|
|
baab13 |
+ internal_libabrt.h
|
|
|
baab13 |
diff --git a/src/include/internal_libabrt.h b/src/include/internal_libabrt.h
|
|
|
baab13 |
new file mode 100644
|
|
|
baab13 |
index 0000000..3ad22fc
|
|
|
baab13 |
--- /dev/null
|
|
|
baab13 |
+++ b/src/include/internal_libabrt.h
|
|
|
baab13 |
@@ -0,0 +1,50 @@
|
|
|
baab13 |
+/*
|
|
|
baab13 |
+ Copyright (C) 2014 ABRT team
|
|
|
baab13 |
+ Copyright (C) 2014 RedHat Inc
|
|
|
baab13 |
+
|
|
|
baab13 |
+ This program is free software; you can redistribute it and/or modify
|
|
|
baab13 |
+ it under the terms of the GNU General Public License as published by
|
|
|
baab13 |
+ the Free Software Foundation; either version 2 of the License, or
|
|
|
baab13 |
+ (at your option) any later version.
|
|
|
baab13 |
+
|
|
|
baab13 |
+ This program is distributed in the hope that it will be useful,
|
|
|
baab13 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
baab13 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
baab13 |
+ GNU General Public License for more details.
|
|
|
baab13 |
+
|
|
|
baab13 |
+ You should have received a copy of the GNU General Public License along
|
|
|
baab13 |
+ with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
baab13 |
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
baab13 |
+*/
|
|
|
baab13 |
+
|
|
|
baab13 |
+#include "libabrt.h"
|
|
|
baab13 |
+
|
|
|
baab13 |
+#ifdef HAVE_CONFIG_H
|
|
|
baab13 |
+# include "config.h"
|
|
|
baab13 |
+#endif
|
|
|
baab13 |
+
|
|
|
baab13 |
+#undef NORETURN
|
|
|
baab13 |
+#define NORETURN __attribute__ ((noreturn))
|
|
|
baab13 |
+
|
|
|
baab13 |
+/* Must be after #include "config.h" */
|
|
|
baab13 |
+#if ENABLE_NLS
|
|
|
baab13 |
+# include <libintl.h>
|
|
|
baab13 |
+# define _(S) dgettext(PACKAGE, S)
|
|
|
baab13 |
+#else
|
|
|
baab13 |
+# define _(S) (S)
|
|
|
baab13 |
+#endif
|
|
|
baab13 |
+
|
|
|
baab13 |
+extern int g_libabrt_inited;
|
|
|
baab13 |
+void libabrt_init(void);
|
|
|
baab13 |
+
|
|
|
baab13 |
+#define INITIALIZE_LIBABRT() \
|
|
|
baab13 |
+ do \
|
|
|
baab13 |
+ { \
|
|
|
baab13 |
+ if (!g_libabrt_inited) \
|
|
|
baab13 |
+ { \
|
|
|
baab13 |
+ g_libabrt_inited = 1; \
|
|
|
baab13 |
+ libabrt_init(); \
|
|
|
baab13 |
+ } \
|
|
|
baab13 |
+ } \
|
|
|
baab13 |
+ while (0)
|
|
|
baab13 |
+
|
|
|
baab13 |
diff --git a/src/include/libabrt.h b/src/include/libabrt.h
|
|
|
baab13 |
index d5911e7..3e42a09 100644
|
|
|
baab13 |
--- a/src/include/libabrt.h
|
|
|
baab13 |
+++ b/src/include/libabrt.h
|
|
|
baab13 |
@@ -15,21 +15,6 @@
|
|
|
baab13 |
#include <libreport/internal_libreport.h>
|
|
|
baab13 |
#include "hooklib.h"
|
|
|
baab13 |
|
|
|
baab13 |
-#ifdef HAVE_CONFIG_H
|
|
|
baab13 |
-# include "config.h"
|
|
|
baab13 |
-#endif
|
|
|
baab13 |
-
|
|
|
baab13 |
-/* Must be after #include "config.h" */
|
|
|
baab13 |
-#if ENABLE_NLS
|
|
|
baab13 |
-# include <libintl.h>
|
|
|
baab13 |
-# define _(S) gettext(S)
|
|
|
baab13 |
-#else
|
|
|
baab13 |
-# define _(S) (S)
|
|
|
baab13 |
-#endif
|
|
|
baab13 |
-
|
|
|
baab13 |
-#undef NORETURN
|
|
|
baab13 |
-#define NORETURN __attribute__ ((noreturn))
|
|
|
baab13 |
-
|
|
|
baab13 |
#undef ARRAY_SIZE
|
|
|
baab13 |
#define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0])))
|
|
|
baab13 |
|
|
|
baab13 |
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
|
|
|
baab13 |
index 5c281d2..32a054a 100644
|
|
|
baab13 |
--- a/src/lib/Makefile.am
|
|
|
baab13 |
+++ b/src/lib/Makefile.am
|
|
|
baab13 |
@@ -5,6 +5,7 @@ lib_LTLIBRARIES = \
|
|
|
baab13 |
libabrt.la
|
|
|
baab13 |
|
|
|
baab13 |
libabrt_la_SOURCES = \
|
|
|
baab13 |
+ libabrt_init.c \
|
|
|
baab13 |
abrt_conf.c \
|
|
|
baab13 |
hooklib.c \
|
|
|
baab13 |
daemon_is_ok.c \
|
|
|
baab13 |
@@ -40,3 +41,5 @@ libabrt_la_LIBADD = \
|
|
|
baab13 |
$(GIO_LIBS) \
|
|
|
baab13 |
$(LIBREPORT_LIBS) \
|
|
|
baab13 |
$(SATYR_LIBS)
|
|
|
baab13 |
+
|
|
|
baab13 |
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
|
|
baab13 |
diff --git a/src/lib/hooklib.c b/src/lib/hooklib.c
|
|
|
baab13 |
index 23447df..4a50727 100644
|
|
|
baab13 |
--- a/src/lib/hooklib.c
|
|
|
baab13 |
+++ b/src/lib/hooklib.c
|
|
|
baab13 |
@@ -16,7 +16,7 @@
|
|
|
baab13 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
baab13 |
*/
|
|
|
baab13 |
#include <sys/statvfs.h>
|
|
|
baab13 |
-#include "libabrt.h"
|
|
|
baab13 |
+#include "internal_libabrt.h"
|
|
|
baab13 |
|
|
|
baab13 |
int low_free_space(unsigned setting_MaxCrashReportsSize, const char *dump_location)
|
|
|
baab13 |
{
|
|
|
baab13 |
@@ -241,6 +241,8 @@ char *run_unstrip_n(const char *dump_dir_name, unsigned timeout_sec)
|
|
|
baab13 |
|
|
|
baab13 |
char *get_backtrace(const char *dump_dir_name, unsigned timeout_sec, const char *debuginfo_dirs)
|
|
|
baab13 |
{
|
|
|
baab13 |
+ INITIALIZE_LIBABRT();
|
|
|
baab13 |
+
|
|
|
baab13 |
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
|
|
|
baab13 |
if (!dd)
|
|
|
baab13 |
return NULL;
|
|
|
baab13 |
diff --git a/src/lib/ignored_problems.c b/src/lib/ignored_problems.c
|
|
|
baab13 |
index df138d8..7779c4c 100644
|
|
|
baab13 |
--- a/src/lib/ignored_problems.c
|
|
|
baab13 |
+++ b/src/lib/ignored_problems.c
|
|
|
baab13 |
@@ -17,7 +17,7 @@
|
|
|
baab13 |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
baab13 |
*/
|
|
|
baab13 |
|
|
|
baab13 |
-#include "libabrt.h"
|
|
|
baab13 |
+#include "internal_libabrt.h"
|
|
|
baab13 |
|
|
|
baab13 |
#define IGN_COLUMN_DELIMITER ';'
|
|
|
baab13 |
#define IGN_DD_OPEN_FLAGS (DD_OPEN_READONLY | DD_FAIL_QUIETLY_ENOENT | DD_FAIL_QUIETLY_EACCES)
|
|
|
baab13 |
@@ -193,6 +193,8 @@ void ignored_problems_add(ignored_problems_t *set, const char *problem_id)
|
|
|
baab13 |
void ignored_problems_remove_row(ignored_problems_t *set, const char *problem_id,
|
|
|
baab13 |
const char *uuid, const char *duphash)
|
|
|
baab13 |
{
|
|
|
baab13 |
+ INITIALIZE_LIBABRT();
|
|
|
baab13 |
+
|
|
|
baab13 |
VERB1 log("Going to remove problem '%s' from ignored problems", problem_id);
|
|
|
baab13 |
|
|
|
baab13 |
FILE *orig_fp;
|
|
|
baab13 |
diff --git a/src/lib/libabrt_init.c b/src/lib/libabrt_init.c
|
|
|
baab13 |
new file mode 100644
|
|
|
baab13 |
index 0000000..f9c1449
|
|
|
baab13 |
--- /dev/null
|
|
|
baab13 |
+++ b/src/lib/libabrt_init.c
|
|
|
baab13 |
@@ -0,0 +1,28 @@
|
|
|
baab13 |
+/*
|
|
|
baab13 |
+ Copyright (C) 2014 ABRT team
|
|
|
baab13 |
+ Copyright (C) 2014 RedHat Inc
|
|
|
baab13 |
+
|
|
|
baab13 |
+ This program is free software; you can redistribute it and/or modify
|
|
|
baab13 |
+ it under the terms of the GNU General Public License as published by
|
|
|
baab13 |
+ the Free Software Foundation; either version 2 of the License, or
|
|
|
baab13 |
+ (at your option) any later version.
|
|
|
baab13 |
+
|
|
|
baab13 |
+ This program is distributed in the hope that it will be useful,
|
|
|
baab13 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
baab13 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
baab13 |
+ GNU General Public License for more details.
|
|
|
baab13 |
+
|
|
|
baab13 |
+ You should have received a copy of the GNU General Public License along
|
|
|
baab13 |
+ with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
baab13 |
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
baab13 |
+*/
|
|
|
baab13 |
+#include "internal_libabrt.h"
|
|
|
baab13 |
+
|
|
|
baab13 |
+int g_libabrt_inited;
|
|
|
baab13 |
+
|
|
|
baab13 |
+void libabrt_init(void)
|
|
|
baab13 |
+{
|
|
|
baab13 |
+#if ENABLE_NLS
|
|
|
baab13 |
+ bindtextdomain(PACKAGE, LOCALEDIR);
|
|
|
baab13 |
+#endif
|
|
|
baab13 |
+}
|
|
|
baab13 |
diff --git a/src/lib/problem_api_dbus.c b/src/lib/problem_api_dbus.c
|
|
|
baab13 |
index 784a43f..2d77898 100644
|
|
|
baab13 |
--- a/src/lib/problem_api_dbus.c
|
|
|
baab13 |
+++ b/src/lib/problem_api_dbus.c
|
|
|
baab13 |
@@ -18,7 +18,7 @@
|
|
|
baab13 |
*/
|
|
|
baab13 |
|
|
|
baab13 |
#include "abrt_glib.h"
|
|
|
baab13 |
-#include "libabrt.h"
|
|
|
baab13 |
+#include "internal_libabrt.h"
|
|
|
baab13 |
|
|
|
baab13 |
static GDBusProxy *get_dbus_proxy(void)
|
|
|
baab13 |
{
|
|
|
baab13 |
@@ -48,6 +48,8 @@ static GDBusProxy *get_dbus_proxy(void)
|
|
|
baab13 |
|
|
|
baab13 |
int chown_dir_over_dbus(const char *problem_dir_path)
|
|
|
baab13 |
{
|
|
|
baab13 |
+ INITIALIZE_LIBABRT();
|
|
|
baab13 |
+
|
|
|
baab13 |
GDBusProxy *proxy = get_dbus_proxy();
|
|
|
baab13 |
if (!proxy)
|
|
|
baab13 |
return 1;
|
|
|
baab13 |
@@ -72,6 +74,8 @@ int chown_dir_over_dbus(const char *problem_dir_path)
|
|
|
baab13 |
|
|
|
baab13 |
int delete_problem_dirs_over_dbus(const GList *problem_dir_paths)
|
|
|
baab13 |
{
|
|
|
baab13 |
+ INITIALIZE_LIBABRT();
|
|
|
baab13 |
+
|
|
|
baab13 |
GDBusProxy *proxy = get_dbus_proxy();
|
|
|
baab13 |
if (!proxy)
|
|
|
baab13 |
return 1;
|
|
|
baab13 |
@@ -99,6 +103,8 @@ int delete_problem_dirs_over_dbus(const GList *problem_dir_paths)
|
|
|
baab13 |
|
|
|
baab13 |
problem_data_t *get_problem_data_dbus(const char *problem_dir_path)
|
|
|
baab13 |
{
|
|
|
baab13 |
+ INITIALIZE_LIBABRT();
|
|
|
baab13 |
+
|
|
|
baab13 |
GDBusProxy *proxy = get_dbus_proxy();
|
|
|
baab13 |
if (!proxy)
|
|
|
baab13 |
return NULL;
|
|
|
baab13 |
@@ -143,6 +149,8 @@ problem_data_t *get_problem_data_dbus(const char *problem_dir_path)
|
|
|
baab13 |
|
|
|
baab13 |
GList *get_problems_over_dbus(bool authorize)
|
|
|
baab13 |
{
|
|
|
baab13 |
+ INITIALIZE_LIBABRT();
|
|
|
baab13 |
+
|
|
|
baab13 |
GDBusProxy *proxy = get_dbus_proxy();
|
|
|
baab13 |
if (!proxy)
|
|
|
baab13 |
return ERR_PTR;
|
|
|
baab13 |
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
|
|
|
baab13 |
index dd32c7d..727dae0 100644
|
|
|
baab13 |
--- a/src/plugins/Makefile.am
|
|
|
baab13 |
+++ b/src/plugins/Makefile.am
|
|
|
baab13 |
@@ -89,6 +89,7 @@ EXTRA_DIST = \
|
|
|
baab13 |
analyze_LocalGDB.xml.in \
|
|
|
baab13 |
analyze_RetraceServer.xml.in \
|
|
|
baab13 |
analyze_VMcore.xml.in \
|
|
|
baab13 |
+ abrt-action-analyze-core.in \
|
|
|
baab13 |
abrt-action-analyze-vmcore \
|
|
|
baab13 |
abrt-action-check-oops-for-hw-error \
|
|
|
baab13 |
abrt-action-save-kernel-data \
|
|
|
baab13 |
@@ -306,7 +307,7 @@ endif
|
|
|
baab13 |
|
|
|
baab13 |
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
|
|
baab13 |
|
|
|
baab13 |
-DISTCLEANFILES = abrt-action-analyze-ccpp-local
|
|
|
baab13 |
+DISTCLEANFILES = abrt-action-analyze-ccpp-local abrt-action-analyze-core
|
|
|
baab13 |
|
|
|
baab13 |
abrt-action-perform-ccpp-analysis: abrt-action-perform-ccpp-analysis.in
|
|
|
baab13 |
sed -e s,\@libexecdir\@,$(libexecdir),g \
|
|
|
baab13 |
@@ -315,3 +316,8 @@ abrt-action-perform-ccpp-analysis: abrt-action-perform-ccpp-analysis.in
|
|
|
baab13 |
abrt-action-analyze-ccpp-local: abrt-action-analyze-ccpp-local.in
|
|
|
baab13 |
sed -e s,\@LIBEXEC_DIR\@,$(libexecdir),g \
|
|
|
baab13 |
$< >$@
|
|
|
baab13 |
+
|
|
|
baab13 |
+abrt-action-analyze-core: abrt-action-analyze-core.in
|
|
|
baab13 |
+ sed -e s,\@localedir\@,$(localedir),g \
|
|
|
baab13 |
+ -e s,\@PACKAGE\@,$(PACKAGE),g \
|
|
|
baab13 |
+ $< >$@
|
|
|
baab13 |
diff --git a/src/plugins/abrt-action-analyze-core b/src/plugins/abrt-action-analyze-core
|
|
|
baab13 |
deleted file mode 100644
|
|
|
baab13 |
index 806cc26..0000000
|
|
|
baab13 |
--- a/src/plugins/abrt-action-analyze-core
|
|
|
baab13 |
+++ /dev/null
|
|
|
baab13 |
@@ -1,186 +0,0 @@
|
|
|
baab13 |
-#!/usr/bin/python -u
|
|
|
baab13 |
-# -*- coding: utf-8 -*-
|
|
|
baab13 |
-# WARNING: python -u means unbuffered I/O. Without it the messages are
|
|
|
baab13 |
-# passed to the parent asynchronously which looks bad in clients.
|
|
|
baab13 |
-
|
|
|
baab13 |
-from subprocess import Popen, PIPE
|
|
|
baab13 |
-import sys
|
|
|
baab13 |
-import os
|
|
|
baab13 |
-import getopt
|
|
|
baab13 |
-
|
|
|
baab13 |
-GETTEXT_PROGNAME = "abrt"
|
|
|
baab13 |
-import locale
|
|
|
baab13 |
-import gettext
|
|
|
baab13 |
-
|
|
|
baab13 |
-_ = lambda x: gettext.lgettext(x)
|
|
|
baab13 |
-
|
|
|
baab13 |
-
|
|
|
baab13 |
-verbose = 0
|
|
|
baab13 |
-
|
|
|
baab13 |
-def log(s):
|
|
|
baab13 |
- sys.stderr.write("%s\n" % s)
|
|
|
baab13 |
-
|
|
|
baab13 |
-def log1(message):
|
|
|
baab13 |
- if verbose > 0:
|
|
|
baab13 |
- log(message)
|
|
|
baab13 |
-
|
|
|
baab13 |
-def log2(message):
|
|
|
baab13 |
- if verbose > 1:
|
|
|
baab13 |
- log(message)
|
|
|
baab13 |
-
|
|
|
baab13 |
-def error_msg(s):
|
|
|
baab13 |
- sys.stderr.write("%s\n" % s)
|
|
|
baab13 |
-
|
|
|
baab13 |
-def error_msg_and_die(s):
|
|
|
baab13 |
- sys.stderr.write("%s\n" % s)
|
|
|
baab13 |
- sys.exit(1)
|
|
|
baab13 |
-
|
|
|
baab13 |
-def xopen(name, mode):
|
|
|
baab13 |
- try:
|
|
|
baab13 |
- r = open(name, mode)
|
|
|
baab13 |
- except IOError, ex:
|
|
|
baab13 |
- error_msg_and_die("Can't open '%s': %s" % (name, ex))
|
|
|
baab13 |
- return r
|
|
|
baab13 |
-
|
|
|
baab13 |
-
|
|
|
baab13 |
-def init_gettext():
|
|
|
baab13 |
- try:
|
|
|
baab13 |
- locale.setlocale(locale.LC_ALL, "")
|
|
|
baab13 |
- except locale.Error:
|
|
|
baab13 |
- os.environ['LC_ALL'] = 'C'
|
|
|
baab13 |
- locale.setlocale(locale.LC_ALL, "")
|
|
|
baab13 |
- # Defeat "AttributeError: 'module' object has no attribute 'nl_langinfo'"
|
|
|
baab13 |
- try:
|
|
|
baab13 |
- gettext.bind_textdomain_codeset(GETTEXT_PROGNAME, locale.nl_langinfo(locale.CODESET))
|
|
|
baab13 |
- except AttributeError:
|
|
|
baab13 |
- pass
|
|
|
baab13 |
- gettext.bindtextdomain(GETTEXT_PROGNAME, '/usr/share/locale')
|
|
|
baab13 |
- gettext.textdomain(GETTEXT_PROGNAME)
|
|
|
baab13 |
-
|
|
|
baab13 |
-#eu_unstrip_OUT=`eu-unstrip "--core=$core" -n 2>eu_unstrip.ERR`
|
|
|
baab13 |
-def extract_info_from_core(coredump_name):
|
|
|
baab13 |
- """
|
|
|
baab13 |
- Extracts builds with filenames,
|
|
|
baab13 |
- Returns a list of tuples (build_id, filename)
|
|
|
baab13 |
- """
|
|
|
baab13 |
- #OFFSET = 0
|
|
|
baab13 |
- BUILD_ID = 1
|
|
|
baab13 |
- LIBRARY = 2
|
|
|
baab13 |
- #SEP = 3
|
|
|
baab13 |
- EXECUTABLE = 4
|
|
|
baab13 |
-
|
|
|
baab13 |
- log(_("Analyzing coredump '%s'") % coredump_name)
|
|
|
baab13 |
- eu_unstrip_OUT = Popen(["eu-unstrip","--core=%s" % coredump_name, "-n"], stdout=PIPE, bufsize=-1).communicate()[0]
|
|
|
baab13 |
- # parse eu_unstrip_OUT and return the list of build_ids
|
|
|
baab13 |
-
|
|
|
baab13 |
- # eu_unstrip_OUT = (
|
|
|
baab13 |
- # "0x7f42362ca000+0x204000 c4d35d993598a6242f7525d024b5ec3becf5b447@0x7f42362ca1a0 /usr/lib64/libcanberra-gtk.so.0 - libcanberra-gtk.so.0\n"
|
|
|
baab13 |
- # "0x3afa400000+0x210000 607308f916c13c3ad9ee503008d31fa671ba73ce@0x3afa4001a0 /usr/lib64/libcanberra.so.0 - libcanberra.so.0\n"
|
|
|
baab13 |
- # "0x3afa400000+0x210000 607308f916c13c3ad9ee503008d31fa671ba73ce@0x3afa4001a0 /usr/lib64/libcanberra.so.0 - libcanberra.so.0\n"
|
|
|
baab13 |
- # "0x3bc7000000+0x208000 3be016bb723e85779a23e111a8ab1a520b209422@0x3bc70001a0 /usr/lib64/libvorbisfile.so.3 - libvorbisfile.so.3\n"
|
|
|
baab13 |
- # "0x7f423609e000+0x22c000 87f9c7d9844f364c73aa2566d6cfc9c5fa36d35d@0x7f423609e1a0 /usr/lib64/libvorbis.so.0 - libvorbis.so.0\n"
|
|
|
baab13 |
- # "0x7f4235e99000+0x205000 b5bc98c125a11b571cf4f2746268a6d3cfa95b68@0x7f4235e991a0 /usr/lib64/libogg.so.0 - libogg.so.0\n"
|
|
|
baab13 |
- # "0x7f4235c8b000+0x20e000 f1ff6c8ee30dba27e90ef0c5b013df2833da2889@0x7f4235c8b1a0 /usr/lib64/libtdb.so.1 - libtdb.so.1\n"
|
|
|
baab13 |
- # "0x3bc3000000+0x209000 8ef56f789fd914e8d0678eb0cdfda1bfebb00b40@0x3bc30001a0 /usr/lib64/libltdl.so.7 - libltdl.so.7\n"
|
|
|
baab13 |
- # "0x7f4231b64000+0x22b000 3ca5b83798349f78b362b1ea51c8a4bc8114b8b1@0x7f4231b641a0 /usr/lib64/gio/modules/libgvfsdbus.so - libgvfsdbus.so\n"
|
|
|
baab13 |
- # "0x7f423192a000+0x218000 ad024a01ad132737a8cfc7c95beb7c77733a652d@0x7f423192a1a0 /usr/lib64/libgvfscommon.so.0 - libgvfscommon.so.0\n"
|
|
|
baab13 |
- # "0x7f423192a000+0x218000 ad024a01ad132737a8cfc7c95beb7c77733a652d@0x7f423192a1a0 /usr/lib64/libgvfscommon.so.0 - libgvfscommon.so.0\n"
|
|
|
baab13 |
- # "0x3bb8e00000+0x20e000 d240ac5755184a95c783bb98a2d05530e0cf958a@0x3bb8e001a0 /lib64/libudev.so.0 - libudev.so.0\n"
|
|
|
baab13 |
- # )
|
|
|
baab13 |
- #print eu_unstrip_OUT
|
|
|
baab13 |
- # we failed to get build ids from the core -> die
|
|
|
baab13 |
- if not eu_unstrip_OUT:
|
|
|
baab13 |
- error_msg_and_die("Can't get build ids from %s" % coredump_name)
|
|
|
baab13 |
-
|
|
|
baab13 |
- lines = eu_unstrip_OUT.split('\n')
|
|
|
baab13 |
- # using set ensures the unique values
|
|
|
baab13 |
- build_ids = set()
|
|
|
baab13 |
- libraries = set()
|
|
|
baab13 |
-
|
|
|
baab13 |
- for line in lines:
|
|
|
baab13 |
- b_ids_line = line.split()
|
|
|
baab13 |
- if len(b_ids_line) >= EXECUTABLE:
|
|
|
baab13 |
- # [exe] -> the executable itself
|
|
|
baab13 |
- # linux-vdso.so.1 -> Virtual Dynamic Shared Object
|
|
|
baab13 |
- # linux-gate.so.1 -> the same as vdso
|
|
|
baab13 |
- # See https://bugzilla.redhat.com/show_bug.cgi?id=706969
|
|
|
baab13 |
- # "Please split kernel debuginfo packages so that VDSO debuginfos are separate" -
|
|
|
baab13 |
- # we might want to remove this special-casing later.
|
|
|
baab13 |
- if b_ids_line[BUILD_ID] == '-':
|
|
|
baab13 |
- log(_("Missing build id: %s" % b_ids_line[EXECUTABLE]))
|
|
|
baab13 |
- elif ((len(b_ids_line) == EXECUTABLE) or (b_ids_line[EXECUTABLE] not in ["linux-vdso.so.1", "linux-gate.so.1"])):
|
|
|
baab13 |
- build_id = b_ids_line[BUILD_ID].split('@')[0]
|
|
|
baab13 |
- build_ids.add(build_id)
|
|
|
baab13 |
- library = b_ids_line[LIBRARY]
|
|
|
baab13 |
- libraries.add(library)
|
|
|
baab13 |
- else:
|
|
|
baab13 |
- log2("skipping line '%s'" % line)
|
|
|
baab13 |
- log1("Found %i build_ids" % len(build_ids))
|
|
|
baab13 |
- log1("Found %i libs" % len(libraries))
|
|
|
baab13 |
- return build_ids
|
|
|
baab13 |
-
|
|
|
baab13 |
-def build_ids_to_path(build_ids):
|
|
|
baab13 |
- """
|
|
|
baab13 |
- build_id1=${build_id:0:2}
|
|
|
baab13 |
- build_id2=${build_id:2}
|
|
|
baab13 |
- file="usr/lib/debug/.build-id/$build_id1/$build_id2.debug"
|
|
|
baab13 |
- """
|
|
|
baab13 |
- return ["/usr/lib/debug/.build-id/%s/%s.debug" % (b_id[:2], b_id[2:]) for b_id in build_ids]
|
|
|
baab13 |
-
|
|
|
baab13 |
-if __name__ == "__main__":
|
|
|
baab13 |
- # localization
|
|
|
baab13 |
- init_gettext()
|
|
|
baab13 |
-
|
|
|
baab13 |
- ABRT_VERBOSE = os.getenv("ABRT_VERBOSE")
|
|
|
baab13 |
- if (ABRT_VERBOSE):
|
|
|
baab13 |
- try:
|
|
|
baab13 |
- verbose = int(ABRT_VERBOSE)
|
|
|
baab13 |
- except:
|
|
|
baab13 |
- pass
|
|
|
baab13 |
-
|
|
|
baab13 |
- progname = os.path.basename(sys.argv[0])
|
|
|
baab13 |
- help_text = _("Usage: %s [-v] [-o OUTFILE] -c COREFILE") % progname
|
|
|
baab13 |
- try:
|
|
|
baab13 |
- opts, args = getopt.getopt(sys.argv[1:], "vhc:o:", ["help", "core="])
|
|
|
baab13 |
- except getopt.GetoptError, err:
|
|
|
baab13 |
- error_msg(err) # prints something like "option -a not recognized"
|
|
|
baab13 |
- error_msg_and_die(help_text)
|
|
|
baab13 |
-
|
|
|
baab13 |
- core = None
|
|
|
baab13 |
- opt_o = None
|
|
|
baab13 |
-
|
|
|
baab13 |
- for opt, arg in opts:
|
|
|
baab13 |
- if opt in ("-h", "--help"):
|
|
|
baab13 |
- print help_text
|
|
|
baab13 |
- exit(0)
|
|
|
baab13 |
- elif opt == "-v":
|
|
|
baab13 |
- verbose += 1
|
|
|
baab13 |
- elif opt == "-o":
|
|
|
baab13 |
- opt_o = arg
|
|
|
baab13 |
- elif opt in ("-c", "--core"):
|
|
|
baab13 |
- core = arg
|
|
|
baab13 |
-
|
|
|
baab13 |
- if not core:
|
|
|
baab13 |
- error_msg(_("COREFILE is not specified"))
|
|
|
baab13 |
- error_msg_and_die(help_text)
|
|
|
baab13 |
-
|
|
|
baab13 |
- b_ids = extract_info_from_core(core)
|
|
|
baab13 |
-
|
|
|
baab13 |
- try:
|
|
|
baab13 |
- # Note that we open -o FILE only when we reach the point
|
|
|
baab13 |
- # when we are definitely going to write something to it
|
|
|
baab13 |
- outfile = sys.stdout
|
|
|
baab13 |
- outname = opt_o
|
|
|
baab13 |
- # Make sure the file is readable for all
|
|
|
baab13 |
- oldmask = os.umask(0002)
|
|
|
baab13 |
- for bid in b_ids:
|
|
|
baab13 |
- if outname:
|
|
|
baab13 |
- outfile = xopen(outname, "w")
|
|
|
baab13 |
- outname = None
|
|
|
baab13 |
- outfile.write("%s\n" % bid)
|
|
|
baab13 |
- outfile.close()
|
|
|
baab13 |
- os.umask(oldmask)
|
|
|
baab13 |
- except IOError, e:
|
|
|
baab13 |
- if not opt_o:
|
|
|
baab13 |
- opt_o = "<stdout>"
|
|
|
baab13 |
- error_msg_and_die("Error writing to '%s': %s" % (opt_o, e))
|
|
|
baab13 |
diff --git a/src/plugins/abrt-action-analyze-core.in b/src/plugins/abrt-action-analyze-core.in
|
|
|
baab13 |
new file mode 100644
|
|
|
baab13 |
index 0000000..0185ac5
|
|
|
baab13 |
--- /dev/null
|
|
|
baab13 |
+++ b/src/plugins/abrt-action-analyze-core.in
|
|
|
baab13 |
@@ -0,0 +1,186 @@
|
|
|
baab13 |
+#!/usr/bin/python -u
|
|
|
baab13 |
+# -*- coding: utf-8 -*-
|
|
|
baab13 |
+# WARNING: python -u means unbuffered I/O. Without it the messages are
|
|
|
baab13 |
+# passed to the parent asynchronously which looks bad in clients.
|
|
|
baab13 |
+
|
|
|
baab13 |
+from subprocess import Popen, PIPE
|
|
|
baab13 |
+import sys
|
|
|
baab13 |
+import os
|
|
|
baab13 |
+import getopt
|
|
|
baab13 |
+
|
|
|
baab13 |
+GETTEXT_PROGNAME = "@PACKAGE@"
|
|
|
baab13 |
+import locale
|
|
|
baab13 |
+import gettext
|
|
|
baab13 |
+
|
|
|
baab13 |
+_ = lambda x: gettext.lgettext(x)
|
|
|
baab13 |
+
|
|
|
baab13 |
+
|
|
|
baab13 |
+verbose = 0
|
|
|
baab13 |
+
|
|
|
baab13 |
+def log(s):
|
|
|
baab13 |
+ sys.stderr.write("%s\n" % s)
|
|
|
baab13 |
+
|
|
|
baab13 |
+def log1(message):
|
|
|
baab13 |
+ if verbose > 0:
|
|
|
baab13 |
+ log(message)
|
|
|
baab13 |
+
|
|
|
baab13 |
+def log2(message):
|
|
|
baab13 |
+ if verbose > 1:
|
|
|
baab13 |
+ log(message)
|
|
|
baab13 |
+
|
|
|
baab13 |
+def error_msg(s):
|
|
|
baab13 |
+ sys.stderr.write("%s\n" % s)
|
|
|
baab13 |
+
|
|
|
baab13 |
+def error_msg_and_die(s):
|
|
|
baab13 |
+ sys.stderr.write("%s\n" % s)
|
|
|
baab13 |
+ sys.exit(1)
|
|
|
baab13 |
+
|
|
|
baab13 |
+def xopen(name, mode):
|
|
|
baab13 |
+ try:
|
|
|
baab13 |
+ r = open(name, mode)
|
|
|
baab13 |
+ except IOError, ex:
|
|
|
baab13 |
+ error_msg_and_die("Can't open '%s': %s" % (name, ex))
|
|
|
baab13 |
+ return r
|
|
|
baab13 |
+
|
|
|
baab13 |
+
|
|
|
baab13 |
+def init_gettext():
|
|
|
baab13 |
+ try:
|
|
|
baab13 |
+ locale.setlocale(locale.LC_ALL, "")
|
|
|
baab13 |
+ except locale.Error:
|
|
|
baab13 |
+ os.environ['LC_ALL'] = 'C'
|
|
|
baab13 |
+ locale.setlocale(locale.LC_ALL, "")
|
|
|
baab13 |
+ # Defeat "AttributeError: 'module' object has no attribute 'nl_langinfo'"
|
|
|
baab13 |
+ try:
|
|
|
baab13 |
+ gettext.bind_textdomain_codeset(GETTEXT_PROGNAME, locale.nl_langinfo(locale.CODESET))
|
|
|
baab13 |
+ except AttributeError:
|
|
|
baab13 |
+ pass
|
|
|
baab13 |
+ gettext.bindtextdomain(GETTEXT_PROGNAME, "@localedir@")
|
|
|
baab13 |
+ gettext.textdomain(GETTEXT_PROGNAME)
|
|
|
baab13 |
+
|
|
|
baab13 |
+#eu_unstrip_OUT=`eu-unstrip "--core=$core" -n 2>eu_unstrip.ERR`
|
|
|
baab13 |
+def extract_info_from_core(coredump_name):
|
|
|
baab13 |
+ """
|
|
|
baab13 |
+ Extracts builds with filenames,
|
|
|
baab13 |
+ Returns a list of tuples (build_id, filename)
|
|
|
baab13 |
+ """
|
|
|
baab13 |
+ #OFFSET = 0
|
|
|
baab13 |
+ BUILD_ID = 1
|
|
|
baab13 |
+ LIBRARY = 2
|
|
|
baab13 |
+ #SEP = 3
|
|
|
baab13 |
+ EXECUTABLE = 4
|
|
|
baab13 |
+
|
|
|
baab13 |
+ log(_("Analyzing coredump '%s'") % coredump_name)
|
|
|
baab13 |
+ eu_unstrip_OUT = Popen(["eu-unstrip","--core=%s" % coredump_name, "-n"], stdout=PIPE, bufsize=-1).communicate()[0]
|
|
|
baab13 |
+ # parse eu_unstrip_OUT and return the list of build_ids
|
|
|
baab13 |
+
|
|
|
baab13 |
+ # eu_unstrip_OUT = (
|
|
|
baab13 |
+ # "0x7f42362ca000+0x204000 c4d35d993598a6242f7525d024b5ec3becf5b447@0x7f42362ca1a0 /usr/lib64/libcanberra-gtk.so.0 - libcanberra-gtk.so.0\n"
|
|
|
baab13 |
+ # "0x3afa400000+0x210000 607308f916c13c3ad9ee503008d31fa671ba73ce@0x3afa4001a0 /usr/lib64/libcanberra.so.0 - libcanberra.so.0\n"
|
|
|
baab13 |
+ # "0x3afa400000+0x210000 607308f916c13c3ad9ee503008d31fa671ba73ce@0x3afa4001a0 /usr/lib64/libcanberra.so.0 - libcanberra.so.0\n"
|
|
|
baab13 |
+ # "0x3bc7000000+0x208000 3be016bb723e85779a23e111a8ab1a520b209422@0x3bc70001a0 /usr/lib64/libvorbisfile.so.3 - libvorbisfile.so.3\n"
|
|
|
baab13 |
+ # "0x7f423609e000+0x22c000 87f9c7d9844f364c73aa2566d6cfc9c5fa36d35d@0x7f423609e1a0 /usr/lib64/libvorbis.so.0 - libvorbis.so.0\n"
|
|
|
baab13 |
+ # "0x7f4235e99000+0x205000 b5bc98c125a11b571cf4f2746268a6d3cfa95b68@0x7f4235e991a0 /usr/lib64/libogg.so.0 - libogg.so.0\n"
|
|
|
baab13 |
+ # "0x7f4235c8b000+0x20e000 f1ff6c8ee30dba27e90ef0c5b013df2833da2889@0x7f4235c8b1a0 /usr/lib64/libtdb.so.1 - libtdb.so.1\n"
|
|
|
baab13 |
+ # "0x3bc3000000+0x209000 8ef56f789fd914e8d0678eb0cdfda1bfebb00b40@0x3bc30001a0 /usr/lib64/libltdl.so.7 - libltdl.so.7\n"
|
|
|
baab13 |
+ # "0x7f4231b64000+0x22b000 3ca5b83798349f78b362b1ea51c8a4bc8114b8b1@0x7f4231b641a0 /usr/lib64/gio/modules/libgvfsdbus.so - libgvfsdbus.so\n"
|
|
|
baab13 |
+ # "0x7f423192a000+0x218000 ad024a01ad132737a8cfc7c95beb7c77733a652d@0x7f423192a1a0 /usr/lib64/libgvfscommon.so.0 - libgvfscommon.so.0\n"
|
|
|
baab13 |
+ # "0x7f423192a000+0x218000 ad024a01ad132737a8cfc7c95beb7c77733a652d@0x7f423192a1a0 /usr/lib64/libgvfscommon.so.0 - libgvfscommon.so.0\n"
|
|
|
baab13 |
+ # "0x3bb8e00000+0x20e000 d240ac5755184a95c783bb98a2d05530e0cf958a@0x3bb8e001a0 /lib64/libudev.so.0 - libudev.so.0\n"
|
|
|
baab13 |
+ # )
|
|
|
baab13 |
+ #print eu_unstrip_OUT
|
|
|
baab13 |
+ # we failed to get build ids from the core -> die
|
|
|
baab13 |
+ if not eu_unstrip_OUT:
|
|
|
baab13 |
+ error_msg_and_die("Can't get build ids from %s" % coredump_name)
|
|
|
baab13 |
+
|
|
|
baab13 |
+ lines = eu_unstrip_OUT.split('\n')
|
|
|
baab13 |
+ # using set ensures the unique values
|
|
|
baab13 |
+ build_ids = set()
|
|
|
baab13 |
+ libraries = set()
|
|
|
baab13 |
+
|
|
|
baab13 |
+ for line in lines:
|
|
|
baab13 |
+ b_ids_line = line.split()
|
|
|
baab13 |
+ if len(b_ids_line) >= EXECUTABLE:
|
|
|
baab13 |
+ # [exe] -> the executable itself
|
|
|
baab13 |
+ # linux-vdso.so.1 -> Virtual Dynamic Shared Object
|
|
|
baab13 |
+ # linux-gate.so.1 -> the same as vdso
|
|
|
baab13 |
+ # See https://bugzilla.redhat.com/show_bug.cgi?id=706969
|
|
|
baab13 |
+ # "Please split kernel debuginfo packages so that VDSO debuginfos are separate" -
|
|
|
baab13 |
+ # we might want to remove this special-casing later.
|
|
|
baab13 |
+ if b_ids_line[BUILD_ID] == '-':
|
|
|
baab13 |
+ log(_("Missing build id: %s" % b_ids_line[EXECUTABLE]))
|
|
|
baab13 |
+ elif ((len(b_ids_line) == EXECUTABLE) or (b_ids_line[EXECUTABLE] not in ["linux-vdso.so.1", "linux-gate.so.1"])):
|
|
|
baab13 |
+ build_id = b_ids_line[BUILD_ID].split('@')[0]
|
|
|
baab13 |
+ build_ids.add(build_id)
|
|
|
baab13 |
+ library = b_ids_line[LIBRARY]
|
|
|
baab13 |
+ libraries.add(library)
|
|
|
baab13 |
+ else:
|
|
|
baab13 |
+ log2("skipping line '%s'" % line)
|
|
|
baab13 |
+ log1("Found %i build_ids" % len(build_ids))
|
|
|
baab13 |
+ log1("Found %i libs" % len(libraries))
|
|
|
baab13 |
+ return build_ids
|
|
|
baab13 |
+
|
|
|
baab13 |
+def build_ids_to_path(build_ids):
|
|
|
baab13 |
+ """
|
|
|
baab13 |
+ build_id1=${build_id:0:2}
|
|
|
baab13 |
+ build_id2=${build_id:2}
|
|
|
baab13 |
+ file="usr/lib/debug/.build-id/$build_id1/$build_id2.debug"
|
|
|
baab13 |
+ """
|
|
|
baab13 |
+ return ["/usr/lib/debug/.build-id/%s/%s.debug" % (b_id[:2], b_id[2:]) for b_id in build_ids]
|
|
|
baab13 |
+
|
|
|
baab13 |
+if __name__ == "__main__":
|
|
|
baab13 |
+ # localization
|
|
|
baab13 |
+ init_gettext()
|
|
|
baab13 |
+
|
|
|
baab13 |
+ ABRT_VERBOSE = os.getenv("ABRT_VERBOSE")
|
|
|
baab13 |
+ if (ABRT_VERBOSE):
|
|
|
baab13 |
+ try:
|
|
|
baab13 |
+ verbose = int(ABRT_VERBOSE)
|
|
|
baab13 |
+ except:
|
|
|
baab13 |
+ pass
|
|
|
baab13 |
+
|
|
|
baab13 |
+ progname = os.path.basename(sys.argv[0])
|
|
|
baab13 |
+ help_text = _("Usage: %s [-v] [-o OUTFILE] -c COREFILE") % progname
|
|
|
baab13 |
+ try:
|
|
|
baab13 |
+ opts, args = getopt.getopt(sys.argv[1:], "vhc:o:", ["help", "core="])
|
|
|
baab13 |
+ except getopt.GetoptError, err:
|
|
|
baab13 |
+ error_msg(err) # prints something like "option -a not recognized"
|
|
|
baab13 |
+ error_msg_and_die(help_text)
|
|
|
baab13 |
+
|
|
|
baab13 |
+ core = None
|
|
|
baab13 |
+ opt_o = None
|
|
|
baab13 |
+
|
|
|
baab13 |
+ for opt, arg in opts:
|
|
|
baab13 |
+ if opt in ("-h", "--help"):
|
|
|
baab13 |
+ print help_text
|
|
|
baab13 |
+ exit(0)
|
|
|
baab13 |
+ elif opt == "-v":
|
|
|
baab13 |
+ verbose += 1
|
|
|
baab13 |
+ elif opt == "-o":
|
|
|
baab13 |
+ opt_o = arg
|
|
|
baab13 |
+ elif opt in ("-c", "--core"):
|
|
|
baab13 |
+ core = arg
|
|
|
baab13 |
+
|
|
|
baab13 |
+ if not core:
|
|
|
baab13 |
+ error_msg(_("COREFILE is not specified"))
|
|
|
baab13 |
+ error_msg_and_die(help_text)
|
|
|
baab13 |
+
|
|
|
baab13 |
+ b_ids = extract_info_from_core(core)
|
|
|
baab13 |
+
|
|
|
baab13 |
+ try:
|
|
|
baab13 |
+ # Note that we open -o FILE only when we reach the point
|
|
|
baab13 |
+ # when we are definitely going to write something to it
|
|
|
baab13 |
+ outfile = sys.stdout
|
|
|
baab13 |
+ outname = opt_o
|
|
|
baab13 |
+ # Make sure the file is readable for all
|
|
|
baab13 |
+ oldmask = os.umask(0002)
|
|
|
baab13 |
+ for bid in b_ids:
|
|
|
baab13 |
+ if outname:
|
|
|
baab13 |
+ outfile = xopen(outname, "w")
|
|
|
baab13 |
+ outname = None
|
|
|
baab13 |
+ outfile.write("%s\n" % bid)
|
|
|
baab13 |
+ outfile.close()
|
|
|
baab13 |
+ os.umask(oldmask)
|
|
|
baab13 |
+ except IOError, e:
|
|
|
baab13 |
+ if not opt_o:
|
|
|
baab13 |
+ opt_o = "<stdout>"
|
|
|
baab13 |
+ error_msg_and_die("Error writing to '%s': %s" % (opt_o, e))
|
|
|
baab13 |
diff --git a/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c b/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c
|
|
|
baab13 |
index cf74326..e0eccc0 100644
|
|
|
baab13 |
--- a/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c
|
|
|
baab13 |
+++ b/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c
|
|
|
baab13 |
@@ -74,7 +74,8 @@ int main(int argc, char **argv)
|
|
|
baab13 |
// However since we communicate through environment variables
|
|
|
baab13 |
// we have to keep a whitelist of variables to keep.
|
|
|
baab13 |
static const char *whitelist[] = {
|
|
|
baab13 |
- "REPORT_CLIENT_SLAVE" // Check if the app is being run as a slave
|
|
|
baab13 |
+ "REPORT_CLIENT_SLAVE", // Check if the app is being run as a slave
|
|
|
baab13 |
+ "LANG",
|
|
|
baab13 |
};
|
|
|
baab13 |
const size_t wlsize = sizeof(whitelist)/sizeof(char*);
|
|
|
baab13 |
char *setlist[sizeof(whitelist)/sizeof(char*)] = { 0 };
|
|
|
baab13 |
--
|
|
|
baab13 |
1.8.3.1
|
|
|
baab13 |
|