diff options
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | 0001-fix-Replace-use-of-imp-with-importlib.patch | 95 | ||||
-rw-r--r-- | PKGBUILD | 16 |
3 files changed, 109 insertions, 7 deletions
@@ -1,12 +1,13 @@ pkgbase = dupeguru pkgdesc = Find duplicate files with various contents, using perceptual diff for pictures pkgver = 4.3.1 - pkgrel = 1 + pkgrel = 2 url = https://dupeguru.voltaicideas.net/ arch = any license = GPL3 makedepends = python-distro makedepends = python-sphinx + makedepends = python-setuptools depends = python depends = python-pip depends = python-pyqt5 @@ -22,6 +23,8 @@ pkgbase = dupeguru conflicts = dupeguru-pe conflicts = dupeguru-me source = https://github.com/arsenetar/dupeguru/archive/refs/tags/4.3.1.tar.gz + source = 0001-fix-Replace-use-of-imp-with-importlib.patch md5sums = 996f2a9bab1541c188f823e9647f341c + md5sums = d6874bc038efd92420517407665c7f69 pkgname = dupeguru diff --git a/0001-fix-Replace-use-of-imp-with-importlib.patch b/0001-fix-Replace-use-of-imp-with-importlib.patch new file mode 100644 index 000000000000..ff3c6add3333 --- /dev/null +++ b/0001-fix-Replace-use-of-imp-with-importlib.patch @@ -0,0 +1,95 @@ +From 13dd00c79865d8a0c23ddade9acd5793e167cdd9 Mon Sep 17 00:00:00 2001 +From: Andrew Senetar <arsenetar@gmail.com> +Date: Mon, 19 Feb 2024 09:39:12 -0800 +Subject: [PATCH] fix: Replace use of `imp` with `importlib` + +Original PR and information found at #1187 +--- + hscommon/pygettext.py | 50 +++++++------------------------------------ + 1 file changed, 8 insertions(+), 42 deletions(-) + +diff --git a/hscommon/pygettext.py b/hscommon/pygettext.py +index 026219bf..85aaf6d9 100644 +--- a/hscommon/pygettext.py ++++ b/hscommon/pygettext.py +@@ -15,7 +15,8 @@ + # + + import os +-import imp ++import importlib.machinery ++import importlib.util + import sys + import glob + import token +@@ -110,7 +111,7 @@ def _visit_pyfiles(list, dirname, names): + # get extension for python source files + if "_py_ext" not in globals(): + global _py_ext +- _py_ext = [triple[0] for triple in imp.get_suffixes() if triple[2] == imp.PY_SOURCE][0] ++ _py_ext = importlib.machinery.SOURCE_SUFFIXES[0] + + # don't recurse into CVS directories + if "CVS" in names: +@@ -120,45 +121,6 @@ def _visit_pyfiles(list, dirname, names): + list.extend([os.path.join(dirname, file) for file in names if os.path.splitext(file)[1] == _py_ext]) + + +-def _get_modpkg_path(dotted_name, pathlist=None): +- """Get the filesystem path for a module or a package. +- +- Return the file system path to a file for a module, and to a directory for +- a package. Return None if the name is not found, or is a builtin or +- extension module. +- """ +- # split off top-most name +- parts = dotted_name.split(".", 1) +- +- if len(parts) > 1: +- # we have a dotted path, import top-level package +- try: +- file, pathname, description = imp.find_module(parts[0], pathlist) +- if file: +- file.close() +- except ImportError: +- return None +- +- # check if it's indeed a package +- if description[2] == imp.PKG_DIRECTORY: +- # recursively handle the remaining name parts +- pathname = _get_modpkg_path(parts[1], [pathname]) +- else: +- pathname = None +- else: +- # plain name +- try: +- file, pathname, description = imp.find_module(dotted_name, pathlist) +- if file: +- file.close() +- if description[2] not in [imp.PY_SOURCE, imp.PKG_DIRECTORY]: +- pathname = None +- except ImportError: +- pathname = None +- +- return pathname +- +- + def getFilesForName(name): + """Get a list of module files for a filename, a module or package name, + or a directory. +@@ -173,7 +135,11 @@ def getFilesForName(name): + return file_list + + # try to find module or package +- name = _get_modpkg_path(name) ++ try: ++ spec = importlib.util.find_spec(name) ++ name = spec.origin ++ except ImportError: ++ name = None + if not name: + return [] + +-- +2.43.0 + @@ -3,7 +3,7 @@ # Contributor: Virgil Dupras <hsoft@hardcoded.net> pkgname=dupeguru pkgver=4.3.1 -pkgrel=1 +pkgrel=2 pkgdesc="Find duplicate files with various contents, using perceptual diff for pictures" arch=('any') url="https://dupeguru.voltaicideas.net/" @@ -11,15 +11,19 @@ license=('GPL3') depends=('python' 'python-pip' 'python-pyqt5' 'python-polib' 'python-semantic-version' 'python-xxhash' 'python-mutagen' 'python-send2trash' 'libxkbcommon-x11') -makedepends=('python-distro' 'python-sphinx') -source=( https://github.com/arsenetar/${pkgname}/archive/refs/tags/${pkgver}.tar.gz ) -md5sums=('996f2a9bab1541c188f823e9647f341c') -provides=("dupeguru") -conflicts=("dupeguru-git" "dupeguru-se" "dupeguru-pe" "dupeguru-me") +makedepends=('python-distro' 'python-sphinx' 'python-setuptools') +source=("https://github.com/arsenetar/${pkgname}/archive/refs/tags/${pkgver}.tar.gz" + '0001-fix-Replace-use-of-imp-with-importlib.patch') +md5sums=('996f2a9bab1541c188f823e9647f341c' + 'd6874bc038efd92420517407665c7f69') +provides=('dupeguru') +conflicts=('dupeguru-git' 'dupeguru-se' 'dupeguru-pe' 'dupeguru-me') prepare() { cd "${srcdir}/${pkgname}-${pkgver}" sed -i -E 's/polib.*/polib>=1.1.0/g' requirements.txt + sed -i -E '125s/.*/ packages = ["hscommon", "core", "qt"]/' package.py + patch -p1 < "${srcdir}"/0001-fix-Replace-use-of-imp-with-importlib.patch } build() { |