[PATCH 0/7] track#554 : Unify of GTK and CLI reporters implementation
by Jakub Filak
This set of patches unify implementation of GTK and CLI reporters. In the first
step, run event on dir API is enriched of callbacks which allows to handle
event messages from various frontends. The following step moves the event
configuration checking from report-gtk to libreport. Next step introduces run
event list API which hides an implementation details of processing of events in
reporter applications. Next step introduces asynchronous API for run event
list. The asynchronous run event list is implement with pthreads. The lasts
steps simply uses newly introduced functions in report-gtk and report-cli.
Jakub Filak (7):
track#554 : run event on rewritten with callbacks
track#554 : add validate_event_config used byt validate_event to
refine complexity
track#554 : move event configuration checking to common lib
track#554 : add API for runnig of lists of events
track#554 : use run event list API in report-cli
track#554 : run event list in thread API
track#554 : reworked report-gtk with usage of run event list in
thread
libreport.spec.in | 3 +
po/POTFILES.in | 1 +
src/cli/cli.c | 160 ++--
src/gui-wizard-gtk/main.c | 24 +-
src/gui-wizard-gtk/wizard.c | 1544 +++++++++++++++--------------------
src/gui-wizard-gtk/wizard.glade | 10 +-
src/gui-wizard-gtk/wizard.h | 2 +
src/include/Makefile.am | 5 +-
src/include/event_config.h | 1 +
src/include/event_usability.h | 59 ++
src/include/run_event.h | 134 ++-
src/include/run_event_list.h | 209 +++++
src/include/run_event_list_thread.h | 174 ++++
src/lib/Makefile.am | 6 +-
src/lib/event_config.c | 12 +-
src/lib/event_usability.c | 201 +++++
src/lib/run_event.c | 440 ++++++++--
src/lib/run_event_list.c | 618 ++++++++++++++
src/lib/run_event_list_thread.c | 284 +++++++
19 files changed, 2836 insertions(+), 1051 deletions(-)
create mode 100644 src/include/event_usability.h
create mode 100644 src/include/run_event_list.h
create mode 100644 src/include/run_event_list_thread.h
create mode 100644 src/lib/event_usability.c
create mode 100644 src/lib/run_event_list.c
create mode 100644 src/lib/run_event_list_thread.c
--
1.7.10.2
11 years, 9 months
Re: ABRT for Ruby
by Vít Ondruch
Hi,
Updated ABRT gem version 0.0.2 is available at RubyGems.org if you like
to test it. I'd love to hear some feedback.
There were done following changes:
* Improved code base
* Better handling of some edge cases, such as call to Kernel#exit or
Ctrl+C event
* Test suite added
* Improved documentation
I also prepared RPM for Fedora. Review is available at
https://bugzilla.redhat.com/show_bug.cgi?id=838568
Vit
11 years, 9 months
[PATCH] simplify recent API additions
by Denys Vlasenko
Hi,
I propose the following attached patches:
Patch 1 removes the wrappers. I don't see why we need them.
Also removes CD_FLAG_FILE, we have CD_FLAG_BIN which is the same.
Patches 2 and 3 simplify save_dump_dir_from_problem_data() code
and the method it uses to pass back the name of the created directory.
Also, move its decl into problem_data.h - I feel it belongs here.
These are pretty mechanical changes, which open up the way for
the next step:
We need to merge create_dump_dir_from_problem_data()
and save_dump_dir_from_problem_data() into one function,
and also reuse this new function instead of open-coded
problem_data -> dump_dir code in abrt-server.
(IOW: we have triple code duplication right now, need to consolidate).
--
vda
11 years, 9 months
[PATCH] rhbz#839285 : do not delete an uploaded archive by default
by Jakub Filak
* a config option DeleteUploaded was added to abrt.conf
* an old behaviour of abrt-handle-upload was preserved
* /var/spool/abrt-upload is not writable by default
* for more details see rhbz#836988
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/daemon/abrt-handle-upload | 32 +++++++++++++++++++++++++-------
src/daemon/abrt.conf | 5 +++++
src/daemon/abrtd.c | 2 +-
src/include/libabrt.h | 3 +++
src/lib/abrt_conf.c | 8 ++++++++
5 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/src/daemon/abrt-handle-upload b/src/daemon/abrt-handle-upload
index a6ab3ae..ecdae34 100755
--- a/src/daemon/abrt-handle-upload
+++ b/src/daemon/abrt-handle-upload
@@ -3,7 +3,15 @@
# The task of this script is to unpack the file and move
# problem data found in it to abrtd spool directory.
#
-# Usage: abrt-handle-upload ABRT_SPOOL_DIR UPLOAD_DIR FILENAME
+# Usage: abrt-handle-upload ABRT_SPOOL_DIR UPLOAD_DIR FILENAME DELETE_ARCHIVE
+#
+# ABRT_SPOOL_DIR - a directory where valid uploaded archives are unpacked to
+# UPLOAD_DIR - a directory where uploaded archives are stored in
+# FILENAME - an uploaded archive file name
+# DELETE_ARCHIVE - if set to "no" an original archive is not deleted
+# all other strings (an empty string is string)
+# are considered as "yes" and the original archive
+# is to be deleted on the end of this script
#echo "Started: $0 $*"
@@ -21,6 +29,7 @@ delete_on_exit=""
abrt_dir="$1"
upload_dir="$2"
archive="$3"
+delete_archive="$4"
test -d "$abrt_dir" || print_clean_and_die "Not a directory: '$abrt_dir'"
test -d "$upload_dir" || print_clean_and_die "Not a directory: '$upload_dir'"
@@ -41,17 +50,26 @@ test x"${archive%.tar.xz}" != x"$archive" && unpacker="unxz"
test "$unpacker" || print_clean_and_die "Unknown file type: '$archive'"
-tempdir="remote.`date +%Y-%m-%d-%H:%M:%S.%N`.$$"
+workingdir=`mktemp -d "abrt_handle_upload.XXXXXXXXXX" --tmpdir=/tmp`
+[ "$?" -ne 0 ] && print_clean_and_die "Can't create '$workingdir' directory"
+
+delete_on_exit="$workingdir"
+
+tempdir="$workingdir/remote.`date +%Y-%m-%d-%H:%M:%S.%N`.$$"
+archive_working="$workingdir/$archive"
+
+lock_cmd="mv"
+if [ "$delete_archive" == "no" ]; then
+ lock_cmd="cp"
+fi
-mv -- "$archive" "$archive.working" || print_clean_and_die "Can't lock '$archive'"
+$lock_cmd -- "$archive" "$archive_working" || print_clean_and_die "Can't lock '$archive'"
-delete_on_exit="$archive.working"
-$unpacker -t -- "$archive.working" || print_clean_and_die "Verification error on '$archive'"
+$unpacker -t -- "$archive_working" || print_clean_and_die "Verification error on '$archive'"
echo "Unpacking '$archive'"
mkdir "$tempdir" || print_clean_and_die "Can't create '$tempdir' directory"
-delete_on_exit="$archive.working $tempdir"
-$unpacker <"$archive.working" | tar xf - -C "$tempdir" || print_clean_and_die "Can't unpack '$archive'"
+$unpacker <"$archive_working" | tar xf - -C "$tempdir" || print_clean_and_die "Can't unpack '$archive'"
# The archive can contain either plain dump files
# or one or more complete problem data directories.
diff --git a/src/daemon/abrt.conf b/src/daemon/abrt.conf
index 9a35f0c..c7ad417 100644
--- a/src/daemon/abrt.conf
+++ b/src/daemon/abrt.conf
@@ -15,3 +15,8 @@ MaxCrashReportsSize = 1000
# Changing dump location could cause problems with SELinux. See man abrt_selinux(8).
#
#DumpLocation = /var/spool/abrt
+
+# If you want to automatically clean the upload directory you have to tweak the
+# selinux policy.
+#
+DeleteUploaded = no
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
index d4efec4..d8d1cbf 100644
--- a/src/daemon/abrtd.c
+++ b/src/daemon/abrtd.c
@@ -502,7 +502,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin
{
xchdir(dir);
execlp("abrt-handle-upload", "abrt-handle-upload",
- g_settings_dump_location, dir, name, (char*)NULL);
+ g_settings_dump_location, dir, name, g_settings_delete_uploaded ? "yes" : "no", (char*)NULL);
error_msg_and_die("Can't execute '%s'", "abrt-handle-upload");
}
if (pid > 0)
diff --git a/src/include/libabrt.h b/src/include/libabrt.h
index fff80ef..48d2ac3 100644
--- a/src/include/libabrt.h
+++ b/src/include/libabrt.h
@@ -56,6 +56,9 @@ extern unsigned int g_settings_nMaxCrashReportsSize;
extern char * g_settings_sWatchCrashdumpArchiveDir;
#define g_settings_dump_location abrt_g_settings_dump_location
extern char * g_settings_dump_location;
+#define g_settings_delete_uploaded abrt_g_settings_delete_uploaded
+extern bool g_settings_delete_uploaded;
+
#define load_abrt_conf abrt_load_abrt_conf
int load_abrt_conf();
diff --git a/src/lib/abrt_conf.c b/src/lib/abrt_conf.c
index fc8a04f..0b53c21 100644
--- a/src/lib/abrt_conf.c
+++ b/src/lib/abrt_conf.c
@@ -21,6 +21,7 @@
char * g_settings_sWatchCrashdumpArchiveDir = NULL;
unsigned int g_settings_nMaxCrashReportsSize = 1000;
char * g_settings_dump_location = NULL;
+bool g_settings_delete_uploaded = 0;
void free_abrt_conf_data()
{
@@ -64,6 +65,13 @@ static void ParseCommon(map_string_h *settings, const char *conf_filename)
else
g_settings_dump_location = xstrdup("/var/spool/abrt");
+ value = g_hash_table_lookup(settings, "DeleteUploaded");
+ if (value)
+ {
+ g_settings_delete_uploaded = string_to_bool(value);
+ g_hash_table_remove(settings, "DeleteUploaded");
+ }
+
GHashTableIter iter;
char *name;
/*char *value; - already declared */
--
1.7.10.4
11 years, 9 months
[PATCH] use -Werror GCC option only for build of rpm
by Jakub Filak
If I build libreport with -O0 GCC option I get an error because of this
warning:
"/usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE
requires compiling with optimization (-O) [-Wcpp]"
_FORTIFY_SOURCE is required by Python bindings thus I can't get rid of
FORTIFY_SOUCE but I really want to compile without optimizations.
Therefore we have decided to use -Werror option only for rpm builds. It
allows me to make a local build without optimizations and, on the
contrary, a source code with a single warning will break a nightly build
hence nobody is allowed to push a code with warnings.
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
configure.ac | 4 ++--
libreport.spec.in | 3 +--
src/cli/Makefile.am | 3 +--
src/client-python/Makefile.am | 3 +--
src/gtk-helpers/Makefile.am | 1 -
src/gui-wizard-gtk/Makefile.am | 3 +--
src/lib/Makefile.am | 3 ---
src/plugins/Makefile.am | 24 ++++++++----------------
src/report-newt/report-newt.c | 2 +-
src/report-python/Makefile.am | 3 +--
10 files changed, 16 insertions(+), 33 deletions(-)
diff --git a/configure.ac b/configure.ac
index fbaa53c..fb4937d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,12 +13,12 @@ AC_PROG_LN_S
AC_SYS_LARGEFILE
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
- -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -std=gnu99 -Wall"
+ -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -std=gnu99 -Wall -Wwrite-strings"
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],
[Enable debug information])],
- [CFLAGS="$CFLAGS -DDEBUG -ggdb -g"])
+ [CFLAGS="$CFLAGS -DDEBUG -ggdb -g -O0"])
AC_ARG_ENABLE([bodhi],
AC_HELP_STRING([--disable-bodhi], [do not use bodhi plugin]))
diff --git a/libreport.spec.in b/libreport.spec.in
index 6f6da01..fa1b15f 100644
--- a/libreport.spec.in
+++ b/libreport.spec.in
@@ -228,8 +228,7 @@ Plugin to report bugs into anonymous FTP site associated with ticketing system.
%build
autoconf
-%configure
-CFLAGS="-fno-strict-aliasing"
+CFLAGS="%{optflags} -Werror" %configure
make %{?_smp_mflags}
%install
diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am
index 5295658..5edc119 100644
--- a/src/cli/Makefile.am
+++ b/src/cli/Makefile.am
@@ -12,8 +12,7 @@ report_cli_CPPFLAGS = \
-DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \
$(GLIB_CFLAGS) \
-D_GNU_SOURCE \
- $(LIBREPORT_CFLAGS) \
- -Wall -Wwrite-strings -Werror
+ $(LIBREPORT_CFLAGS)
# $(GTK_CFLAGS)
report_cli_LDADD = \
../lib/libreport.la \
diff --git a/src/client-python/Makefile.am b/src/client-python/Makefile.am
index 74486f2..ad6f98e 100644
--- a/src/client-python/Makefile.am
+++ b/src/client-python/Makefile.am
@@ -18,8 +18,7 @@ _reportclient_la_CPPFLAGS = \
-DLOCALSTATEDIR='"$(localstatedir)"' \
$(GLIB_CFLAGS) \
$(PYTHON_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
_reportclient_la_LDFLAGS = \
-module \
-avoid-version \
diff --git a/src/gtk-helpers/Makefile.am b/src/gtk-helpers/Makefile.am
index 188e48f..06c3ec8 100644
--- a/src/gtk-helpers/Makefile.am
+++ b/src/gtk-helpers/Makefile.am
@@ -15,7 +15,6 @@ libreport_gtk_la_SOURCES = \
autowrapped_label.c
libreport_gtk_la_CPPFLAGS = \
- -Wall -Wwrite-strings -Werror \
-I$(srcdir)/../include \
-I$(srcdir)/../lib \
$(GTK_CFLAGS) \
diff --git a/src/gui-wizard-gtk/Makefile.am b/src/gui-wizard-gtk/Makefile.am
index 29df95b..ecd1887 100644
--- a/src/gui-wizard-gtk/Makefile.am
+++ b/src/gui-wizard-gtk/Makefile.am
@@ -21,8 +21,7 @@ report_gtk_CFLAGS = \
-DICON_DIR=\"${datadir}/abrt/icons/hicolor/48x48/status\" \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
# Required for gtk_builder_connect_signals() to work correctly:
# -lgmodule-2.0
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index d2282db..5befe7d 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -49,7 +49,6 @@ libreport_la_SOURCES = \
client.c \
utf8.c
libreport_la_CPPFLAGS = \
- -Wall -Wwrite-strings -Werror \
-I$(srcdir)/../include \
-DLOCALSTATEDIR='"$(localstatedir)"' \
-DVAR_RUN=\"$(VAR_RUN)\" \
@@ -81,7 +80,6 @@ libabrt_dbus_la_CPPFLAGS = \
-DEVENTS_DIR=\"$(EVENTS_DIR)\" \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
- -Wall -Wwrite-strings -Werror \
-D_GNU_SOURCE
libabrt_dbus_la_LDFLAGS = \
-version-info 0:1:0
@@ -96,7 +94,6 @@ libreport_web_la_SOURCES = \
proxies.h proxies.c \
ureport.h json.c
libreport_web_la_CPPFLAGS = \
- -Wall -Wwrite-strings -Werror \
-I$(srcdir)/../include \
-DLOCALSTATEDIR='"$(localstatedir)"' \
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index f40f27e..967596f 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -72,8 +72,7 @@ reporter_bugzilla_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
$(XMLRPC_CFLAGS) $(XMLRPC_CLIENT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings
+ -D_GNU_SOURCE
reporter_bugzilla_LDADD = \
$(GLIB_LIBS) \
$(XMLRPC_LIBS) $(XMLRPC_CLIENT_LIBS) \
@@ -99,8 +98,7 @@ reporter_rhtsupport_CPPFLAGS = \
$(LIBREPORT_CFLAGS) \
$(XMLRPC_CFLAGS) $(XMLRPC_CLIENT_CFLAGS) \
$(LIBXML_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
reporter_rhtsupport_LDFLAGS = -ltar
reporter_rhtsupport_LDADD = \
$(GLIB_LIBS) \
@@ -123,8 +121,7 @@ reporter_upload_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(CURL_CFLAGS) \
$(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
reporter_upload_LDFLAGS = -ltar
reporter_upload_LDADD = \
$(GLIB_LIBS) \
@@ -144,8 +141,7 @@ reporter_kerneloops_CPPFLAGS = \
-DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
reporter_kerneloops_LDADD = \
../lib/libreport-web.la \
../lib/libreport.la
@@ -165,8 +161,7 @@ reporter_mailx_CPPFLAGS = \
-DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
reporter_mailx_LDADD = \
../lib/libreport.la
@@ -183,8 +178,7 @@ reporter_print_CPPFLAGS = \
-DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
reporter_print_LDADD = \
../lib/libreport.la
@@ -202,8 +196,7 @@ report_CPPFLAGS = \
-DPLUGINS_CONF_DIR=\"$(REPORT_PLUGINS_CONF_DIR)\" \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
report_LDADD = \
../lib/libreport.la
@@ -214,8 +207,7 @@ reporter_ureport_CPPFLAGS = \
-I$(srcdir)/../lib \
$(GLIB_CFLAGS) \
$(LIBREPORT_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
reporter_ureport_LDADD = \
../lib/libreport.la \
../lib/libreport-web.la
diff --git a/src/report-newt/report-newt.c b/src/report-newt/report-newt.c
index 3a94896..6287445 100644
--- a/src/report-newt/report-newt.c
+++ b/src/report-newt/report-newt.c
@@ -334,7 +334,7 @@ static int report(const char *dump_dir_name)
reason ?: _("(no description)"));
dd_close(dd);
- newtWinMessage(_("Error"), _("Ok"), "%s", t);
+ newtWinMessage(_("Error"), _("Ok"), (char *)"%s", t);
free(t);
return -1;
}
diff --git a/src/report-python/Makefile.am b/src/report-python/Makefile.am
index e12479f..43a58f2 100644
--- a/src/report-python/Makefile.am
+++ b/src/report-python/Makefile.am
@@ -22,8 +22,7 @@ _pyreport_la_CPPFLAGS = \
-DVAR_RUN=\"$(VAR_RUN)\" \
$(GLIB_CFLAGS) \
$(PYTHON_CFLAGS) \
- -D_GNU_SOURCE \
- -Wall -Wwrite-strings -Werror
+ -D_GNU_SOURCE
_pyreport_la_LDFLAGS = \
-module \
-avoid-version \
--
1.7.10.4
11 years, 9 months
[PATCH 1/2] report-gtk : move the warnings are from a page to the main report window
by Jakub Filak
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/gui-wizard-gtk/wizard.c | 31 ++++++++++++--
src/gui-wizard-gtk/wizard.glade | 89 +++------------------------------------
2 files changed, 33 insertions(+), 87 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 30c25ee..713e3d2 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -2455,9 +2455,7 @@ static void add_pages(void)
g_eb_comment = GTK_EVENT_BOX( gtk_builder_get_object(g_builder, "eb_comment"));
g_cb_no_comment = GTK_CHECK_BUTTON( gtk_builder_get_object(g_builder, "cb_no_comment"));
g_tv_details = GTK_TREE_VIEW( gtk_builder_get_object(g_builder, "tv_details"));
- g_box_warning_labels = GTK_BOX( gtk_builder_get_object(g_builder, "box_warning_labels"));
g_tb_approve_bt = GTK_TOGGLE_BUTTON(gtk_builder_get_object(g_builder, "cb_approve_bt"));
- g_widget_warnings_area = GTK_WIDGET( gtk_builder_get_object(g_builder, "box_warning_area"));
g_search_entry_bt = GTK_ENTRY( gtk_builder_get_object(g_builder, "entry_search_bt"));
g_container_details1 = GTK_CONTAINER( gtk_builder_get_object(g_builder, "container_details1"));
g_container_details2 = GTK_CONTAINER( gtk_builder_get_object(g_builder, "container_details2"));
@@ -2469,7 +2467,6 @@ static void add_pages(void)
g_spinner_event_log = GTK_SPINNER( gtk_builder_get_object(g_builder, "spinner_event_log"));
gtk_widget_set_no_show_all(GTK_WIDGET(g_spinner_event_log), true);
- gtk_widget_hide(g_widget_warnings_area);
gtk_widget_modify_font(GTK_WIDGET(g_tv_event_log), g_monospace_font);
fix_all_wrapped_labels(GTK_WIDGET(g_assistant));
@@ -2591,8 +2588,36 @@ void create_assistant(void)
gtk_box_pack_start(g_box_buttons, w, true, true, 5);
gtk_box_pack_start(g_box_buttons, g_btn_next, false, false, 5);
+ /* Warnings area widget definition start */
+ GtkWidget *alignment_top = gtk_alignment_new(0.5,0.5,1,1);
+ gtk_widget_set_visible(alignment_top, TRUE);
+
+ GtkWidget *alignment_bottom = gtk_alignment_new(0.5,0.5,1,1);
+ gtk_widget_set_visible(alignment_bottom, TRUE);
+
+ g_box_warning_labels = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0));
+ gtk_widget_set_visible(GTK_WIDGET(g_box_warning_labels), TRUE);
+
+ GtkBox *vbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0));
+ gtk_widget_set_visible(GTK_WIDGET(vbox), TRUE);
+ gtk_box_pack_start(vbox, alignment_top, false, false, 5);
+ gtk_box_pack_start(vbox, GTK_WIDGET(g_box_warning_labels), false, false, 5);
+ gtk_box_pack_start(vbox, alignment_bottom, false, false, 5);
+
+ GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+ gtk_widget_set_visible(image, TRUE);
+
+ g_widget_warnings_area = GTK_WIDGET(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
+ gtk_widget_set_visible(g_widget_warnings_area, FALSE);
+ gtk_widget_set_no_show_all(g_widget_warnings_area, TRUE);
+ gtk_box_pack_start(GTK_BOX(g_widget_warnings_area), image, false, false, 5);
+ gtk_box_pack_start(GTK_BOX(g_widget_warnings_area), GTK_WIDGET(vbox), false, false, 5);
+ /* Warnings area widget definition end */
+
g_box_assistant = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 0));
gtk_box_pack_start(g_box_assistant, GTK_WIDGET(g_assistant), true, true, 5);
+
+ gtk_box_pack_start(g_box_assistant, GTK_WIDGET(g_widget_warnings_area), false, false, 5);
gtk_box_pack_start(g_box_assistant, GTK_WIDGET(g_box_buttons), false, false, 5);
gtk_widget_show_all(GTK_WIDGET(g_box_buttons));
diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade
index 41924eb..782cf4a 100644
--- a/src/gui-wizard-gtk/wizard.glade
+++ b/src/gui-wizard-gtk/wizard.glade
@@ -159,6 +159,7 @@
<child>
<object class="GtkCheckButton" id="cb_no_comment">
<property name="label" translatable="yes">I don't know what caused this problem</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -204,6 +205,7 @@
<child>
<object class="GtkButton" id="button_cfg1">
<property name="label">gtk-preferences</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -302,90 +304,7 @@
<property name="can_focus">False</property>
<property name="border_width">5</property>
<child>
- <object class="GtkHBox" id="box_warning_area">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <child>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-dialog-warning</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="box_warning_labels">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">1</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="padding">1</property>
- <property name="position">0</property>
- </packing>
+ <placeholder/>
</child>
<child>
<object class="GtkVBox" id="vbox5">
@@ -553,6 +472,7 @@
<child>
<object class="GtkButton" id="btn_add_file">
<property name="label" translatable="yes">Attach a file</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -577,6 +497,7 @@
<child>
<object class="GtkCheckButton" id="cb_approve_bt">
<property name="label" translatable="yes">I reviewed the data and _agree with submitting it</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
--
1.7.10.2
11 years, 9 months
[PATCH] don't try to delete dump dir which doesn't exist rhbz#799909
by Jiri Moskovcak
---
src/lib/abrt_sock.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/lib/abrt_sock.c b/src/lib/abrt_sock.c
index b2c9928..f4a5d77 100644
--- a/src/lib/abrt_sock.c
+++ b/src/lib/abrt_sock.c
@@ -62,6 +62,19 @@ static int connect_to_abrtd_and_call_DeleteDebugDump(const char *dump_dir_name)
int delete_dump_dir_possibly_using_abrtd(const char *dump_dir_name)
{
+
+ struct stat stat_buf;
+ int res = stat(dump_dir_name, &stat_buf);
+ /* don't try to delete the dir if the stat fails */
+ if (res != 0)
+ {
+ if (errno == ENOENT)
+ {
+ error_msg(_("Directory '%s' doesn't exist"), dump_dir_name);
+ }
+ return res;
+ }
+
/* Try to delete it ourselves */
struct dump_dir *dd = dd_opendir(dump_dir_name, DD_OPEN_READONLY);
if (dd)
--
1.7.10.4
11 years, 9 months
[libreport] [PATCH] python-meh patched to pass the traceback string, not the filename
by Vratislav Podzimek
Remove the 17 months old "temporary glue" reading the traceback
generated and dumped by python-meh to a file. python-meh now passes
the contents of the file, not just the filename.
---
src/report-python/__init__.py | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py
index 6f4f543..34b1ed1 100644
--- a/src/report-python/__init__.py
+++ b/src/report-python/__init__.py
@@ -144,7 +144,7 @@ def createAlertSignature(component, hashmarkername, hashvalue, summary, alertSig
# used in anaconda / python-meh
def createPythonUnhandledExceptionSignature(**kwargs):
mandatory_args = ["component", "hashmarkername", "duphash", "reason",
- "description", "exnFileName"]
+ "description"]
for arg in mandatory_args:
if arg not in kwargs:
@@ -164,15 +164,6 @@ def createPythonUnhandledExceptionSignature(**kwargs):
# need to add "release", parse_release() expects format "<product> release <version>"
pd.add("os_release", product +" release "+ version)
pd.add_basics() # adds product and version + some other required field
- # FIXME: how to handle files out of dump dir??
- # temporary glue: 2011-02-08 (let's see how temporary..)
- exnFileName = kwargs["exnFileName"]
- try:
- inf = open(exnFileName, "r")
- pd.add(os.path.basename(exnFileName), inf.read())
- inf.close()
- except Exception, ex:
- print "Can't add %s to report: %s" % (exnFileName, ex)
return pd
--
1.7.4.4
11 years, 9 months
[PATCH v2] trac#583: add NewProblem function to ABRT D-Bus API
by Jakub Filak
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/dbus/abrt-dbus.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/src/dbus/abrt-dbus.c b/src/dbus/abrt-dbus.c
index 0322e64..6b61f19 100644
--- a/src/dbus/abrt-dbus.c
+++ b/src/dbus/abrt-dbus.c
@@ -21,6 +21,10 @@ static GDBusNodeInfo *introspection_data = NULL;
static const gchar introspection_xml[] =
"<node>"
" <interface name='"ABRT_DBUS_IFACE"'>"
+ " <method name='NewProblem'>"
+ " <arg type='a{ss}' name='problem_data' direction='in'/>"
+ " <arg type='s' name='problem_id' direction='out'/>"
+ " </method>"
" <method name='GetProblems'>"
" <arg type='as' name='response' direction='out'/>"
" </method>"
@@ -358,12 +362,47 @@ static bool allowed_problem_dir(const char *dir_name)
return true;
}
+static bool handle_new_problem(GVariant *problem_info, char **problem_id, char **error)
+{
+ bool result = true;
+
+ problem_data_t *pd = problem_data_new();
+
+ GVariantIter *iter;
+ g_variant_get(problem_info, "a{ss}", &iter);
+ gchar *key, *value;
+ while (g_variant_iter_loop(iter, "{ss}", &key, &value))
+ {
+ if (problem_data_add_item(pd, key, value) != 0)
+ {
+ if (error)
+ *error = xasprintf("Cannot save item '%s'", key);
+
+ result = false;
+ goto handle_new_problem_cleanup;
+ }
+ }
+
+ if (problem_data_save(pd, problem_id) != 0)
+ {
+ if (error)
+ *error = xasprintf("Cannot create a new problem");
+
+ result = false;
+ }
+
+handle_new_problem_cleanup:
+ problem_data_destroy(pd);
+ return result;
+}
+
static void return_InvalidProblemDir_error(GDBusMethodInvocation *invocation, const char *dir_name)
{
char *msg = xasprintf(_("'%s' is not a valid problem directory"), dir_name);
g_dbus_method_invocation_return_dbus_error(invocation,
"org.freedesktop.problems.InvalidProblemDir",
msg);
+
free(msg);
}
@@ -388,6 +427,26 @@ static void handle_method_call(GDBusConnection *connection,
if (caller_uid == (uid_t) -1)
return;
+ if (g_strcmp0(method_name, "NewProblem") == 0)
+ {
+ char *problem_id = NULL;
+ char *error = NULL;
+ if (!handle_new_problem(g_variant_get_child_value(parameters, 0), &problem_id, &error))
+ {
+ g_dbus_method_invocation_return_dbus_error(invocation,
+ "org.freedesktop.problems.Failure",
+ error);
+ free(error);
+ return;
+ }
+ // else
+ response = g_variant_new("(s)", problem_id);
+ g_dbus_method_invocation_return_value(invocation, response);
+ free(problem_id);
+
+ return;
+ }
+
if (g_strcmp0(method_name, "GetProblems") == 0)
{
response = get_problem_dirs_for_uid(caller_uid, g_settings_dump_location);
--
1.7.10.4
11 years, 10 months
Re: ABRT for Ruby
by Vít Ondruch
Dne 10.7.2012 17:06, John5342 napsal(a):
> On Tue, Jul 10, 2012 at 3:27 PM, Vít Ondruch <vondruch(a)redhat.com> wrote:
>> Dne 10.7.2012 16:12, John5342 napsal(a):
>>> If the Ruby documentation is to be believed you could use
>>> Kernel#caller to get a stack trace which apparently has a set format
>>> including the file name. It is of course swapping a user modifiable
>>> value for something slightly more fragile (it could potentially change
>>> in some future version). Perhaps use the current way and fall back to
>>> Kernel#caller if $0 doesn't resolve to a real file (which would
>>> indicate it has been modified.
>>>
>>> None of this of course covers scenarios where user/other code is
>>> loaded from within another program (think rake, thor, etc) but in the
>>> case of an exception, Exception#backtrace is the same format as
>>> Kernel#caller.
>>>
>> John, thank you. Use of the Exception#backtrace is nice idea! Have to take a
>> look into.
>>
>> It might be even possible to extract the "latest gem" in the backtrace and
>> assign the bug to it, but I am not sure if that is good idea, since the
>> error might be in the gem as well as in its caller. In that case, I would
>> expect that the library consumer/application author has "more" knowledge
>> about the library then the library author about the consumer/application.
>> Thoughts?
> Yeah i think you are right there. The entry point is the only
> guaranteed thing. The more you narrow things down from there the more
> work is needed to avoid getting things wrong so it really depends on
> how much effort you want to put into it.
>
> Certainly if i was maintaining a ruby program i would not mind
> receiving bugs that are in the end caused by a library used by my
> program. I would easily be able to forward it on plus if i have had a
> bug then i can watch for the fix etc.
Right. I will keep it simple for now, report it to the entry point
application. Thinking about gems would definitely add more fragility
than anything else.
> Bonus points though if the
> report could include a complete list of loaded gems/packages (to help
> in ruling out monkey patching issues and the like) and the list of
> gems/packages in the call stack at the time of the error (would make
> it much easier to see where the problems _could_ be).
>
This could be done. The python handler for example adds values of local
variables as a bonus. This might be also very valuable information. Will
try to keep that idea in mind, if I'll get bored ;)
Vit
11 years, 10 months