diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-02 19:52:39 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-05-02 19:52:39 +0200 |
commit | f06cd3a1382110566dd4a834a951a09d34eae0d8 (patch) | |
tree | 616b9242f98af23af913fb6794e1878ab88c3f42 | |
parent | 83514402882c80fe6bc7ac989ca78ad3cb122464 (diff) | |
parent | cdec5d0d390d8f77230a5cb6b8872e7bf7e92ea1 (diff) | |
download | abrt-f06cd3a1382110566dd4a834a951a09d34eae0d8.tar.gz abrt-f06cd3a1382110566dd4a834a951a09d34eae0d8.tar.xz abrt-f06cd3a1382110566dd4a834a951a09d34eae0d8.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | abrt.spec.in | 3 | ||||
-rw-r--r-- | asciidoc.conf | 18 | ||||
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | src/plugins/Makefile.am | 16 | ||||
-rwxr-xr-x | src/plugins/abrt-action-list-dsos.py | 29 | ||||
-rw-r--r-- | src/plugins/abrt-action-mailx.c | 2 | ||||
-rw-r--r-- | src/plugins/abrt-action-mailx.txt | 91 |
8 files changed, 162 insertions, 17 deletions
diff --git a/Makefile.am b/Makefile.am index 731e7e03..c8671dd5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ DISTCHECK_CONFIGURE_FLAGS = \ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) EXTRA_DIST = doc/coding-style abrt.spec.in abrt.pc.in doc/abrt-plugin/ doc/howto-write-reporter \ - gen-version + gen-version asciidoc.conf pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = abrt.pc diff --git a/abrt.spec.in b/abrt.spec.in index b23aaa6e..59848c12 100644 --- a/abrt.spec.in +++ b/abrt.spec.in @@ -34,6 +34,8 @@ BuildRequires: intltool BuildRequires: libtool BuildRequires: nss-devel BuildRequires: texinfo +BuildRequires: asciidoc +BuildRequires: xmlto # for rhel6 %if 0%{?rhel} >= 6 @@ -564,6 +566,7 @@ fi %{_sysconfdir}/%{name}/events/report_Mailx.xml %config(noreplace) %{_sysconfdir}/%{name}/events.d/mailx_events.conf %{_mandir}/man7/abrt-Mailx.7.gz +%{_mandir}/man*/abrt-action-mailx.* %{_bindir}/abrt-action-mailx %files plugin-bugzilla diff --git a/asciidoc.conf b/asciidoc.conf new file mode 100644 index 00000000..7bbce41d --- /dev/null +++ b/asciidoc.conf @@ -0,0 +1,18 @@ +ifdef::doctype-manpage[] +ifdef::backend-docbook[] +[header] +template::[header-declarations] +<refentry> +<refmeta> +<refentrytitle>{mantitle}</refentrytitle> +<manvolnum>{manvolnum}</manvolnum> +<refmiscinfo class="source">abrt</refmiscinfo> +<refmiscinfo class="version">{abrt_version}</refmiscinfo> +<refmiscinfo class="manual">ABRT Manual</refmiscinfo> +</refmeta> +<refnamediv> + <refname>{manname}</refname> + <refpurpose>{manpurpose}</refpurpose> +</refnamediv> +endif::backend-docbook[] +endif::doctype-manpage[] diff --git a/configure.ac b/configure.ac index be36b3f9..9dbf47f1 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,24 @@ if test -z "$PYTHON"; then exit 1 fi +AC_PATH_PROG([ASCIIDOC], [asciidoc], [no]) +[if test "$ASCIIDOC" = "no"] +[then] + [echo "The asciidoc program was not found in the search path. Please ensure"] + [echo "that it is installed and its directory is included in the search path."] + [echo "Then run configure again before attempting to build ABRT."] + [exit 1] +[fi] + +AC_PATH_PROG([XMLTO], [xmlto], [no]) +[if test "$XMLTO" = "no"] +[then] + [echo "The xmlto program was not found in the search path. Please ensure"] + [echo "that it is installed and its directory is included in the search path."] + [echo "Then run configure again before attempting to build ABRT."] + [exit 1] +[fi] + PKG_CHECK_MODULES([GTK], [gtk+-2.0]) PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.21]) PKG_CHECK_MODULES([DBUS], [dbus-1]) diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 52006b5e..8744a7d9 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -60,6 +60,21 @@ man_MANS = \ abrt-Upload.7 \ abrt-plugins.7 +MAN_TXT = \ + abrt-action-mailx.txt + +# Manual pages are generated from .txt via Docbook +man1_MANS = ${MAN_TXT:%.txt=%.1} + +%.1 %.5 %.7: %.xml + xmlto man $< + +%.xml: %.txt ../../asciidoc.conf + asciidoc --backend=docbook --doctype=manpage --conf-file ../../asciidoc.conf -aabrt_version=$(PACKAGE_VERSION) -o $@ $< + + +CLEANFILES = $(man1_MANS) + PYTHON_FILES = \ abrt-action-install-debuginfo.py \ abrt-action-list-dsos.py \ @@ -67,6 +82,7 @@ PYTHON_FILES = \ EXTRA_DIST = \ $(man_MANS) \ + $(MAN_TXT) \ $(PYTHON_FILES) \ report_Bugzilla.xml.in \ report_Bugzilla.conf \ diff --git a/src/plugins/abrt-action-list-dsos.py b/src/plugins/abrt-action-list-dsos.py index 8b8a06ab..81a99276 100755 --- a/src/plugins/abrt-action-list-dsos.py +++ b/src/plugins/abrt-action-list-dsos.py @@ -7,13 +7,6 @@ import os import getopt import rpm -GETTEXT_PROGNAME = "abrt" -import locale -import gettext - -_ = lambda x: gettext.lgettext(x) - - def log(s): sys.stderr.write("%s\n" % s) @@ -22,26 +15,27 @@ def error_msg(s): def error_msg_and_die(s): sys.stderr.write("%s\n" % s) - os.exit(1) + sys.exit(1) def xopen(name, mode): try: r = open(name, mode) except IOError, e: - error_msg_and_die("Can't open '%s': %s" % (name, e)); + error_msg_and_die("Can't open '%s': %s" % (name, e)) return r def parse_maps(maps_path): try: f = xopen(maps_path, "r") - return [x.strip()[x.find('/'):] for x in f.readlines() if x.find('/') > -1] + # set() -> uniqifies the list of filenames + return set([x.strip()[x.find('/'):] for x in f.readlines() if x.find('/') > -1]) except IOError, e: - error_msg_and_die("Can't read '%s': %s" % (name, e)); + error_msg_and_die("Can't read '%s': %s" % (maps_path, e)) if __name__ == "__main__": progname = os.path.basename(sys.argv[0]) - help_text = _("Usage: %s [-o OUTFILE] -m PROC_PID_MAP_FILE") % progname + help_text = ("Usage: %s [-o OUTFILE] -m PROC_PID_MAP_FILE") % progname try: opts, args = getopt.getopt(sys.argv[1:], "o:m:h", ["help"]) except getopt.GetoptError, err: @@ -63,7 +57,7 @@ if __name__ == "__main__": memfile = arg if not memfile: - error_msg(_("MAP_FILE is not specified")) + error_msg("MAP_FILE is not specified") error_msg_and_die(help_text) try: @@ -81,10 +75,15 @@ if __name__ == "__main__": if outname: outfile = xopen(outname, "w") outname = None - outfile.write("%s %s (%s)\n" % (path, h[rpm.RPMTAG_NEVRA], h[rpm.RPMTAG_VENDOR])) + outfile.write("%s %s (%s) %s\n" % + (path, + h[rpm.RPMTAG_NEVRA], + h[rpm.RPMTAG_VENDOR], + h[rpm.RPMTAG_INSTALLTIME]) + ) except Exception, ex: - error_msg_and_die("Can't get the DSO list: %s", ex) + error_msg_and_die("Can't get the DSO list: %s" % ex) outfile.close() except: diff --git a/src/plugins/abrt-action-mailx.c b/src/plugins/abrt-action-mailx.c index a4ee31cd..d1b35564 100644 --- a/src/plugins/abrt-action-mailx.c +++ b/src/plugins/abrt-action-mailx.c @@ -142,7 +142,7 @@ int main(int argc, char **argv) const char *program_usage_string = _( PROGNAME" [-v] -d DIR [-c CONFFILE]\n" "\n" - "Sends compressed tarball of dump directory DIR via email" + "Sends contents of a dump directory DIR via email" ); enum { OPT_v = 1 << 0, diff --git a/src/plugins/abrt-action-mailx.txt b/src/plugins/abrt-action-mailx.txt new file mode 100644 index 00000000..2fb11bef --- /dev/null +++ b/src/plugins/abrt-action-mailx.txt @@ -0,0 +1,91 @@ +abrt-action-mailx(1) +==================== + +NAME +---- +abrt-action-mailx - Sends contents of a dump directory via email. + +SYNOPSIS +-------- +'abrt-action-mailx' [-v] -d DIR [-c CONFFILE] + +DESCRIPTION +----------- +The tool reads a problem dump directory, composes an email message +from the directory contents, and uses mailx to send the message to +specified recipient. + +Properties of email messages can be specified in a configuration file, +and via environment variables. + +Configuration file +~~~~~~~~~~~~~~~~~~ +Configuration file contains entries in a format "Option = Value". + +The options are: + +'Subject':: + The subject of the email message. + +'EmailFrom':: + The sender of the email message. + +'EmailTo':: + The recipient of the email message. + +'SendBinaryData':: + Use yes/true/on/1 to attach all binary files from the dump + directory to the email. This can cause the emails to be very + large. + +Integration with ABRT events +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +'abrt-action-mailx' can be used as a reporter, to allow users report +problems via email when they decide to do it. This usage is +pre-configured in /etc/abrt/events.d/mailx_events.conf: + +------------ +EVENT=report_Mailx abrt-action-mailx +------------ + +It can also be used to notify administrator automatically when a +problem happens. When this is desired, modify the event configuration +file to run the tool on the 'post-create' event: + +------------ +EVENT=post-create abrt-action-mailx +------------ + +OPTIONS +------- +-d DIR:: + Path to dump directory. + +-c CONFFILE:: + Path to configration file. When used in ABRT event system, the file + contains site-wide configuration. Users can change the values via + environment variables. + +ENVIRONMENT VARIABLES +--------------------- +Environment variables take precedence over values provided in +the configuration file. + +'Mailx_Subject':: + Subject of the email message. + +'Mailx_EmailFrom':: + Sender of the email message. + +'Mailx_EmailTo':: + Recipient of the email message. If nor the environment variable + nor the corresponding option is defined, the message is send to + "root@localhost". + +'Mailx_SendBinaryData':: + Use yes/true/on/1 to attach all binary files from the dump + directory to the email. + +AUTHORS +------- +* ABRT team |