Added example events that attach vim config files whenever vim crashes.
---
abrt.spec.in | 3 ++
src/plugins/Makefile.am | 9 +++++-
src/plugins/collect_vimrc_system.xml.in | 7 +++++
src/plugins/collect_vimrc_user.xml.in | 7 +++++
src/plugins/vimrc_event.conf | 42 +++++++++++++++++++++++++++++++
5 files changed, 66 insertions(+), 2 deletions(-)
create mode 100644 src/plugins/collect_vimrc_system.xml.in
create mode 100644 src/plugins/collect_vimrc_user.xml.in
create mode 100644 src/plugins/vimrc_event.conf
diff --git a/abrt.spec.in b/abrt.spec.in
index 93286bd..fadeb86 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -403,10 +403,13 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null
|| :
%{_sbindir}/abrt-install-ccpp-hook
%{_sysconfdir}/libreport/events.d/ccpp_event.conf
%{_sysconfdir}/libreport/events.d/gconf_event.conf
+%{_sysconfdir}/libreport/events.d/vimrc_event.conf
%{_sysconfdir}/libreport/events/analyze_LocalGDB.xml
%{_sysconfdir}/libreport/events/collect_xsession_errors.xml
%{_sysconfdir}/libreport/events/collect_Smolt.xml
%{_sysconfdir}/libreport/events/collect_GConf.xml
+%{_sysconfdir}/libreport/events/collect_vimrc_user.xml
+%{_sysconfdir}/libreport/events/collect_vimrc_system.xml
%{_mandir}/man*/abrt-action-trim-files.*
%{_mandir}/man*/abrt-action-generate-backtrace.*
%{_mandir}/man*/abrt-action-analyze-backtrace.*
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index c887574..95956a4 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -29,7 +29,9 @@ dist_events_DATA = \
analyze_RetraceServer.xml \
collect_xsession_errors.xml \
collect_Smolt.xml \
- collect_GConf.xml
+ collect_GConf.xml \
+ collect_vimrc_user.xml \
+ collect_vimrc_system.xml
@INTLTOOL_XML_RULE@
@@ -42,7 +44,8 @@ dist_eventsconf_DATA = \
python_event.conf \
smart_event.conf \
smolt_event.conf \
- gconf_event.conf
+ gconf_event.conf \
+ vimrc_event.conf
man_MANS = \
abrt-plugins.7
@@ -80,6 +83,8 @@ EXTRA_DIST = \
collect_Smolt.xml.in \
collect_xsession_errors.xml.in \
collect_GConf.xml.in \
+ collect_vimrc_user.xml.in \
+ collect_vimrc_system.xml.in \
analyze_LocalGDB.xml.in \
analyze_RetraceServer.xml.in
diff --git a/src/plugins/collect_vimrc_system.xml.in
b/src/plugins/collect_vimrc_system.xml.in
new file mode 100644
index 0000000..486e5e0
--- /dev/null
+++ b/src/plugins/collect_vimrc_system.xml.in
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<event>
+ <_name>Collect system-wide vim configuration files</_name>
+ <_description>Save /etc/vimrc and /etc/gvimrc</_description>
+ <_long-description>Checks if there are vimrc and gvimrc files in /etc and saves
them as system_vimrc and system_gvimrc, respectively.</_long-description>
+ <creates-items>system_vimrc,system_gvimrc</creates-items>
+</event>
diff --git a/src/plugins/collect_vimrc_user.xml.in
b/src/plugins/collect_vimrc_user.xml.in
new file mode 100644
index 0000000..934df18
--- /dev/null
+++ b/src/plugins/collect_vimrc_user.xml.in
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<event>
+ <_name>Collect yours vim configuration files</_name>
+ <_description>Save .vimrc and .gvimrc from your home
directory</_description>
+ <_long-description>Checks if there are .vimrc and .gvimrc in your home
directory and saves them as user_vimrc and user_gvimrc,
respectively.</_long-description>
+ <creates-items>user_vimrc,user_gvimrc</creates-items>
+</event>
diff --git a/src/plugins/vimrc_event.conf b/src/plugins/vimrc_event.conf
new file mode 100644
index 0000000..6487854
--- /dev/null
+++ b/src/plugins/vimrc_event.conf
@@ -0,0 +1,42 @@
+# Exemple events that allow the reporter to attach vim configuration files
+# whenever vim crash is reported.
+
+EVENT=collect_vimrc_user component=vim
+ # there has to be a comment here, otherwise
+ # the next line is interpreted as a condition
+ vimrc=~/.vimrc
+ gvimrc=~/.gvimrc
+ saved=none
+ if [ -r $vimrc -a -f $vimrc ]; then
+ cp $vimrc user_vimrc || exit $?
+ saved="$saved, user_vimrc"
+ else
+ echo "File $vimrc not found"
+ fi
+ if [ -r $gvimrc -a -f $gvimrc ]; then
+ cp $gvimrc user_gvimrc || exit $?
+ saved="$saved, user_gvimrc"
+ else
+ echo "File $gvimrc not found"
+ fi
+ echo "Elements saved: ${saved#none, }"
+
+EVENT=collect_vimrc_system component=vim
+ # there has to be a comment here, otherwise
+ # the next line is interpreted as a condition
+ vimrc=/etc/vimrc
+ gvimrc=/etc/gvimrc
+ saved=none
+ if [ -r $vimrc -a -f $vimrc ]; then
+ cp $vimrc system_vimrc || exit $?
+ saved="$saved, system_vimrc"
+ else
+ echo "File $vimrc not found"
+ fi
+ if [ -r $gvimrc -a -f $gvimrc ]; then
+ cp $gvimrc system_gvimrc || exit $?
+ saved="$saved, system_gvimrc"
+ else
+ echo "File $gvimrc not found"
+ fi
+ echo "Elements saved: ${saved#none, }"
--
1.7.6