mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 14:07:01 +01:00
gnu: diffoscope: Update to 166.
* gnu/packages/diffoscope.scm (diffoscope): Update to 166. [source]: Add patch to use magic.open compatibility interface. * gnu/packages/patches/diffoscope-revert-to-magic-open.patch: New file. * gnu/local.mk [dist_patch_DATA]: New patch.
This commit is contained in:
parent
6bf136c890
commit
f813750a4a
3 changed files with 75 additions and 2 deletions
|
@ -926,6 +926,7 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/desmume-gcc6-fixes.patch \
|
||||
%D%/packages/patches/desmume-gcc7-fixes.patch \
|
||||
%D%/packages/patches/dfu-programmer-fix-libusb.patch \
|
||||
%D%/packages/patches/diffoscope-revert-to-magic-open.patch \
|
||||
%D%/packages/patches/diffutils-gets-undeclared.patch \
|
||||
%D%/packages/patches/dkimproxy-add-ipv6-support.patch \
|
||||
%D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch \
|
||||
|
|
|
@ -72,7 +72,7 @@ (define-module (gnu packages diffoscope)
|
|||
(define-public diffoscope
|
||||
(package
|
||||
(name "diffoscope")
|
||||
(version "165")
|
||||
(version "166")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
|
@ -81,7 +81,9 @@ (define-public diffoscope
|
|||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0chi8drkxdwk7mlfgljij0nihnxp9pi5ybhqaq8rc4l1zl6srirb"))))
|
||||
"0vc4a38ii6b10af4c7cxfkvj4lk4ihx1xs4q5lshnkyg74gmm21b"))
|
||||
(patches (search-patches
|
||||
"diffoscope-revert-to-magic-open.patch"))))
|
||||
(build-system python-build-system)
|
||||
(arguments
|
||||
`(#:phases (modify-phases %standard-phases
|
||||
|
|
70
gnu/packages/patches/diffoscope-revert-to-magic-open.patch
Normal file
70
gnu/packages/patches/diffoscope-revert-to-magic-open.patch
Normal file
|
@ -0,0 +1,70 @@
|
|||
From b658c3a6819ccb9a104b13e973132c66f0965965 Mon Sep 17 00:00:00 2001
|
||||
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
|
||||
Date: Thu, 11 Feb 2021 17:28:21 -0800
|
||||
Subject: [PATCH] Revert "Prefer to use magic.Magic over the magic.open
|
||||
compatibility interface. (Closes: reproducible-builds/diffoscope#236)"
|
||||
|
||||
This reverts commit c72c30f29ea3760eb4c785644dc7cd4c26833740.
|
||||
---
|
||||
diffoscope/comparators/utils/file.py | 28 ++++++++++++++--------------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/diffoscope/comparators/utils/file.py b/diffoscope/comparators/utils/file.py
|
||||
index fb3b4316..32700f02 100644
|
||||
--- a/diffoscope/comparators/utils/file.py
|
||||
+++ b/diffoscope/comparators/utils/file.py
|
||||
@@ -65,37 +65,37 @@ def _run_tests(fold, tests):
|
||||
|
||||
|
||||
class File(metaclass=abc.ABCMeta):
|
||||
- if hasattr(magic, "Magic"): # use python-magic
|
||||
+ if hasattr(magic, "open"): # use Magic-file-extensions from file
|
||||
|
||||
@classmethod
|
||||
def guess_file_type(cls, path):
|
||||
if not hasattr(cls, "_mimedb"):
|
||||
- cls._mimedb = magic.Magic()
|
||||
- return maybe_decode(cls._mimedb.from_file(path))
|
||||
+ cls._mimedb = magic.open(magic.NONE)
|
||||
+ cls._mimedb.load()
|
||||
+ return cls._mimedb.file(
|
||||
+ path.encode("utf-8", errors="surrogateescape")
|
||||
+ )
|
||||
|
||||
@classmethod
|
||||
def guess_encoding(cls, path):
|
||||
if not hasattr(cls, "_mimedb_encoding"):
|
||||
- cls._mimedb_encoding = magic.Magic(mime_encoding=True)
|
||||
- return maybe_decode(cls._mimedb_encoding.from_file(path))
|
||||
+ cls._mimedb_encoding = magic.open(magic.MAGIC_MIME_ENCODING)
|
||||
+ cls._mimedb_encoding.load()
|
||||
+ return cls._mimedb_encoding.file(path)
|
||||
|
||||
- else: # use Magic-file-extensions from file
|
||||
+ else: # use python-magic
|
||||
|
||||
@classmethod
|
||||
def guess_file_type(cls, path):
|
||||
if not hasattr(cls, "_mimedb"):
|
||||
- cls._mimedb = magic.open(magic.NONE)
|
||||
- cls._mimedb.load()
|
||||
- return cls._mimedb.file(
|
||||
- path.encode("utf-8", errors="surrogateescape")
|
||||
- )
|
||||
+ cls._mimedb = magic.Magic()
|
||||
+ return maybe_decode(cls._mimedb.from_file(path))
|
||||
|
||||
@classmethod
|
||||
def guess_encoding(cls, path):
|
||||
if not hasattr(cls, "_mimedb_encoding"):
|
||||
- cls._mimedb_encoding = magic.open(magic.MAGIC_MIME_ENCODING)
|
||||
- cls._mimedb_encoding.load()
|
||||
- return cls._mimedb_encoding.file(path)
|
||||
+ cls._mimedb_encoding = magic.Magic(mime_encoding=True)
|
||||
+ return maybe_decode(cls._mimedb_encoding.from_file(path))
|
||||
|
||||
def __init__(self, container=None):
|
||||
self._comments = []
|
||||
--
|
||||
2.30.0
|
||||
|
Loading…
Reference in a new issue