summaryrefslogtreecommitdiff
path: root/app-admin/syslog-summary
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-09-02 14:09:07 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-09-02 14:09:07 +0100
commitb17a3ef12038de50228bade1f05502c74e135321 (patch)
tree9026dffec53f92cba48ca9a500a4f778e6304380 /app-admin/syslog-summary
parent3cf7c3ef441822c889356fd1812ebf2944a59851 (diff)
gentoo resync : 02.09.2020
Diffstat (limited to 'app-admin/syslog-summary')
-rw-r--r--app-admin/syslog-summary/Manifest2
-rw-r--r--app-admin/syslog-summary/files/syslog-summary-1.14-py3.patch142
-rw-r--r--app-admin/syslog-summary/syslog-summary-1.14-r5.ebuild46
3 files changed, 190 insertions, 0 deletions
diff --git a/app-admin/syslog-summary/Manifest b/app-admin/syslog-summary/Manifest
index 354305b5d0b9..75a40257bf53 100644
--- a/app-admin/syslog-summary/Manifest
+++ b/app-admin/syslog-summary/Manifest
@@ -1,8 +1,10 @@
AUX syslog-summary-1.14-fix-ignore-code.patch 306 BLAKE2B e319592affd7f13c88cd4ea2ba993050474fa1f96351d0144e20ca0ada5fc4ba5aa5243adc71a99efa12ea189757b05fc76f649688eece6261a0f7697bd3719a SHA512 cc6cdaf03d62a1bda5bcbd4c395ef1fbbc7be7a61ec88df6c7784e14c6a3cf677e58304cf4b5caafe115f7267e38262978a148fe9811bdce0f10966df72c709b
+AUX syslog-summary-1.14-py3.patch 3982 BLAKE2B e468d0312a9a83b5f6a779223169cb95ad1dc86419c3e82bd5cc6b8955894fcca59723f48ab3b9c3bdc1bfad2b7d9b4524d1da40524432fe58e7391ee808560a SHA512 e3b806e31c4d4456c771f35203a164f85e1859d4885b8ccee35b22856e9628f668f05b5d0ef621c8e41e652d2365670a901ed99a582ff7d8b78452d3b1a209fc
AUX syslog-summary-1.14-remove-file-magic.patch 836 BLAKE2B a4b2d7d40ab7c15ac33325c97d8bea3df7d7f824c3d301a6be764ac0a5ce9721fd7d6dbdd6a6f48432931fdfca7a2f1cf141eab897e8bdfa1eba20f2f9485153 SHA512 1f860cb96cf5eef124217c8253264fe24f6b7fde3d078d2f41e419490bdb3d9d4df6fed7c9b8cc68a855dfc06f81dfdc4c7e868d9812ed1a306ac65cbc97f833
DIST syslog-summary-1.14.tar.gz 7278 BLAKE2B 609e506c099b734be87ba6d6e21f70283d4654ab5c6d3794da71099f3e590d178348c13ab271ddb84682220091adfd702c107bf2dee792419de3ce14d2a9c9db SHA512 db1f0660ad435eea26fc3ec4cd475f5f1b98bb629495707741077e52aef88fe8bff4a318bb5b0821e57ccfa0646454c6825a5a4fc1fb4b73ea67cbd4defef277
EBUILD syslog-summary-1.14-r1.ebuild 766 BLAKE2B 036754524dd9c11b985c2ef5777636aba3be7bc92b1ed430cc00cf1ac93701f442354dfe9b12e7a0dcbfca4625a7b6fceea2cb218e9ad3fa2a42f39e098bda39 SHA512 f865914965a0ea4f6db355429c4ffedc768c491c9d7f93a6668422bc3e307be31465fe003462bbf45c73857b292110132bd4499d023040516a1c614fb716a549
EBUILD syslog-summary-1.14-r2.ebuild 944 BLAKE2B ef4dde4b5da0ce5ae1b28e9200d2d51fbca075f30bb72a6f1bb49104d980da37ea44c872901ee207e392cf5f06a3f4a9a5bc032da5f4d50a9fc8805c12366c66 SHA512 47fe494a2bc164750e4804b6c6e8dfa9328b072ab9e7ca0e77e1f2bc4d253387f4e3ed13bfd1d84cc729d15f71faf58660484803ae2c38dcd61d77c2ef79ff5a
EBUILD syslog-summary-1.14-r3.ebuild 991 BLAKE2B 9086206934c07f3d810faec448a65cd24492bdd986d7832c95579aaba61136595b6b9c4f4d8fd5d406e32cd15ad9369d095b2e3c68e762267c894738bff5be6f SHA512 c127aa0387176e078d31b46729c9b437e4537b2821ec7b4eda4d7c742e31e014ce1d33f3d3ef3666ccee1de0a21759f27f5feaaf778ee0f26ee703bd26ddd94b
EBUILD syslog-summary-1.14-r4.ebuild 843 BLAKE2B 7937d374d41d63881205b78d45e73ee5c11ac7a8b21437048e1596c8ac10fb4d7402ea8686a84ad4ab5379b197ff4ed4dc74f1f8d6b2ca06ec32aa5463c70cf4 SHA512 d5b54c48351a7cb82f6c988138621633008367b8a3a8fb02ee05f52a7975cb9799757d04ca17ff0a031ed6354f01c98c22ab8d1188a842cdb354a9cbdbe09c17
+EBUILD syslog-summary-1.14-r5.ebuild 890 BLAKE2B 4a3e7c6eb9edba0f835e7159f5e92de927322bdf2eb57e74e14a75b83fcf3db4e8193c6c2f2dc68a021388191a2f9332b44029650e19285d971a97146068bf3e SHA512 07665a4f8b723cdf0c273eddbd04b48d004933ea8af666fdcd73b506671b89cb8622a25c35469a07868ef9273a186930986dec9a5bf6af9478693f7696a770d1
MISC metadata.xml 464 BLAKE2B 862ef04e25fe1aa6609e2ea68c9d61a9c201d43ffab9db6a02244ca9192f4fd11a1f1f4e4d6f7e365660c4043b28a959d5da9783f3c6f0ed4f69eb625784763c SHA512 64073e0ef15c4fbe057f51c09505ea3db8d5e1427c2d581b55137e7fba37f5fef13103cfe4d0e58c74052601d4bae0ed26e36346d497653ea080fe5649f956eb
diff --git a/app-admin/syslog-summary/files/syslog-summary-1.14-py3.patch b/app-admin/syslog-summary/files/syslog-summary-1.14-py3.patch
new file mode 100644
index 000000000000..945c7ce290be
--- /dev/null
+++ b/app-admin/syslog-summary/files/syslog-summary-1.14-py3.patch
@@ -0,0 +1,142 @@
+diff --git a/syslog-summary b/syslog-summary
+index abf6381..a658c14 100755
+--- a/syslog-summary
++++ b/syslog-summary
+@@ -35,6 +35,8 @@ Lars Wirzenius <liw@iki.fi>
+ Tommi Virtanen <tv@debian.org>
+ David Paleino <d.paleino@gmail.com>"""
+
++from __future__ import print_function
++
+ version = "1.14"
+
+ import sys, re, getopt, string
+@@ -62,7 +64,7 @@ def io_error(err, filename, die=True):
+ if die:
+ traceback.print_exc(file=sys.stderr)
+ else:
+- print "[E] %s [%s(%s) - %s]" % (os.strerror(num), errno.errorcode[num], num, filename)
++ print("[E] %s [%s(%s) - %s]" % (os.strerror(num), errno.errorcode[num], num, filename))
+
+ if die:
+ sys.exit(1)
+@@ -72,7 +74,7 @@ def read_patterns(filename):
+ pats = []
+ try:
+ f = open(filename, "r")
+- except IOError, e:
++ except IOError as e:
+ io_error(e, filename, False)
+ return []
+ for line in f:
+@@ -91,7 +93,7 @@ def read_states(filename):
+ return states
+ try:
+ f = open(filename, "r")
+- except IOError, e:
++ except IOError as e:
+ io_error(e, filename, False)
+ return states
+ for line in f:
+@@ -105,9 +107,9 @@ def save_states(filename, states):
+ return
+ try:
+ f = open(filename, "w")
+- except IOError, e:
++ except IOError as e:
+ io_error(e, filename, True)
+- for filename in states.keys():
++ for filename in list(states.keys()):
+ value = states[filename]
+ f.write("%s %d %s\n" % (filename, value[0], value[1]))
+ f.close()
+@@ -123,7 +125,7 @@ def split_date(line):
+ m = pat.match(line)
+ if m:
+ return line[:m.end()], line[m.end():]
+- print "line has bad date", "<" + string.rstrip(line) + ">"
++ print("line has bad date", "<" + string.rstrip(line) + ">")
+ return None, line
+
+ def is_gzipped(filename):
+@@ -152,7 +154,7 @@ def summarize(filename, states):
+ order = []
+ ignored_count = 0
+ if not QUIET:
+- print "Summarizing %s" % filename
++ print("Summarizing %s" % filename)
+
+ # If the file is a gzipped log, open it
+ # using the proper function from the gzip
+@@ -162,7 +164,7 @@ def summarize(filename, states):
+ file = gzopen(filename, "rb")
+ else:
+ file = open(filename, "r")
+- except IOError, e:
++ except IOError as e:
+ io_error(e, filename, True)
+
+ linecount = 0
+@@ -170,7 +172,7 @@ def summarize(filename, states):
+ shaobj = sha1()
+ if filename in states:
+ oldlines, oldsha = states[filename]
+- for i in xrange(oldlines):
++ for i in range(oldlines):
+ line = file.readline()
+ shaobj.update(line)
+ # print "OLD-new: %s" % shaobj.hexdigest()
+@@ -182,7 +184,7 @@ def summarize(filename, states):
+ else:
+ linecount = oldlines
+ if not QUIET:
+- print "%8d Lines skipped (already processed)" % linecount
++ print("%8d Lines skipped (already processed)" % linecount)
+
+ line = file.readline()
+ previous = None
+@@ -190,13 +192,13 @@ def summarize(filename, states):
+ foo=0
+ while line:
+ # foo+=1
+- shaobj.update(line)
++ shaobj.update(line.encode())
+ linecount += 1
+
+ if should_be_ignored(line):
+ ignored_count += 1
+ if DEBUG:
+- print "Ignoring: %s" % line
++ print("Ignoring: %s" % line)
+ line = file.readline()
+
+ date, rest = split_date(line)
+@@ -213,7 +215,7 @@ def summarize(filename, states):
+ count = int(repeated.group(1))
+ rest = previous
+
+- if counts.has_key(rest):
++ if rest in counts:
+ counts[rest] = counts[rest] + count
+ else:
+ assert count == 1
+@@ -233,14 +235,14 @@ def summarize(filename, states):
+ # print states
+
+ if QUIET and order:
+- print "Summarizing %s" % filename
++ print("Summarizing %s" % filename)
+ if not QUIET or order:
+- print "%8d Patterns to ignore" % len(ignore_pats)
+- print "%8d Ignored lines" % ignored_count
++ print("%8d Patterns to ignore" % len(ignore_pats))
++ print("%8d Ignored lines" % ignored_count)
+ for rest in order:
+- print "%8d %s" % (counts[rest], rest),
++ print("%8d %s" % (counts[rest], rest), end='')
+ if not QUIET or order:
+- print
++ print()
+
+ def main():
+ global ignore_pats, IGNORE_FILENAME, STATE_FILENAME, REPEAT, QUIET, DEBUG
diff --git a/app-admin/syslog-summary/syslog-summary-1.14-r5.ebuild b/app-admin/syslog-summary/syslog-summary-1.14-r5.ebuild
new file mode 100644
index 000000000000..b419bb9212bc
--- /dev/null
+++ b/app-admin/syslog-summary/syslog-summary-1.14-r5.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8,9} )
+
+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" \
+ "${FILESDIR}/${P}-remove-file-magic.patch" \
+ "${FILESDIR}/${P}-py3.patch" \
+ )
+
+src_prepare() {
+ python_fix_shebang -f syslog-summary
+
+ # 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
+}