pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/py-magic



Module Name:    pkgsrc
Committed By:   adam
Date:           Thu Feb 18 12:29:55 UTC 2021

Modified Files:
        pkgsrc/sysutils/py-magic: Makefile PLIST distinfo
Added Files:
        pkgsrc/sysutils/py-magic/patches: patch-magic_loader.py
Removed Files:
        pkgsrc/sysutils/py-magic/patches: patch-magic.py

Log Message:
py-magic: updated to 0.4.22

Changes to 0.4.21, 0.4.22

 - Unify dll loader between the standard and compat library, fixing load
 failures on some previously supported platforms.

Changes to 0.4.20

- merge in a compatability layer for the upstream libmagic python binding.
  Since both this package and that one are called 'magic', this compat layer
  removes a very common source of runtime errors.  Use of that libmagic API will
  produce a deprecation warning.

- support python 3.9 in tests and pypi metadata

- add support for magic_descriptor functions, which take a file descriptor
  rather than a filename.

- sometimes the returned description includes snippets of the file, e.g a title
  for MS Word docs.  Since this is in an unknown encoding, we would throw a
  unicode decode error trying to decode.  Now, it decodes with
  'backslashreplace' to handle this more gracefully.  The undecodable characters
  are replaced with hex escapes.

- add support for MAGIC_EXTENSION, to return possible file extensions.

- add mypy typing stubs file, for type checking


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 pkgsrc/sysutils/py-magic/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/sysutils/py-magic/PLIST
cvs rdiff -u -r1.6 -r1.7 pkgsrc/sysutils/py-magic/distinfo
cvs rdiff -u -r1.1 -r0 pkgsrc/sysutils/py-magic/patches/patch-magic.py
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/py-magic/patches/patch-magic_loader.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/py-magic/Makefile
diff -u pkgsrc/sysutils/py-magic/Makefile:1.9 pkgsrc/sysutils/py-magic/Makefile:1.10
--- pkgsrc/sysutils/py-magic/Makefile:1.9       Sun Oct  4 18:15:43 2020
+++ pkgsrc/sysutils/py-magic/Makefile   Thu Feb 18 12:29:54 2021
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.9 2020/10/04 18:15:43 js Exp $
+# $NetBSD: Makefile,v 1.10 2021/02/18 12:29:54 adam Exp $
 
-DISTNAME=      python-magic-0.4.18
-PKGNAME=       ${DISTNAME:S/python/${PYPKGPREFIX}/1}
-PKGREVISION=   1
+DISTNAME=      python-magic-0.4.22
+PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:S/^python-//}
 CATEGORIES=    sysutils python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=p/python-magic/}
 

Index: pkgsrc/sysutils/py-magic/PLIST
diff -u pkgsrc/sysutils/py-magic/PLIST:1.2 pkgsrc/sysutils/py-magic/PLIST:1.3
--- pkgsrc/sysutils/py-magic/PLIST:1.2  Fri May  8 13:57:19 2020
+++ pkgsrc/sysutils/py-magic/PLIST      Thu Feb 18 12:29:54 2021
@@ -1,8 +1,14 @@
-@comment $NetBSD: PLIST,v 1.2 2020/05/08 13:57:19 adam Exp $
+@comment $NetBSD: PLIST,v 1.3 2021/02/18 12:29:54 adam Exp $
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
 ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
 ${PYSITELIB}/${EGG_INFODIR}/top_level.txt
-${PYSITELIB}/magic.py
-${PYSITELIB}/magic.pyc
-${PYSITELIB}/magic.pyo
+${PYSITELIB}/magic/__init__.py
+${PYSITELIB}/magic/__init__.pyc
+${PYSITELIB}/magic/__init__.pyo
+${PYSITELIB}/magic/compat.py
+${PYSITELIB}/magic/compat.pyc
+${PYSITELIB}/magic/compat.pyo
+${PYSITELIB}/magic/loader.py
+${PYSITELIB}/magic/loader.pyc
+${PYSITELIB}/magic/loader.pyo

Index: pkgsrc/sysutils/py-magic/distinfo
diff -u pkgsrc/sysutils/py-magic/distinfo:1.6 pkgsrc/sysutils/py-magic/distinfo:1.7
--- pkgsrc/sysutils/py-magic/distinfo:1.6       Sun Oct  4 18:15:43 2020
+++ pkgsrc/sysutils/py-magic/distinfo   Thu Feb 18 12:29:54 2021
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.6 2020/10/04 18:15:43 js Exp $
+$NetBSD: distinfo,v 1.7 2021/02/18 12:29:54 adam Exp $
 
-SHA1 (python-magic-0.4.18.tar.gz) = b48c84ef096baaf10b4f7cb3792ef8328c946c81
-RMD160 (python-magic-0.4.18.tar.gz) = 54bd572566e60eec7e8b2652ecc6d287ff300d56
-SHA512 (python-magic-0.4.18.tar.gz) = 18c4d75bc762d44f42c44bb52b999930ea570d2dd11d7cb840807e372806dc14164e1b3ea0acb23ccd692177a1a683d4537b01675bc57f06334bcc0f40520e6c
-Size (python-magic-0.4.18.tar.gz) = 11442 bytes
-SHA1 (patch-magic.py) = 54dd70103feb8278601f7dc00731a4f2c6e25f1d
+SHA1 (python-magic-0.4.22.tar.gz) = 36808b9a6138d862d0ac3128b936237191499cd0
+RMD160 (python-magic-0.4.22.tar.gz) = 3a90368e41f15584565321408145ba481e6c3680
+SHA512 (python-magic-0.4.22.tar.gz) = 7c49ba87625abb2fab8f813de85978ce6e9732a5a4be425dc498221008a46a172fd900a42740929964cb0984f925c8d440f4795f5b18fed2b3f8f869092351ff
+Size (python-magic-0.4.22.tar.gz) = 16964 bytes
+SHA1 (patch-magic_loader.py) = 12e8e10dbded41a0a9da885d0e5f50c0471a68bf

Added files:

Index: pkgsrc/sysutils/py-magic/patches/patch-magic_loader.py
diff -u /dev/null pkgsrc/sysutils/py-magic/patches/patch-magic_loader.py:1.1
--- /dev/null   Thu Feb 18 12:29:55 2021
+++ pkgsrc/sysutils/py-magic/patches/patch-magic_loader.py      Thu Feb 18 12:29:55 2021
@@ -0,0 +1,23 @@
+$NetBSD: patch-magic_loader.py,v 1.1 2021/02/18 12:29:55 adam Exp $
+
+NetBSD support.
+
+--- magic/loader.py.orig       2021-02-18 12:24:08.000000000 +0000
++++ magic/loader.py
+@@ -24,9 +24,15 @@ def load_lib():
+                         'win32': windows_dlls,
+                         'cygwin': windows_dlls,
+                         'linux': ['libmagic.so.1'],
++                        'netbsd': ['libmagic.so.6.0'],
+                         # fallback for some Linuxes (e.g. Alpine) where library search does not work # flake8:noqa
+                         }
+-      platform = 'linux' if sys.platform.startswith('linux') else sys.platform
++      if sys.platform.startswith('linux'):
++          platform = 'linux'
++      elif sys.platform.startswith('netbsd'):
++          platform = 'netbsd'
++      else:
++          sys.platform
+       for dll in platform_to_lib.get(platform, []):
+           try:
+               libmagic = ctypes.CDLL(dll)



Home | Main Index | Thread Index | Old Index