diff --git a/misc/thefuck/Makefile b/misc/thefuck/Makefile index b5bf1f2b6aca..58d78e517b84 100644 --- a/misc/thefuck/Makefile +++ b/misc/thefuck/Makefile @@ -1,24 +1,24 @@ PORTNAME= thefuck DISTVERSION= 3.32 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= misc python MASTER_SITES= PYPI MAINTAINER= ports@FreeBSD.org COMMENT= App that corrects your previous console command WWW= https://github.com/nvbn/thefuck LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.md RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}colorama>0:devel/py-colorama@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}decorator>0:devel/py-decorator@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pyte>0:devel/py-pyte@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} USES= python USE_PYTHON= autoplist distutils noflavors NO_ARCH= yes .include diff --git a/misc/thefuck/files/patch-thefuck_conf.py b/misc/thefuck/files/patch-thefuck_conf.py new file mode 100644 index 000000000000..e7509ec6b9dc --- /dev/null +++ b/misc/thefuck/files/patch-thefuck_conf.py @@ -0,0 +1,24 @@ +--- thefuck/conf.py.orig 2021-12-19 20:26:39 UTC ++++ thefuck/conf.py +@@ -1,10 +1,20 @@ +-from imp import load_source + import os + import sys + from warnings import warn + from six import text_type + from . import const + from .system import Path ++ ++try: ++ import importlib.util ++ ++ def load_source(name, pathname, _file=None): ++ module_spec = importlib.util.spec_from_file_location(name, pathname) ++ module = importlib.util.module_from_spec(module_spec) ++ module_spec.loader.exec_module(module) ++ return module ++except ImportError: ++ from imp import load_source + + + class Settings(dict): diff --git a/misc/thefuck/files/patch-thefuck_types.py b/misc/thefuck/files/patch-thefuck_types.py new file mode 100644 index 000000000000..8bfc750545ed --- /dev/null +++ b/misc/thefuck/files/patch-thefuck_types.py @@ -0,0 +1,13 @@ +--- thefuck/types.py.orig 2021-12-19 20:26:39 UTC ++++ thefuck/types.py +@@ -1,9 +1,8 @@ +-from imp import load_source + import os + import sys + from . import logs + from .shells import shell +-from .conf import settings ++from .conf import settings, load_source + from .const import DEFAULT_PRIORITY, ALL_ENABLED + from .exceptions import EmptyCommand + from .utils import get_alias, format_raw_script