diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-09 12:29:54 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-09 12:29:54 +0100 |
| commit | 28c588d6a86daa3d2f2bb7cdb4604d79e7dcf08b (patch) | |
| tree | 7bc2d9c122c4cbf284c338a22a5ddf778cf91176 /src | |
| parent | dc3c5b79ba1ee6fd7a98842fde43d072e004f93b (diff) | |
| download | abrt-28c588d6a86daa3d2f2bb7cdb4604d79e7dcf08b.tar.gz abrt-28c588d6a86daa3d2f2bb7cdb4604d79e7dcf08b.tar.xz abrt-28c588d6a86daa3d2f2bb7cdb4604d79e7dcf08b.zip | |
create report-libs-devel package; separate out report headers
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/applet/Makefile.am | 12 | ||||
| -rw-r--r-- | src/cli/Makefile.am | 5 | ||||
| -rw-r--r-- | src/cli/report.cpp | 19 | ||||
| -rw-r--r-- | src/daemon/Makefile.am | 8 | ||||
| -rw-r--r-- | src/hooks/Makefile.am | 8 | ||||
| -rw-r--r-- | src/include/Makefile.am | 16 | ||||
| -rw-r--r-- | src/include/report/crash_dump.h (renamed from src/include/crash_dump.h) | 0 | ||||
| -rw-r--r-- | src/include/report/dump_dir.h (renamed from src/include/dump_dir.h) | 0 | ||||
| -rw-r--r-- | src/include/report/run_event.h (renamed from src/include/run_event.h) | 0 | ||||
| -rw-r--r-- | src/lib/Makefile.am | 20 | ||||
| -rw-r--r-- | src/plugins/Makefile.am | 56 |
11 files changed, 76 insertions, 68 deletions
diff --git a/src/applet/Makefile.am b/src/applet/Makefile.am index d32eaa37..dbd88bdf 100644 --- a/src/applet/Makefile.am +++ b/src/applet/Makefile.am @@ -5,11 +5,8 @@ abrt_applet_SOURCES = \ Applet.cpp \ applet_gtk.h applet_gtk.c abrt_applet_CPPFLAGS = \ - -Wall -Werror \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ - -I/usr/include/glib-2.0 \ - -I/usr/lib/glib-2.0/include \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ -DCONF_DIR=\"$(CONF_DIR)\" \ @@ -19,7 +16,10 @@ abrt_applet_CPPFLAGS = \ -DICON_DIR=\"${datadir}/abrt/icons/hicolor/48x48/status\" \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ - -D_GNU_SOURCE + -D_GNU_SOURCE \ + -Wall -Werror +# -I/usr/include/glib-2.0 +# -I/usr/lib/glib-2.0/include # $(LIBNOTIFY_CFLAGS) # $(DBUS_GLIB_CFLAGS) abrt_applet_LDADD = \ @@ -35,7 +35,7 @@ abrt_applet_LDADD = \ # test_report.cpp #test_report_CPPFLAGS = \ # -Wall -Werror \ -# -I$(srcdir)/../include \ +# -I$(srcdir)/../include/report -I$(srcdir)/../include \ # -D_GNU_SOURCE #test_report_LDADD = \ # ../lib/libabrt.la diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am index 3584fd6c..9346dd16 100644 --- a/src/cli/Makefile.am +++ b/src/cli/Makefile.am @@ -7,12 +7,13 @@ abrt_cli_SOURCES = \ dbus.h dbus.cpp abrt_cli_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DVAR_RUN=\"$(VAR_RUN)\" \ $(ENABLE_SOCKET_OR_DBUS) \ $(DBUS_CFLAGS) $(GLIB_CFLAGS) \ - -D_GNU_SOURCE + -D_GNU_SOURCE \ + -Wall -Werror # $(GTK_CFLAGS) abrt_cli_LDADD = \ diff --git a/src/cli/report.cpp b/src/cli/report.cpp index 556e06b4..f87486a7 100644 --- a/src/cli/report.cpp +++ b/src/cli/report.cpp @@ -356,15 +356,14 @@ static int run_report_editor(crash_data_t *crash_data) FILE *fp = fdopen(fd, "w"); if (!fp) /* errno is set */ { - perror_msg("can't open '%s' to save the crash report", filename); - return 2; + die_out_of_memory(); } write_crash_report(crash_data, fp); if (fclose(fp)) /* errno is set */ { - perror_msg("can't close '%s'", filename); + perror_msg("can't write '%s'", filename); return 2; } @@ -381,21 +380,18 @@ static int run_report_editor(crash_data_t *crash_data) } fseek(fp, 0, SEEK_END); - long size = ftell(fp); + unsigned long size = ftell(fp); fseek(fp, 0, SEEK_SET); char *text = (char*)xmalloc(size + 1); if (fread(text, 1, size, fp) != size) { error_msg("can't read '%s'", filename); + fclose(fp); return 2; } text[size] = '\0'; - if (fclose(fp) != 0) /* errno is set */ - { - perror_msg("can't close '%s'", filename); - return 2; - } + fclose(fp); // Delete the tempfile. if (unlink(filename) == -1) /* errno is set */ @@ -448,7 +444,8 @@ static bool ask_yesno(const char *question) fflush(NULL); char answer[16]; - fgets(answer, sizeof(answer), stdin); + if (!fgets(answer, sizeof(answer), stdin)) + return false; /* Use strncmp here because the answer might contain a newline as the last char. */ return 0 == strncmp(answer, yes, strlen(yes)); @@ -529,7 +526,7 @@ static GHashTable *get_reporter_plugin_settings(const vector_string_t& reporters /* Load plugin config in the home dir. Do not skip lines * with empty value (but containing a "key="), * because user may want to override password - * from /etc/abrt/plugins/*.conf, but he prefers to + * from /etc/abrt/plugins/foo.conf, but he prefers to * enter it every time he reports. */ map_string_h *single_plugin_settings = new_map_string(); char *path = xasprintf("%s/.abrt/%s.conf", homedir, key); diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index d25a21b1..1362bb0c 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -18,7 +18,7 @@ abrtd_SOURCES = \ Settings.h Settings.cpp \ Daemon.h Daemon.cpp abrtd_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -43,7 +43,7 @@ abrtd_LDADD = \ abrt_server_SOURCES = \ abrt-server.c abrt_server_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -61,7 +61,7 @@ abrt_server_LDADD = \ abrt_handle_crashdump_SOURCES = \ abrt-handle-crashdump.c abrt_handle_crashdump_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -83,7 +83,7 @@ abrt_action_save_package_data_SOURCES = \ Settings.h Settings.cpp \ abrt-action-save-package-data.cpp abrt_action_save_package_data_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am index eedf1a60..0ba2ad57 100644 --- a/src/hooks/Makefile.am +++ b/src/hooks/Makefile.am @@ -5,12 +5,13 @@ bin_PROGRAMS = dumpoops abrt_hook_ccpp_SOURCES = \ abrt-hook-ccpp.c abrt_hook_ccpp_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DCONF_DIR=\"$(CONF_DIR)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ $(GLIB_CFLAGS) \ + -Wall \ -D_GNU_SOURCE abrt_hook_ccpp_LDADD = \ ../lib/libabrt.la @@ -19,7 +20,7 @@ abrt_hook_ccpp_LDADD = \ dumpoops_SOURCES = \ dumpoops.cpp dumpoops_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -I$(srcdir)/../plugins \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ @@ -28,8 +29,9 @@ dumpoops_CPPFLAGS = \ -DCONF_DIR=\"$(CONF_DIR)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ $(GLIB_CFLAGS) \ + -Wall -Werror \ -D_GNU_SOURCE -# build will succeed, but at runtime plugins do need ABRT*d*Utils +# build will succeed without it, but at runtime plugins do need libabrt_daemon dumpoops_LDADD = \ ../lib/libabrt_daemon.la \ ../lib/libabrt.la diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 5b61bd82..165c705b 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -1,8 +1,11 @@ -HEADER_FILES = \ - crash_dump.h \ - dump_dir.h \ - run_event.h \ - \ +libreport_includedir = $(includedir)/report +libreport_include_HEADERS = \ + report/crash_dump.h \ + report/dump_dir.h \ + report/run_event.h + +libabrt_includedir = $(includedir)/abrt +libabrt_include_HEADERS = \ abrtlib.h \ abrt_types.h \ comm_layer_inner.h \ @@ -13,6 +16,3 @@ HEADER_FILES = \ action.h \ analyzer.h \ xfuncs.h - -lib_includedir=$(includedir)/abrt/ -lib_include_HEADERS = $(HEADER_FILES) diff --git a/src/include/crash_dump.h b/src/include/report/crash_dump.h index 10ddc885..10ddc885 100644 --- a/src/include/crash_dump.h +++ b/src/include/report/crash_dump.h diff --git a/src/include/dump_dir.h b/src/include/report/dump_dir.h index 8cec9459..8cec9459 100644 --- a/src/include/dump_dir.h +++ b/src/include/report/dump_dir.h diff --git a/src/include/run_event.h b/src/include/report/run_event.h index c2e34650..c2e34650 100644 --- a/src/include/run_event.h +++ b/src/include/report/run_event.h diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 1d6c7dc3..384d1c26 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -8,9 +8,6 @@ lib_LTLIBRARIES = \ libabrt_dbus.la \ libabrt_web.la -HEADER_DIR = $(srcdir)/../include -AM_CPPFLAGS = -I$(HEADER_DIR) - # Not used just yet: # time.cpp # xconnect.cpp @@ -46,7 +43,7 @@ libabrt_la_SOURCES = \ parse_options.c parse_options.h libabrt_la_CPPFLAGS = \ -Wall -Werror \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ @@ -63,8 +60,7 @@ libabrt_la_LIBADD = \ libabrt_dbus_la_SOURCES = \ abrt_dbus.c abrt_dbus.h libabrt_dbus_la_CPPFLAGS = \ - -Wall -Werror \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ @@ -72,6 +68,7 @@ libabrt_dbus_la_CPPFLAGS = \ -DVAR_RUN=\"$(VAR_RUN)\" \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ + -Wall -Werror \ -D_GNU_SOURCE libabrt_dbus_la_LDFLAGS = \ -version-info 0:1:0 @@ -80,17 +77,18 @@ libabrt_dbus_la_LIBADD = \ $(DBUS_LIBS) libabrt_daemon_la_SOURCES = \ - $(HEADER_DIR)/comm_layer_inner.h CommLayerInner.cpp \ - $(HEADER_DIR)/plugin.h Plugin.cpp + CommLayerInner.cpp \ + Plugin.cpp libabrt_daemon_la_CPPFLAGS = \ - -Wall \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ -DCONF_DIR=\"$(CONF_DIR)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ $(GLIB_CFLAGS) \ + -Wall \ + -Werror \ -D_GNU_SOURCE libabrt_daemon_la_LDFLAGS = \ -version-info 0:1:0 @@ -102,7 +100,7 @@ libabrt_web_la_SOURCES = \ abrt_xmlrpc.h abrt_xmlrpc.cpp libabrt_web_la_CPPFLAGS = \ -Wall -Werror \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 9ace1b3f..8ee69759 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -1,7 +1,5 @@ -INC_PATH=$(srcdir)/../include -UTILS_PATH=$(srcdir)/../lib -AM_CPPFLAGS = -I$(INC_PATH) -I$(UTILS_PATH) -pluginslibdir=$(PLUGINS_LIB_DIR) +pluginslibdir = $(PLUGINS_LIB_DIR) + libexec_SCRIPTS = \ abrt-action-install-debuginfo.py @@ -18,6 +16,7 @@ dist_pluginslib_DATA = \ KerneloopsReporter.glade pluginsconfdir = $(PLUGINS_CONF_DIR) + dist_pluginsconf_DATA = \ CCpp.conf \ Python.conf \ @@ -49,21 +48,32 @@ install-data-hook: $(DESTDIR)/$(DEBUG_INFO_DIR) $(DESTDIR)$(sysconfdir)/abrt/plugins/Logger.conf # CCpp -libCCpp_la_SOURCES = CCpp.cpp CCpp.h -libCCpp_la_LDFLAGS = -avoid-version -libCCpp_la_CPPFLAGS = -Wall -Werror \ - -I$(INC_PATH) \ - -I$(UTILS_PATH) \ +libCCpp_la_SOURCES = \ + CCpp.cpp CCpp.h +libCCpp_la_CPPFLAGS = \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ + -I$(srcdir)/../lib \ -DCCPP_HOOK_PATH=\"${libexecdir}/abrt-hook-ccpp\" \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DLOCALSTATEDIR='"$(localstatedir)"' \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) \ + -Wall -Werror # -DHOSTILE_KERNEL +libCCpp_la_LDFLAGS = \ + -avoid-version # KerneloopsScanner -libKerneloopsScanner_la_SOURCES = KerneloopsScanner.cpp KerneloopsScanner.h KerneloopsSysLog.cpp KerneloopsSysLog.h -libKerneloopsScanner_la_LDFLAGS = -avoid-version $(GLIB_LIBS) -libKerneloopsScanner_la_CPPFLAGS = -I$(INC_PATH) -I$(UTILS_PATH) -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(GLIB_CFLAGS) +libKerneloopsScanner_la_SOURCES = \ + KerneloopsScanner.cpp KerneloopsScanner.h \ + KerneloopsSysLog.cpp KerneloopsSysLog.h +libKerneloopsScanner_la_CPPFLAGS = \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ + -I$(srcdir)/../lib \ + -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ + $(GLIB_CFLAGS) +libKerneloopsScanner_la_LDFLAGS = \ + -avoid-version \ + $(GLIB_LIBS) libexec_PROGRAMS = \ abrt-action-analyze-c \ @@ -80,7 +90,7 @@ libexec_PROGRAMS = \ abrt_action_analyze_c_SOURCES = \ abrt-action-analyze-c.c abrt_action_analyze_c_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -99,7 +109,7 @@ abrt_action_analyze_c_LDADD = \ abrt_action_analyze_python_SOURCES = \ abrt-action-analyze-python.c abrt_action_analyze_python_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -118,7 +128,7 @@ abrt_action_analyze_python_LDADD = \ abrt_action_analyze_oops_SOURCES = \ abrt-action-analyze-oops.c abrt_action_analyze_oops_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -137,7 +147,7 @@ abrt_action_analyze_oops_LDADD = \ abrt_action_generate_backtrace_SOURCES = \ abrt-action-generate-backtrace.c abrt_action_generate_backtrace_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -157,7 +167,7 @@ abrt_action_generate_backtrace_LDADD = \ abrt_action_bugzilla_SOURCES = \ abrt-action-bugzilla.cpp abrt_action_bugzilla_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -179,7 +189,7 @@ abrt_action_rhtsupport_SOURCES = \ abrt_rh_support.h abrt_rh_support.c \ abrt-action-rhtsupport.cpp abrt_action_rhtsupport_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -203,7 +213,7 @@ abrt_action_rhtsupport_LDADD = \ abrt_action_upload_SOURCES = \ abrt-action-upload.cpp abrt_action_upload_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -226,7 +236,7 @@ abrt_action_upload_LDADD = \ abrt_action_kerneloops_SOURCES = \ abrt-action-kerneloops.cpp abrt_action_kerneloops_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -246,7 +256,7 @@ abrt_action_kerneloops_LDADD = \ abrt_action_mailx_SOURCES = \ abrt-action-mailx.cpp abrt_action_mailx_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -265,7 +275,7 @@ abrt_action_mailx_LDADD = \ abrt_action_print_SOURCES = \ abrt-action-print.cpp abrt_action_print_CPPFLAGS = \ - -I$(srcdir)/../include \ + -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -DBIN_DIR=\"$(bindir)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ |
