app-admin/syslog-summary: fix adjacent line ignore
authorPaul Healy <lmiphay@gmail.com>
Mon, 28 Oct 2019 14:19:39 +0000 (14:19 +0000)
committerJoonas Niilola <juippis@gentoo.org>
Tue, 12 Nov 2019 05:25:23 +0000 (07:25 +0200)
fix for not ignoring a second line when two lines which should be
ignored come together - backport fix from:

  https://github.com/dpaleino/syslog-summary/pull/1/files

switch to EAPI 7

Signed-off-by: Paul Healy <lmiphay@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/13477
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
app-admin/syslog-summary/files/syslog-summary-1.14-fix-ignore-code.patch [new file with mode: 0644]
app-admin/syslog-summary/syslog-summary-1.14-r3.ebuild [new file with mode: 0644]

diff --git a/app-admin/syslog-summary/files/syslog-summary-1.14-fix-ignore-code.patch b/app-admin/syslog-summary/files/syslog-summary-1.14-fix-ignore-code.patch
new file mode 100644 (file)
index 0000000..b66a0ad
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/syslog-summary b/syslog-summary
+index abf6381..65608cb 100755
+--- a/syslog-summary
++++ b/syslog-summary
+@@ -198,6 +198,7 @@ def summarize(filename, states):
+                       if DEBUG:
+                               print "Ignoring: %s" % line
+                       line = file.readline()
++                      continue
+               
+               date, rest = split_date(line)
+               if date:
diff --git a/app-admin/syslog-summary/syslog-summary-1.14-r3.ebuild b/app-admin/syslog-summary/syslog-summary-1.14-r3.ebuild
new file mode 100644 (file)
index 0000000..75c1c04
--- /dev/null
@@ -0,0 +1,49 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1
+
+DESCRIPTION="Summarizes the contents of a syslog log file"
+HOMEPAGE="https://github.com/dpaleino/syslog-summary"
+SRC_URI="https://github.com/downloads/dpaleino/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~sparc ~x86"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND=""
+RDEPEND="${PYTHON_DEPS}"
+
+PATCHES=( "${FILESDIR}/${P}-fix-ignore-code.patch" )
+
+src_prepare() {
+       python_fix_shebang -f syslog-summary
+
+       sed -i -e 's:python-magic:sys-apps/file[python]:' "syslog-summary" || die
+
+       # Sadly, the makefile is useless for us.
+       rm Makefile || die
+
+       default
+}
+
+src_install() {
+       dobin syslog-summary
+       einstalldocs
+       doman syslog-summary.1
+
+       insinto /etc/syslog-summary
+       doins ignore.rules
+}
+
+pkg_postinst() {
+       elog "install sys-apps/file[python] to enable processing"
+       elog "of gzip compressed logfiles"
+}