summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Healy <lmiphay@gmail.com>2020-06-21 12:27:35 +0100
committerJoonas Niilola <juippis@gentoo.org>2020-06-28 13:40:58 +0300
commit45a0856880a4292e8592e7dba2b3165c312e0482 (patch)
tree498bb95ba05c762af183f116a1806861733a0dad /app-admin/syslog-summary/files/syslog-summary-1.14-remove-file-magic.patch
parentx11-wm/cwm: drop old unsupported version (diff)
downloadgentoo-45a0856880a4292e8592e7dba2b3165c312e0482.tar.gz
gentoo-45a0856880a4292e8592e7dba2b3165c312e0482.tar.bz2
gentoo-45a0856880a4292e8592e7dba2b3165c312e0482.zip
app-admin/syslog-summary: remove file magic dep
Replace the soft dep on sys-apps/file (magic module) with the existing fallback file suffix check Remove the sys-apps/file[python] suggestion in pkg_postinst Closes: https://bugs.gentoo.org/722560 Signed-off-by: Paul Healy <lmiphay@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/16360 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-admin/syslog-summary/files/syslog-summary-1.14-remove-file-magic.patch')
-rw-r--r--app-admin/syslog-summary/files/syslog-summary-1.14-remove-file-magic.patch35
1 files changed, 35 insertions, 0 deletions
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
new file mode 100644
index 000000000000..c7a1738b7c8d
--- /dev/null
+++ b/app-admin/syslog-summary/files/syslog-summary-1.14-remove-file-magic.patch
@@ -0,0 +1,35 @@
+diff --git a/syslog-summary b/syslog-summary
+index abf6381..b3edffc 100755
+--- a/syslog-summary
++++ b/syslog-summary
+@@ -128,24 +128,12 @@ def split_date(line):
+
+ def is_gzipped(filename):
+ """Returns True if the filename is a gzipped compressed file"""
+- try:
+- import magic
+- ms = magic.open(magic.MAGIC_NONE)
+- ms.load()
+- if re.search("^gzip compressed data.*", ms.file(filename)):
+- return True
+- else:
+- return False
+- except:
+- from os.path import splitext
+-
+- if not QUIET:
+- print "Using fallback detection... please install python-magic for better gzip detection."
+-
+- if splitext(filename)[1] == ".gz":
+- return True
+- else:
+- return False
++ from os.path import splitext
++
++ if splitext(filename)[1] == ".gz":
++ return True
++ else:
++ return False
+
+ def summarize(filename, states):
+ counts = {}