summaryrefslogtreecommitdiff
path: root/dev-python/python-magic
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-25 22:29:52 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-25 22:29:52 +0000
commit4dc9bfa1f12673bbf1343e64af7e0cd715534a9f (patch)
treeb6bfc88046aa092bbc03342aef7eccf310d43692 /dev-python/python-magic
parent8cd3c41aa0ccead302235680b9e2fa9903d7548e (diff)
gentoo auto-resync : 25:11:2023 - 22:29:52
Diffstat (limited to 'dev-python/python-magic')
-rw-r--r--dev-python/python-magic/Manifest4
-rw-r--r--dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch26
-rw-r--r--dev-python/python-magic/files/python-magic-0.4.27-test.patch69
-rw-r--r--dev-python/python-magic/python-magic-0.4.27.ebuild5
4 files changed, 74 insertions, 30 deletions
diff --git a/dev-python/python-magic/Manifest b/dev-python/python-magic/Manifest
index b397ed94626f..7553c5a1d4ac 100644
--- a/dev-python/python-magic/Manifest
+++ b/dev-python/python-magic/Manifest
@@ -1,4 +1,4 @@
-AUX python-magic-0.4.27-fix-gzip-test.patch 1053 BLAKE2B f2f013396cfcfca6e2769af498b216da2d683f57925667ccfcdd6f1608b0bac7453b251c465eb4ffbcb53ce5297a1a44902bf2bc7d5e590070d921820a70172f SHA512 1103e053e99294fbd99c0be0e4be8378489d14a08f16bd3d4189685afe0bb435486b818ad36af6e53ceae51478990957e4fce487552796d88b48c07961775075
+AUX python-magic-0.4.27-test.patch 3064 BLAKE2B 1edb8199a7b674423b19680b2202dd25e0fa70c2819ad3f66fd038453e2143fb27640efbc086ce9beeec3bae3a13d705591920268867c9ee585b7455bcfe1acc SHA512 d685b25095c51eba91497ba218768a464b5e616d6ca4e11787b27022ca4a3fe53bacc3b334f615682717297e7ae84776ede322576a1f8ab6a3fdb48a3038fdd0
DIST python-magic-0.4.27.gh.tar.gz 863649 BLAKE2B 4ba22d0f8bd5e70eb37e3b46eba1b885d49682bf45d703ad7966bcc67614427ebe597e3100575f863b7e54421c6de6fc875af24a9d5b49742fe07b361b65f198 SHA512 a476730a5caa9a2a784187f57743d5cec4b1829a6a76d4d1fb4e0112caf5487888961df293bc38074ef1a5d313b0fc4aed4cc99b980f5336e8a907c44a33e84e
-EBUILD python-magic-0.4.27.ebuild 840 BLAKE2B d65e1628bdfa6d8c4e0075888b7339f7587b52709376f66172595acddc6d2f82907e11b56bf3899f11a3ba769d306f20360f976ad71bd8d534737c83b2ffe44b SHA512 87aef46ab1d14f728cba6fb3213ee2c1809f3cdc14bc628efc77cb5b03ac6e51b6fcaf9621984bf58aa07a9df2afe249668d9109264019b73d90c9f147e19cb0
+EBUILD python-magic-0.4.27.ebuild 856 BLAKE2B 3f4cc0ce5d71c8a458d13f084a1608897c6648bcf29035d71d875e7b1c8e9b8daf894d56d6ee159a0b10fef0fa9f081255c3f8b792513ae7e75a38fbbcc2a3df SHA512 de9b8cd37ecd2fc8d03222ddb09af5d394d8cba2a920e0a0f541b186a8fd3cfdc851a29339a9fa35cecb947eb5d1d977820d6f4de38794c08eeab9591880ef8b
MISC metadata.xml 411 BLAKE2B 614256656c3be285f997a177b6239cc4f6c253c8708cdb7339dab99f6a21fdec0a36af90a5c8cbe39f29939cfb64b276abd572fd9687e609a26e1098bb1ceb69 SHA512 ff2c756d280d753fe614396f5dda04958b3a3d0a3d94586724d2580d5901af01ebe30e1cbb98e263ca6dd95e6043222311be375595653cbf7ccf54dff9cd971e
diff --git a/dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch b/dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch
deleted file mode 100644
index 9a978146f32d..000000000000
--- a/dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-https://github.com/ahupp/python-magic/commit/4ffcd59113fa26d7c2e9d5897b1eef919fd4b457
-
-From 4ffcd59113fa26d7c2e9d5897b1eef919fd4b457 Mon Sep 17 00:00:00 2001
-From: Adam Hupp <adam@hupp.org>
-Date: Mon, 9 Jan 2023 12:55:15 -0800
-Subject: [PATCH] update test for upstream added gzip extensions
-
---- a/test/python_magic_test.py
-+++ b/test/python_magic_test.py
-@@ -134,7 +134,7 @@ def test_extension(self):
- self.assert_values(m, {
- # some versions return '' for the extensions of a gz file,
- # including w/ the command line. Who knows...
-- 'test.gz': ('gz/tgz/tpz/zabw/svgz', '', '???'),
-+ 'test.gz': ('gz/tgz/tpz/zabw/svgz/adz/kmy/xcfgz', 'gz/tgz/tpz/zabw/svgz', '', '???'),
- 'name_use.jpg': 'jpeg/jpg/jpe/jfif',
- })
- except NotImplementedError:
-@@ -227,6 +227,5 @@ def test_pathlike(self):
- m = magic.Magic(mime=True)
- self.assertEqual('application/pdf', m.from_file(path))
-
--
- if __name__ == '__main__':
- unittest.main()
-
diff --git a/dev-python/python-magic/files/python-magic-0.4.27-test.patch b/dev-python/python-magic/files/python-magic-0.4.27-test.patch
new file mode 100644
index 000000000000..a4e94251fe9f
--- /dev/null
+++ b/dev-python/python-magic/files/python-magic-0.4.27-test.patch
@@ -0,0 +1,69 @@
+https://github.com/ahupp/python-magic/commit/4ffcd59113fa26d7c2e9d5897b1eef919fd4b457
+
+From 4ffcd59113fa26d7c2e9d5897b1eef919fd4b457 Mon Sep 17 00:00:00 2001
+From: Adam Hupp <adam@hupp.org>
+Date: Mon, 9 Jan 2023 12:55:15 -0800
+Subject: [PATCH] update test for upstream added gzip extensions
+
+--- a/test/python_magic_test.py
++++ b/test/python_magic_test.py
+@@ -134,7 +134,7 @@ def test_extension(self):
+ self.assert_values(m, {
+ # some versions return '' for the extensions of a gz file,
+ # including w/ the command line. Who knows...
+- 'test.gz': ('gz/tgz/tpz/zabw/svgz', '', '???'),
++ 'test.gz': ('gz/tgz/tpz/zabw/svgz/adz/kmy/xcfgz', 'gz/tgz/tpz/zabw/svgz', '', '???'),
+ 'name_use.jpg': 'jpeg/jpg/jpe/jfif',
+ })
+ except NotImplementedError:
+@@ -227,6 +227,5 @@ def test_pathlike(self):
+ m = magic.Magic(mime=True)
+ self.assertEqual('application/pdf', m.from_file(path))
+
+-
+ if __name__ == '__main__':
+ unittest.main()
+
+From b434c88c9c8e901adf5b3779e3aac65f10d90aab Mon Sep 17 00:00:00 2001
+From: Dominique Leuenberger <dimstar@opensuse.org>
+Date: Wed, 2 Aug 2023 11:29:47 +0200
+Subject: [PATCH 1/2] Fix test suite with file 5.45
+
+[ 12s] test/python_magic_test.py:53: in assert_values
+[ 12s] self.assertIn(value, expected_value)
+[ 12s] E AssertionError: 'PDF document, version 1.2, 2 page(s)' not found in ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages')
+---
+ test/libmagic_test.py | 2 +-
+ test/python_magic_test.py | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/test/libmagic_test.py b/test/libmagic_test.py
+index 5719a58..7b4665b 100644
+--- a/test/libmagic_test.py
++++ b/test/libmagic_test.py
+@@ -15,7 +15,7 @@ class MagicTestCase(unittest.TestCase):
+ filename = os.path.join(TESTDATA_DIR, 'test.pdf')
+ expected_mime_type = 'application/pdf'
+ expected_encoding = 'us-ascii'
+- expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages')
++ expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages', 'PDF document, version 1.2, 2 page(s)')
+
+ def assert_result(self, result):
+ self.assertEqual(result.mime_type, self.expected_mime_type)
+diff --git a/test/python_magic_test.py b/test/python_magic_test.py
+index 624a443..78f63a3 100755
+--- a/test/python_magic_test.py
++++ b/test/python_magic_test.py
+@@ -108,7 +108,8 @@ class MagicTest(unittest.TestCase):
+ self.assert_values(m, {
+ 'magic._pyc_': 'python 2.4 byte-compiled',
+ 'test.pdf': ('PDF document, version 1.2',
+- 'PDF document, version 1.2, 2 pages'),
++ 'PDF document, version 1.2, 2 pages',
++ 'PDF document, version 1.2, 2 page(s)'),
+ 'test.gz':
+ ('gzip compressed data, was "test", from Unix, last '
+ 'modified: Sun Jun 29 01:32:52 2008',
+--
+2.43.0
+
diff --git a/dev-python/python-magic/python-magic-0.4.27.ebuild b/dev-python/python-magic/python-magic-0.4.27.ebuild
index 18f913a8638a..8b18fbc7f7e8 100644
--- a/dev-python/python-magic/python-magic-0.4.27.ebuild
+++ b/dev-python/python-magic/python-magic-0.4.27.ebuild
@@ -20,7 +20,7 @@ SRC_URI="
LICENSE="BSD-2 MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux"
RDEPEND="
sys-apps/file[-python]
@@ -32,7 +32,8 @@ BDEPEND="
"
PATCHES=(
- "${FILESDIR}"/${P}-fix-gzip-test.patch
+ # upstream git backports
+ "${FILESDIR}"/${P}-test.patch
)
distutils_enable_tests unittest