Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/syslog-summary/, app-admin/syslog-summary/files/
Date: Sun, 28 Jun 2020 10:41:24
Message-Id: 1593340858.45a0856880a4292e8592e7dba2b3165c312e0482.juippis@gentoo
1 commit: 45a0856880a4292e8592e7dba2b3165c312e0482
2 Author: Paul Healy <lmiphay <AT> gmail <DOT> com>
3 AuthorDate: Sun Jun 21 11:27:35 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 28 10:40:58 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45a08568
7
8 app-admin/syslog-summary: remove file magic dep
9
10 Replace the soft dep on sys-apps/file (magic module) with the existing fallback file suffix check
11 Remove the sys-apps/file[python] suggestion in pkg_postinst
12
13 Closes: https://bugs.gentoo.org/722560
14 Signed-off-by: Paul Healy <lmiphay <AT> gmail.com>
15 Closes: https://github.com/gentoo/gentoo/pull/16360
16 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
17
18 .../syslog-summary-1.14-remove-file-magic.patch | 35 ++++++++++++++++++
19 .../syslog-summary/syslog-summary-1.14-r4.ebuild | 42 ++++++++++++++++++++++
20 2 files changed, 77 insertions(+)
21
22 diff --git a/app-admin/syslog-summary/files/syslog-summary-1.14-remove-file-magic.patch b/app-admin/syslog-summary/files/syslog-summary-1.14-remove-file-magic.patch
23 new file mode 100644
24 index 00000000000..c7a1738b7c8
25 --- /dev/null
26 +++ b/app-admin/syslog-summary/files/syslog-summary-1.14-remove-file-magic.patch
27 @@ -0,0 +1,35 @@
28 +diff --git a/syslog-summary b/syslog-summary
29 +index abf6381..b3edffc 100755
30 +--- a/syslog-summary
31 ++++ b/syslog-summary
32 +@@ -128,24 +128,12 @@ def split_date(line):
33 +
34 + def is_gzipped(filename):
35 + """Returns True if the filename is a gzipped compressed file"""
36 +- try:
37 +- import magic
38 +- ms = magic.open(magic.MAGIC_NONE)
39 +- ms.load()
40 +- if re.search("^gzip compressed data.*", ms.file(filename)):
41 +- return True
42 +- else:
43 +- return False
44 +- except:
45 +- from os.path import splitext
46 +-
47 +- if not QUIET:
48 +- print "Using fallback detection... please install python-magic for better gzip detection."
49 +-
50 +- if splitext(filename)[1] == ".gz":
51 +- return True
52 +- else:
53 +- return False
54 ++ from os.path import splitext
55 ++
56 ++ if splitext(filename)[1] == ".gz":
57 ++ return True
58 ++ else:
59 ++ return False
60 +
61 + def summarize(filename, states):
62 + counts = {}
63
64 diff --git a/app-admin/syslog-summary/syslog-summary-1.14-r4.ebuild b/app-admin/syslog-summary/syslog-summary-1.14-r4.ebuild
65 new file mode 100644
66 index 00000000000..1831eb914a2
67 --- /dev/null
68 +++ b/app-admin/syslog-summary/syslog-summary-1.14-r4.ebuild
69 @@ -0,0 +1,42 @@
70 +# Copyright 1999-2020 Gentoo Authors
71 +# Distributed under the terms of the GNU General Public License v2
72 +
73 +EAPI=7
74 +
75 +PYTHON_COMPAT=( python2_7 )
76 +
77 +inherit python-single-r1
78 +
79 +DESCRIPTION="Summarizes the contents of a syslog log file"
80 +HOMEPAGE="https://github.com/dpaleino/syslog-summary"
81 +SRC_URI="https://github.com/downloads/dpaleino/${PN}/${P}.tar.gz"
82 +
83 +LICENSE="GPL-3+"
84 +SLOT="0"
85 +KEYWORDS="~amd64 ~sparc ~x86"
86 +IUSE=""
87 +
88 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
89 +
90 +DEPEND=""
91 +RDEPEND="${PYTHON_DEPS}"
92 +
93 +PATCHES=( "${FILESDIR}/${P}-fix-ignore-code.patch" "${FILESDIR}/${P}-remove-file-magic.patch" )
94 +
95 +src_prepare() {
96 + python_fix_shebang -f syslog-summary
97 +
98 + # Sadly, the makefile is useless for us.
99 + rm Makefile || die
100 +
101 + default
102 +}
103 +
104 +src_install() {
105 + dobin syslog-summary
106 + einstalldocs
107 + doman syslog-summary.1
108 +
109 + insinto /etc/syslog-summary
110 + doins ignore.rules
111 +}