Author: cboltz
Date: Mon Feb 18 23:02:26 2008
New Revision: 8792
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8792&view=rev
Log:
Initial SVN commit of patch2mail
Short description:
patch2mail checks zypp-checkpatches-wrapper for available updates and
sends a mail to root if any patches are available.
This commit fixes https://bugzilla.novell.com/show_bug.cgi?id=283501 :-)
Added:
trunk/tools/
trunk/tools/patch2mail/
trunk/tools/patch2mail/README
trunk/tools/patch2mail/patch2mail (with props)
trunk/tools/patch2mail/patch2mail.spec
trunk/tools/patch2mail/patch2mail.xsl
trunk/tools/patch2mail/patch2mail.xsl_10.2
Added: trunk/tools/patch2mail/README
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/tools/patch2mail/README?rev=8792&view=auto
==============================================================================
--- trunk/tools/patch2mail/README (added)
+++ trunk/tools/patch2mail/README Mon Feb 18 23:02:26 2008
@@ -0,0 +1,38 @@
+patch2mail
+~~~~~~~~~~
+
+patch2mail checks zypp-checkpatches-wrapper for available updates and
+sends a mail to root if any patches are available.
+
+Usage is very simple: just install the RPM :-)
+It comes with the script in /etc/cron.daily and sends the mail to root.
+
+If you want to install this script manually, follow the %install section
+in patch2mail.spec ;-)
+
+
+Authors
+~~~~~~~
+
+Christian Boltz < p a c k a g e s AT c b o l t z DOT d e >
+
+Thanks to Thomas Schraitle for helping with some xslt details.
+
+
+License / Copyright
+~~~~~~~~~~~~~~~~~~~
+
+Copyright (c) 2007 Christian Boltz - www.cboltz.de
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License (http://www.gnu.org/copyleft/gpl.html)
+for more details.
+
+
Added: trunk/tools/patch2mail/patch2mail
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/tools/patch2mail/patch2mail?rev=8792&view=auto
==============================================================================
--- trunk/tools/patch2mail/patch2mail (added)
+++ trunk/tools/patch2mail/patch2mail Mon Feb 18 23:02:26 2008
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+tmp="$(mktemp /tmp/updates.XXXXXX)"
+
+/usr/sbin/zypp-checkpatches-wrapper | xsltproc /usr/share/patch2mail/patch2mail.xsl - > "$tmp"
+grep "ERROR\|^===" "$tmp" >/dev/null || {
+ rm -f "$tmp"
+ exit 0 # no updates, no errors
+}
+
+grep -v "^__TOTAL__" "$tmp" | mail -s "$(hostname) updates" root
+# echo "*** $(hostname) updates ***"; grep -v "^__TOTAL__" "$tmp"
+rm -f "$tmp"
Added: trunk/tools/patch2mail/patch2mail.spec
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/tools/patch2mail/patch2mail.spec?rev=8792&view=auto
==============================================================================
--- trunk/tools/patch2mail/patch2mail.spec (added)
+++ trunk/tools/patch2mail/patch2mail.spec Mon Feb 18 23:02:26 2008
@@ -0,0 +1,62 @@
+# norootforbuild
+#
+Name: patch2mail
+Version: 0.9.1
+Release: 1
+#
+License: GPL
+Group: System/Packages
+#
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: bash
+#
+URL: http://www.cboltz.de
+Source: %{name}-%{version}.tar.bz2
+#
+Summary: patch2mail - patch notification via mail
+BuildArch: noarch
+
+Requires: bash mktemp mail grep zypper libxslt coreutils net-tools
+# detailed requirements:
+# zypper # zypp-checkpatches-wrapper
+# libxslt # xsltproc
+# coreutils # rm
+# net-tools # hostname
+
+%description
+patch2mail checks zypp-checkpatches-wrapper for available
+updates and sends a mail to root if any patches are available
+
+Authors:
+----------
+ Christian Boltz < p a c k a g e s AT c b o l t z DOT d e >
+
+%prep
+%setup
+
+%build
+
+%install
+%{__mkdir} -p %{buildroot}/usr/share/%{name}
+
+%if 0%{?suse_version} < 1030
+ %{__cp} patch2mail.xsl_10.2 %{buildroot}/usr/share/%{name}/patch2mail.xsl
+%else
+ %{__cp} patch2mail.xsl %{buildroot}/usr/share/%{name}/
+%endif
+
+%{__mkdir} -p %{buildroot}/etc/cron.daily
+%{__cp} patch2mail %{buildroot}/etc/cron.daily/
+
+echo === Buildroot: %{buildroot} ===
+find %{buildroot}
+echo ================================
+
+%clean
+
+%files
+%defattr(-,root,root)
+%attr(755, root, root) /etc/cron.daily/%{name}
+/usr/share/%{name}/
+/usr/share/%{name}/%{name}.xsl
+
Added: trunk/tools/patch2mail/patch2mail.xsl
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/tools/patch2mail/patch2mail.xsl?rev=8792&view=auto
==============================================================================
--- trunk/tools/patch2mail/patch2mail.xsl (added)
+++ trunk/tools/patch2mail/patch2mail.xsl Mon Feb 18 23:02:26 2008
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<!--
+
+Copyright (c) 2007 Christian Boltz - www.cboltz.de
+
+Thanks to Thomas Schraitle for helping with some xslt details.
+
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License (http://www.gnu.org/copyleft/gpl.html)
+for more details.
+
+-->
+
+