diff --git a/lang/golang/golang/Makefile b/lang/golang/golang/Makefile index 350f972bf1..03d4e35f0b 100644 --- a/lang/golang/golang/Makefile +++ b/lang/golang/golang/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk GO_VERSION_MAJOR_MINOR:=1.21 -GO_VERSION_PATCH:=3 +GO_VERSION_PATCH:=4 PKG_NAME:=golang PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH)) @@ -21,7 +21,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \ PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz PKG_SOURCE_URL:=$(GO_SOURCE_URLS) -PKG_HASH:=186f2b6f8c8b704e696821b09ab2041a5c1ee13dcbc3156a13adcf75931ee488 +PKG_HASH:=47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787 PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=BSD-3-Clause diff --git a/lang/python/pipx/Makefile b/lang/python/pipx/Makefile new file mode 100644 index 0000000000..92835b76af --- /dev/null +++ b/lang/python/pipx/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pipx +PKG_VERSION:=1.2.1 +PKG_RELEASE:=1 + +PYPI_NAME:=pipx +PKG_HASH:=698777c05a97cca81df4dc6a71d9ca4ece2184c6f91dc7a0e4802ac51d86d32a + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/pipx + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Install/Run Python Applications in Isolated Environments + URL:=https://github.com/pypa/pipx + DEPENDS:= \ + +python3-light \ + +python3-logging \ + +python3-urllib \ + +python3-venv \ + +python3-argcomplete \ + +python3-packaging \ + +python3-userpath +endef + +define Package/pipx/description +pipx is a tool to help you install and run end-user applications written +in Python. It's roughly similar to macOS's brew, JavaScript's npx, and +Linux's apt. + +It's closely related to pip. In fact, it uses pip, but is focused on +installing and managing Python packages that can be run from the command +line directly as applications. +endef + +$(eval $(call Py3Package,pipx)) +$(eval $(call BuildPackage,pipx)) +$(eval $(call BuildPackage,pipx-src)) diff --git a/lang/python/pipx/test.sh b/lang/python/pipx/test.sh new file mode 100644 index 0000000000..a4f2348ae8 --- /dev/null +++ b/lang/python/pipx/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = pipx ] || exit 0 + +pipx --version | grep -Fx "$PKG_VERSION" diff --git a/lang/python/python-argcomplete/Makefile b/lang/python/python-argcomplete/Makefile new file mode 100644 index 0000000000..d977f01a22 --- /dev/null +++ b/lang/python/python-argcomplete/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-argcomplete +PKG_VERSION:=3.1.4 +PKG_RELEASE:=1 + +PYPI_NAME:=argcomplete +PKG_HASH:=72558ba729e4c468572609817226fb0a6e7e9a0a7d477b882be168c0b4a62b94 + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.rst +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-setuptools-scm/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-argcomplete + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Bash tab completion for argparse + URL:=https://github.com/kislyuk/argcomplete + DEPENDS:=+python3-light +endef + +define Package/python3-argcomplete/description +Argcomplete provides easy, extensible command line tab completion of +arguments for your Python application. +endef + +$(eval $(call Py3Package,python3-argcomplete)) +$(eval $(call BuildPackage,python3-argcomplete)) +$(eval $(call BuildPackage,python3-argcomplete-src)) diff --git a/lang/python/python-argcomplete/patches/001-unpin-setuptools.patch b/lang/python/python-argcomplete/patches/001-unpin-setuptools.patch new file mode 100644 index 0000000000..a85ce857a0 --- /dev/null +++ b/lang/python/python-argcomplete/patches/001-unpin-setuptools.patch @@ -0,0 +1,9 @@ +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,5 +1,5 @@ + [build-system] +-requires = ["setuptools>=67.7.2", "setuptools_scm[toml]>=6.2"] ++requires = ["setuptools", "setuptools_scm[toml]>=6.2"] + build-backend = "setuptools.build_meta" + + [project] diff --git a/lang/python/python-argcomplete/test.sh b/lang/python/python-argcomplete/test.sh new file mode 100644 index 0000000000..0ecba3e5be --- /dev/null +++ b/lang/python/python-argcomplete/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-argcomplete ] || exit 0 + +python3 -c 'import argcomplete' diff --git a/lang/python/python-hatch-vcs/Makefile b/lang/python/python-hatch-vcs/Makefile index 39f890985a..6726a77768 100644 --- a/lang/python/python-hatch-vcs/Makefile +++ b/lang/python/python-hatch-vcs/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-hatch-vcs -PKG_VERSION:=0.3.0 +PKG_VERSION:=0.4.0 PKG_RELEASE:=1 PYPI_NAME:=hatch-vcs PYPI_SOURCE_NAME:=hatch_vcs -PKG_HASH:=cec5107cfce482c67f8bc96f18bbc320c9aa0d068180e14ad317bbee5a153fee +PKG_HASH:=093810748fe01db0d451fabcf2c1ac2688caefd232d4ede967090b1c1b07d9f7 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE.txt diff --git a/lang/python/python-mako/Makefile b/lang/python/python-mako/Makefile index 50f8281514..5146515932 100644 --- a/lang/python/python-mako/Makefile +++ b/lang/python/python-mako/Makefile @@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-mako -PKG_VERSION:=1.2.4 +PKG_VERSION:=1.3.0 PKG_RELEASE:=1 PYPI_NAME:=Mako -PKG_HASH:=d60a3903dc3bb01a18ad6a89cdbe2e4eadc69c0bc8ef1e3773ba53d44c3f7a34 +PKG_HASH:=e3a9d388fd00e87043edbe8792f45880ac0114e9c4adc69f6e9bfb2c55e3b11b PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=MIT diff --git a/lang/python/python-poetry-core/Makefile b/lang/python/python-poetry-core/Makefile index 3bcb1d9ca6..ab0d12aa44 100644 --- a/lang/python/python-poetry-core/Makefile +++ b/lang/python/python-poetry-core/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-poetry-core -PKG_VERSION:=1.7.0 +PKG_VERSION:=1.8.1 PKG_RELEASE:=1 PYPI_NAME:=poetry-core PYPI_SOURCE_NAME:=poetry_core -PKG_HASH:=8f679b83bd9c820082637beca1204124d5d2a786e4818da47ec8acefd0353b74 +PKG_HASH:=67a76c671da2a70e55047cddda83566035b701f7e463b32a2abfeac6e2a16376 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/lang/python/python-trove-classifiers/Makefile b/lang/python/python-trove-classifiers/Makefile index 9691fd1590..67f3e8ff95 100644 --- a/lang/python/python-trove-classifiers/Makefile +++ b/lang/python/python-trove-classifiers/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-trove-classifiers -PKG_VERSION:=2023.10.18 +PKG_VERSION:=2023.11.9 PKG_RELEASE:=1 PYPI_NAME:=trove-classifiers -PKG_HASH:=2cdfcc7f31f7ffdd57666a9957296089ac72daad4d11ab5005060e5cd7e29939 +PKG_HASH:=0542bc03d151f8af84f0eb0e74aa931b374b6f9c8ed8fbf7ee41989fb9d40f1d PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/lang/python/python-twisted/Makefile b/lang/python/python-twisted/Makefile index 5befac2b3e..79f2f2a237 100644 --- a/lang/python/python-twisted/Makefile +++ b/lang/python/python-twisted/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-twisted -PKG_VERSION:=23.8.0 +PKG_VERSION:=23.10.0 PKG_RELEASE:=1 PYPI_NAME:=Twisted PYPI_SOURCE_NAME:=twisted -PKG_HASH:=3c73360add17336a622c0d811c2a2ce29866b6e59b1125fd6509b17252098a24 +PKG_HASH:=987847a0790a2c597197613686e2784fd54167df3a55d0fb17c8412305d76ce5 PKG_BUILD_DEPENDS:=libtirpc diff --git a/lang/python/python-twisted/patches/001-omit-tkconch.patch b/lang/python/python-twisted/patches/001-omit-tkconch.patch index bf8873f414..d9ad0d59e2 100644 --- a/lang/python/python-twisted/patches/001-omit-tkconch.patch +++ b/lang/python/python-twisted/patches/001-omit-tkconch.patch @@ -1,6 +1,6 @@ --- a/pyproject.toml +++ b/pyproject.toml -@@ -150,7 +150,6 @@ ckeygen = "twisted.conch.scripts.ckeygen +@@ -138,7 +138,6 @@ ckeygen = "twisted.conch.scripts.ckeygen conch = "twisted.conch.scripts.conch:run" mailmail = "twisted.mail.scripts.mailmail:run" pyhtmlizer = "twisted.scripts.htmlizer:run" diff --git a/lang/python/python-twisted/patches/002-omit-tests.patch b/lang/python/python-twisted/patches/002-omit-tests.patch index 841b5e09e7..ddf8f9e306 100644 --- a/lang/python/python-twisted/patches/002-omit-tests.patch +++ b/lang/python/python-twisted/patches/002-omit-tests.patch @@ -1,6 +1,6 @@ --- a/pyproject.toml +++ b/pyproject.toml -@@ -194,6 +194,7 @@ exclude = [ +@@ -182,6 +182,7 @@ exclude = [ "*.pxi", "*.pyx", "build.bat", diff --git a/lang/python/python-userpath/Makefile b/lang/python/python-userpath/Makefile new file mode 100644 index 0000000000..969a238b55 --- /dev/null +++ b/lang/python/python-userpath/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-userpath +PKG_VERSION:=1.9.1 +PKG_RELEASE:=1 + +PYPI_NAME:=userpath +PKG_HASH:=ce8176728d98c914b6401781bf3b23fccd968d1647539c8788c7010375e02796 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-userpath + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Cross-platform tool for modifying a user's PATH + URL:=https://github.com/ofek/userpath + DEPENDS:=+python3-light +python3-click +python3-psutil +endef + +define Package/python3-userpath/description +This is a tool for modifying a user's PATH. +endef + +$(eval $(call Py3Package,python3-userpath)) +$(eval $(call BuildPackage,python3-userpath)) +$(eval $(call BuildPackage,python3-userpath-src)) diff --git a/lang/python/python-userpath/patches/0001-Handle-OSErrors-when-running-show-path-commands.patch b/lang/python/python-userpath/patches/0001-Handle-OSErrors-when-running-show-path-commands.patch new file mode 100644 index 0000000000..3a412e62f6 --- /dev/null +++ b/lang/python/python-userpath/patches/0001-Handle-OSErrors-when-running-show-path-commands.patch @@ -0,0 +1,31 @@ +From 9175a0a97c7bc2eeb995e53d50a07be6a7e834f0 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 9 Nov 2023 14:20:58 +0800 +Subject: [PATCH] Handle OSErrors when running show path commands + +Bash may not always be installed, for example on OpenWrt, and attempting +to call the show path commands for Bash will cause a FileNotFoundError +to be raised. + +This wraps the subprocess call with a try statement and returns the +empty string in the case of an OSError. +--- + userpath/utils.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/userpath/utils.py ++++ b/userpath/utils.py +@@ -30,8 +30,11 @@ def ensure_parent_dir_exists(path): + + + def get_flat_output(command, sep=os.pathsep, **kwargs): +- process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) +- output = process.communicate()[0].decode(locale.getpreferredencoding(False)).strip() ++ try: ++ process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) ++ output = process.communicate()[0].decode(locale.getpreferredencoding(False)).strip() ++ except OSError: ++ return '' + + # We do this because the output may contain new lines. + lines = [line.strip() for line in output.splitlines()] diff --git a/lang/python/python-userpath/patches/0001-Use-Sh-as-base-class-for-Bash-and-Zsh.patch b/lang/python/python-userpath/patches/0001-Use-Sh-as-base-class-for-Bash-and-Zsh.patch new file mode 100644 index 0000000000..69dfde2dd8 --- /dev/null +++ b/lang/python/python-userpath/patches/0001-Use-Sh-as-base-class-for-Bash-and-Zsh.patch @@ -0,0 +1,89 @@ +From dffcc1c5823bcce10b420467db41e42ec41f4702 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 9 Nov 2023 17:48:50 +0800 +Subject: [PATCH 1/2] Use Sh as base class for Bash and Zsh + +--- + userpath/shells.py | 41 ++++++++++++++++++++++++++--------------- + 1 file changed, 26 insertions(+), 15 deletions(-) + +--- a/userpath/shells.py ++++ b/userpath/shells.py +@@ -12,24 +12,36 @@ class Shell(object): + + + class Sh(Shell): +- def config(self, location, front=True): ++ name = 'sh' ++ ++ def _config_contents(self, location, front=True): + head, tail = (location, '$PATH') if front else ('$PATH', location) + new_path = '{}{}{}'.format(head, pathsep, tail) ++ return 'export PATH="{}"'.format(new_path) ++ ++ def config(self, location, front=True): ++ contents = self._config_contents(location, front=front) ++ return {path.join(self.home, '.profile'): contents} + +- return {path.join(self.home, '.profile'): 'PATH="{}"'.format(new_path)} ++ @classmethod ++ def _interactive_show_path_command(cls): ++ return [cls.name, '-i', '-c', 'echo $PATH'] ++ ++ @classmethod ++ def _interactive_login_show_path_command(cls): ++ return [cls.name, '-i', '-l', '-c', 'echo $PATH'] + + @classmethod + def show_path_commands(cls): + # TODO: Find out what file influences non-login shells. The issue may simply be our Docker setup. +- return [['sh', '-i', '-l', '-c', 'echo $PATH']] ++ return [cls._interactive_login_show_path_command()] + + +-class Bash(Shell): +- def config(self, location, front=True): +- head, tail = (location, '$PATH') if front else ('$PATH', location) +- new_path = '{}{}{}'.format(head, pathsep, tail) +- contents = 'export PATH="{}"'.format(new_path) ++class Bash(Sh): ++ name = 'bash' + ++ def config(self, location, front=True): ++ contents = self._config_contents(location, front=front) + configs = {path.join(self.home, '.bashrc'): contents} + + # https://github.com/ofek/userpath/issues/3#issuecomment-492491977 +@@ -50,7 +62,7 @@ class Bash(Shell): + + @classmethod + def show_path_commands(cls): +- return [['bash', '-i', '-c', 'echo $PATH'], ['bash', '-i', '-l', '-c', 'echo $PATH']] ++ return [cls._interactive_show_path_command(), cls._interactive_login_show_path_command()] + + + class Fish(Shell): +@@ -88,18 +100,17 @@ class Xonsh(Shell): + return [['xonsh', '-i', '-c', command], ['xonsh', '-i', '--login', '-c', command]] + + +-class Zsh(Shell): +- def config(self, location, front=True): +- head, tail = (location, '$PATH') if front else ('$PATH', location) +- new_path = '{}{}{}'.format(head, pathsep, tail) +- contents = 'export PATH="{}"'.format(new_path) ++class Zsh(Sh): ++ name = 'zsh' + ++ def config(self, location, front=True): ++ contents = self._config_contents(location, front=front) + zdotdir = environ.get('ZDOTDIR', self.home) + return {path.join(zdotdir, '.zshrc'): contents, path.join(zdotdir, '.zprofile'): contents} + + @classmethod + def show_path_commands(cls): +- return [['zsh', '-i', '-c', 'echo $PATH'], ['zsh', '-i', '-l', '-c', 'echo $PATH']] ++ return [cls._interactive_show_path_command(), cls._interactive_login_show_path_command()] + + + SHELLS = { diff --git a/lang/python/python-userpath/patches/0002-Add-support-for-ash-Almquist-shell.patch b/lang/python/python-userpath/patches/0002-Add-support-for-ash-Almquist-shell.patch new file mode 100644 index 0000000000..2c1132eaa2 --- /dev/null +++ b/lang/python/python-userpath/patches/0002-Add-support-for-ash-Almquist-shell.patch @@ -0,0 +1,112 @@ +From 7823b9b39c486aedf830783329abdc3bd9664ba4 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 9 Nov 2023 17:51:21 +0800 +Subject: [PATCH 2/2] Add support for ash (Almquist shell) + +--- + tests/docker/debian | 2 +- + tests/test_ash.py | 65 +++++++++++++++++++++++++++++++++++++++++++++ + userpath/shells.py | 5 ++++ + 3 files changed, 71 insertions(+), 1 deletion(-) + create mode 100644 tests/test_ash.py + +--- a/tests/docker/debian ++++ b/tests/docker/debian +@@ -2,7 +2,7 @@ ARG PYTHON_VERSION + FROM python:${PYTHON_VERSION} + + RUN apt-get update \ +- && apt-get --no-install-recommends -y install fish zsh ++ && apt-get --no-install-recommends -y install ash fish zsh + + COPY requirements.txt / + RUN pip install -r requirements.txt +--- /dev/null ++++ b/tests/test_ash.py +@@ -0,0 +1,65 @@ ++import pytest ++import userpath ++ ++from .utils import SKIP_WINDOWS_CI, get_random_path ++ ++SHELL_NAME = 'ash' ++ ++pytestmark = [SKIP_WINDOWS_CI, pytest.mark.ash] ++ ++ ++@pytest.mark.usefixtures('shell_test') ++class TestDebian(object): ++ DOCKERFILE = 'debian' ++ ++ def test_prepend(self, request, shell_test): ++ if shell_test is None: ++ location = get_random_path() ++ assert not userpath.in_current_path(location) ++ assert userpath.prepend(location, check=True) ++ assert userpath.in_new_path(location) ++ assert userpath.need_shell_restart(location) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') ++ ++ def test_prepend_multiple(self, request, shell_test): ++ if shell_test is None: ++ locations = [get_random_path(), get_random_path()] ++ assert not userpath.in_current_path(locations) ++ assert userpath.prepend(locations, check=True) ++ assert userpath.in_new_path(locations) ++ assert userpath.need_shell_restart(locations) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') ++ ++ def test_append(self, request, shell_test): ++ if shell_test is None: ++ location = get_random_path() ++ assert not userpath.in_current_path(location) ++ assert userpath.append(location, check=True) ++ assert userpath.in_new_path(location) ++ assert userpath.need_shell_restart(location) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') ++ ++ def test_append_multiple(self, request, shell_test): ++ if shell_test is None: ++ locations = [get_random_path(), get_random_path()] ++ assert not userpath.in_current_path(locations) ++ assert userpath.append(locations, check=True) ++ assert userpath.in_new_path(locations) ++ assert userpath.need_shell_restart(locations) ++ else: ++ process = shell_test(request.node.name) ++ stdout, stderr = process.communicate() ++ ++ assert process.returncode == 0, (stdout + stderr).decode('utf-8') +--- a/userpath/shells.py ++++ b/userpath/shells.py +@@ -37,6 +37,10 @@ class Sh(Shell): + return [cls._interactive_login_show_path_command()] + + ++class Ash(Sh): ++ name = 'ash' ++ ++ + class Bash(Sh): + name = 'bash' + +@@ -114,6 +118,7 @@ class Zsh(Sh): + + + SHELLS = { ++ 'ash': Ash, + 'bash': Bash, + 'fish': Fish, + 'sh': Sh, diff --git a/lang/python/python-userpath/test.sh b/lang/python/python-userpath/test.sh new file mode 100644 index 0000000000..e87d325ba4 --- /dev/null +++ b/lang/python/python-userpath/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-userpath ] || exit 0 + +userpath --version | grep -Fx "userpath, version $PKG_VERSION" diff --git a/lang/python/python-wheel/Makefile b/lang/python/python-wheel/Makefile index 2b89d569e2..76a1b44bba 100644 --- a/lang/python/python-wheel/Makefile +++ b/lang/python/python-wheel/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-wheel -PKG_VERSION:=0.41.2 +PKG_VERSION:=0.41.3 PKG_RELEASE:=1 PYPI_NAME:=wheel -PKG_HASH:=0c5ac5ff2afb79ac23ab82bab027a0be7b5dbcf2e54dc50efe4bf507de1f7985 +PKG_HASH:=4d4987ce51a49370ea65c0bfd2234e8ce80a12780820d9dc462597a6e60d0841 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE.txt diff --git a/net/adblock-fast/Makefile b/net/adblock-fast/Makefile index 7b14836b27..35d206acb4 100644 --- a/net/adblock-fast/Makefile +++ b/net/adblock-fast/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock-fast PKG_VERSION:=1.0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=GPL-3.0-or-later diff --git a/net/adblock-fast/files/etc/init.d/adblock-fast b/net/adblock-fast/files/etc/init.d/adblock-fast index 423a14c32d..cb16cf5bbc 100755 --- a/net/adblock-fast/files/etc/init.d/adblock-fast +++ b/net/adblock-fast/files/etc/init.d/adblock-fast @@ -1,6 +1,6 @@ #!/bin/sh /etc/rc.common # Copyright 2023 MOSSDeF, Stan Grishin (stangri@melmac.ca) -# shellcheck disable=SC2015,SC2016,SC2018,SC2019,SC2034,SC3037,SC3043,SC3045,SC3057,SC3060 +# shellcheck disable=SC3043 # shellcheck disable=SC2034 START=94 @@ -81,6 +81,7 @@ blocked_url= # shellcheck disable=SC1091 . /usr/share/libubox/jshn.sh +append_newline() { is_newline_ending "$1" || echo '' >> "$1"; } check_ipset() { { command -v ipset && /usr/sbin/ipset help hash:net; } >/dev/null 2>&1; } check_nft() { command -v nft >/dev/null 2>&1; } check_dnsmasq() { command -v dnsmasq >/dev/null 2>&1; } @@ -104,6 +105,9 @@ dnsmasq_restart() { /etc/init.d/dnsmasq restart >/dev/null 2>&1; } is_enabled() { uci -q get "${1}.config.enabled"; } is_greater() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } is_greater_or_equal() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$2"; } +# shellcheck disable=SC3057 +is_https_url() { [ "${1:0:8}" = "https://" ]; } +is_newline_ending() { [ "$(tail -c1 "$1" | wc -l)" -ne '0' ]; } is_present() { command -v "$1" >/dev/null 2>&1; } is_running() { local i j @@ -117,6 +121,8 @@ is_running() { } ipset() { "$ipset" "$@" >/dev/null 2>&1; } get_version() { grep -m1 -A2 -w "^Package: $1$" /usr/lib/opkg/status | sed -n 's/Version: //p'; } +get_ram_free() { ubus call system info | jsonfilter -e '@.memory.free'; } +get_ram_total() { ubus call system info | jsonfilter -e '@.memory.total'; } led_on(){ if [ -n "${1}" ] && [ -e "${1}/trigger" ]; then echo 'default-on' > "${1}/trigger" 2>&1; fi; } led_off(){ if [ -n "${1}" ] && [ -e "${1}/trigger" ]; then echo 'none' > "${1}/trigger" 2>&1; fi; } logger() { /usr/bin/logger -t "$packageName" "$@"; } @@ -131,7 +137,9 @@ print_json_string() { json_init; json_add_string "$1" "$2"; json_dump; json_clea sanitize_dir() { [ -d "$(readlink -fn "$1")" ] && readlink -fn "$1"; } str_contains() { test "$1" != "$(str_replace "$1" "$2" '')"; } str_contains_word() { echo "$1" | grep -q -w "$2"; } +# shellcheck disable=SC2018,SC2019 str_to_lower() { echo "$1" | tr 'A-Z' 'a-z'; } +# shellcheck disable=SC2018,SC2019 str_to_upper() { echo "$1" | tr 'a-z' 'A-Z'; } str_replace() { printf "%b" "$1" | sed -e "s/$(printf "%b" "$2")/$(printf "%b" "$3")/g"; } ubus_get_data() { ubus call service list "{ 'name': '$packageName' }" | jsonfilter -e "@['${packageName}'].instances.main.data.${1}"; } @@ -230,6 +238,7 @@ get_local_filesize() { elif is_present wc; then size="$(wc -c < "$file")" fi +# shellcheck disable=SC3037 echo -en "$size" } @@ -239,6 +248,7 @@ get_url_filesize() { is_present 'curl' || return 0 size_command='curl --silent --insecure --fail --head --request GET' size="$($size_command "$url" | grep -Po '^[cC]ontent-[lL]ength: \K\w+')" +# shellcheck disable=SC3037 echo -en "$size" } @@ -262,6 +272,7 @@ output() { fi text="${text:-$*}"; [ -t 1 ] && printf "%b" "$text" +# shellcheck disable=SC3060 msg="${text//$serviceName /service }"; if [ "$(printf "%b" "$msg" | wc -l)" -gt 0 ]; then [ -s "$sharedMemoryOutput" ] && memmsg="$(cat "$sharedMemoryOutput")" @@ -900,7 +911,7 @@ process_file_url() { file) type='File'; D_TMP="$B_TMP" ;; esac - if [ "${1:0:5}" = "https" ] && [ -z "$isSSLSupported" ]; then + if is_https_url "$url" && [ -z "$isSSLSupported" ]; then output 1 "$_FAIL_" output 2 "[DL] $type $label $__FAIL__\\n" echo "errorNoSSLSupport|${1}" >> "$sharedMemoryError" @@ -915,6 +926,7 @@ process_file_url() { output 2 "[DL] $type $label $__FAIL__\\n" echo "errorDownloadingList|${url}" >> "$sharedMemoryError" else + append_newline "$R_TMP" [ -n "$cfg" ] && new_size="$(get_local_filesize "$R_TMP")" if [ -n "$new_size" ] && [ "$size" != "$new_size" ]; then uci set "${packageName}.${cfg}.size=$size" @@ -943,6 +955,7 @@ process_file_url() { output 2 "[DL] $type $label ($format) $__FAIL__\\n" echo "errorParsingList|${url}" >> "$sharedMemoryError" else + append_newline "$R_TMP" cat "${R_TMP}" >> "$D_TMP" output 1 "$_OK_" output 2 "[DL] $type $label ($format) $__OK__\\n" @@ -959,7 +972,7 @@ download_dnsmasq_file() { json set status 'statusDownloading' rm -f "$A_TMP" "$B_TMP" "$outputFile" "$outputCache" "$outputGzip" - if [ "$($awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo")" -lt 32 ]; then + if [ "$(get_ram_free)" -lt 32 ]; then output 3 'Low free memory, restarting resolver ' if resolver 'quiet_restart'; then output_okn @@ -1000,7 +1013,7 @@ download_lists() { [ -n "$size" ] && total_sizes=$((total_sizes+size)) } local i free_mem total_sizes - free_mem="$(ubus call system info | jsonfilter -e '@.memory.free')" + free_mem="$(get_ram_free)" if [ -z "$free_mem" ]; then json add warnning 'warningFreeRamCheckFail' output "${_WARNING_}: $(get_text 'warningFreeRamCheckFail')!\\n" @@ -1024,7 +1037,7 @@ download_lists() { json set status 'statusDownloading' rm -f "$A_TMP" "$B_TMP" "$outputFile" "$outputCache" "$outputGzip" - if [ "$($awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo")" -lt 32 ]; then + if [ "$(get_ram_total)" -lt 33554432 ]; then output 3 'Low free memory, restarting resolver ' if resolver 'quiet_restart'; then output_okn @@ -1040,7 +1053,7 @@ download_lists() { wait if [ -n "$(uci changes "$packageName")" ]; then output 2 "Saving updated file size(s) " - uci commit "$packageName" && output_okn || output_failn + if uci commit "$packageName"; then output_okn; else output_failn; fi fi output 1 '\n' @@ -1058,7 +1071,10 @@ download_lists() { canaryDomains="${canaryDomains:+$canaryDomains }${canaryDomainsMozilla}" fi - for hf in $blocked_domain $canaryDomains; do echo "$hf" | sed "$domainsFilter" >> $B_TMP; done + append_newline "$B_TMP" + for hf in $blocked_domain $canaryDomains; do + printf "%s\n" "$(echo "$hf" | sed "$domainsFilter")" >> "$B_TMP" + done allowed_domain="${allowed_domain} $(cat $A_TMP)" for hf in ${allowed_domain}; do hf="$(echo "$hf" | sed 's/\./\\./g')"; allow_filter="$allow_filter/(^|\.)${hf}$/d;"; done @@ -1094,6 +1110,7 @@ $(cat $A_TMP)" output 2 'Optimizing combined list ' json set message "$(get_text 'statusProcessing'): optimizing combined list" # sed -E 'G;:t;s/(.*)(\.)(.*)(\n)(.*)/\1\4\5\2\3/;tt;s/(.*)\n(\.)(.*)/\3\2\1/' is actually slower than command below +# shellcheck disable=SC2016 if $awk -F "." '{for(f=NF;f>1;f--)printf "%s.",$f;print $1}' "$A_TMP" > "$B_TMP"; then if sort "$B_TMP" > "$A_TMP"; then if $awk '{if(NR=1){tld=$NF};while(getline){if($NF!~tld"\\."){print tld;tld=$NF}}print tld}' "$A_TMP" > "$B_TMP"; then @@ -1372,6 +1389,7 @@ adb_config_update() { R_TMP="$(mktemp -u -q -t ${packageName}_tmp.XXXXXXXX)" done if ! $dl_command "$config_update_url" "$dl_flag" "$R_TMP" 2>/dev/null || [ ! -s "$R_TMP" ]; then + append_newline "$R_TMP" output 1 "$_FAIL_\\n" output 2 "[DL] Config Update: $label $__FAIL__\\n" json add error 'errorDownloadingConfigUpdate' @@ -1544,6 +1562,7 @@ adb_start() { fi json_add_array firewall if [ "$force_dns" -ne 0 ]; then +# shellcheck disable=SC3060 for c in ${force_dns_port/,/ }; do if netstat -tuln | grep LISTEN | grep ":${c}" >/dev/null 2>&1; then json_add_object "" diff --git a/net/crowdsec/Makefile b/net/crowdsec/Makefile index 554669592b..48a0ac9e9b 100644 --- a/net/crowdsec/Makefile +++ b/net/crowdsec/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=crowdsec -PKG_VERSION:=1.5.4 +PKG_VERSION:=1.5.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/crowdsecurity/crowdsec/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=afa4021f77e9cb87d7fd11cd86146770836dc15cad1ae8a4edce1314b14be98a +PKG_HASH:=ec7b2815405be4c3a1c9c3dcb1110030c29b7408dbf2a82d25537843c8831329 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/net/freeradius3/Makefile b/net/freeradius3/Makefile index 4a97b84145..6939f85f42 100644 --- a/net/freeradius3/Makefile +++ b/net/freeradius3/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=freeradius3 PKG_VERSION:=3.0.26 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://github.com/FreeRADIUS/freeradius-server/releases/download/release_$(subst .,_,$(PKG_VERSION))/ @@ -63,7 +63,7 @@ endef define Package/freeradius3-common $(call Package/freeradius3/Default) TITLE:=common files - DEPENDS:=+USE_GLIBC:libpthread +USE_GLIBC:libbsd +FREERADIUS3_OPENSSL:libopenssl +libcap +libpcap +libncurses +libpcre2 +libreadline +libtalloc +libatomic + DEPENDS:=+USE_GLIBC:libpthread +USE_GLIBC:libbsd +FREERADIUS3_OPENSSL:libopenssl +libcap +libpcap +libncurses +libreadline +libtalloc +libatomic endef define Package/freeradius3-default @@ -499,6 +499,7 @@ CONFIGURE_ARGS+= \ --with-radacctdir=/var/db/radacct \ --with-logdir=/var/log \ --without-edir \ + --without-pcre \ --without-snmp \ --without-rlm_cache \ --without-rlm_cache_memcached \ diff --git a/net/gensio/Makefile b/net/gensio/Makefile index 6fca78e9c9..b53d6821d7 100644 --- a/net/gensio/Makefile +++ b/net/gensio/Makefile @@ -47,14 +47,17 @@ CONFIGURE_ARGS += \ --$(if $(CONFIG_GENSIO_GLIB),with,without)-glib \ --$(if $(CONFIG_GENSIO_TCL),with,without)-tcl \ --without-afskmdm \ - --without-ax25 \ --without-alsa \ + --without-ax25 \ + --without-cm108gpio \ + --without-dnssd \ --without-go \ --without-ipmisol \ --without-kiss \ --without-openipmi \ --without-portaudio \ --without-sound \ + --without-udev \ --with-cplusplus \ --with-flock-locking \ --with-uucp-locking \ diff --git a/net/unbound/Makefile b/net/unbound/Makefile index d0cb41fac5..a2bf99535c 100644 --- a/net/unbound/Makefile +++ b/net/unbound/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unbound -PKG_VERSION:=1.18.0 +PKG_VERSION:=1.19.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound -PKG_HASH:=3da95490a85cff6420f26fae0b84a49f5112df1bf1b7fc34f8724f02082cb712 +PKG_HASH:=a97532468854c61c2de48ca4170de854fd3bc95c8043bb0cfb0fe26605966624 PKG_MAINTAINER:=Eric Luehrsen PKG_LICENSE:=BSD-3-Clause diff --git a/net/unbound/files/dnsmasq.sh b/net/unbound/files/dnsmasq.sh index eae8dae988..b507535f30 100644 --- a/net/unbound/files/dnsmasq.sh +++ b/net/unbound/files/dnsmasq.sh @@ -69,7 +69,7 @@ create_local_zone() { ############################################################################## -create_host_record() { +create_host_record_from_domain() { local cfg="$1" local ip name debug_ip @@ -102,6 +102,35 @@ create_host_record() { ############################################################################## +create_host_record_from_host() { + local cfg="$1" + local dns ip name + + # basefiles dhcp "host" clause which means host A and PTR records + config_get dns "$cfg" dns + config_get ip "$cfg" ip + config_get name "$cfg" name + + + if [ -n "$name" ] && [ -n "$ip" ] && [ $dns -eq 1 ] ; then + case $name in + *.*) + # domain present, do nothing + ;; + *) + name="$name.$UB_TXT_DOMAIN" + ;; + esac + + + create_local_zone "$name" + DM_LIST_LOCAL_DATA="$DM_LIST_LOCAL_DATA $name.@@300@@IN@@A@@$ip" + DM_LIST_LOCAL_PTR="$DM_LIST_LOCAL_PTR $ip@@300@@$name" + fi +} + +############################################################################## + create_mx_record() { local cfg="$1" local domain relay pref record @@ -215,7 +244,8 @@ dnsmasq_inactive() { # Parasite from the uci.dhcp.domain clauses DM_LIST_KNOWN_ZONES="$DM_LIST_KNOWN_ZONES $UB_TXT_DOMAIN" config_load dhcp - config_foreach create_host_record domain + config_foreach create_host_record_from_domain domain + config_foreach create_host_record_from_host host if [ $UB_D_EXTRA_DNS -gt 1 ] ; then diff --git a/net/unbound/patches/010-configure-uname.patch b/net/unbound/patches/010-configure-uname.patch index f53962fcd4..098f2785c4 100644 --- a/net/unbound/patches/010-configure-uname.patch +++ b/net/unbound/patches/010-configure-uname.patch @@ -3,7 +3,7 @@ Fix cross compile errors by inserting an environment variable for the target. Use "uname" on host only if "UNAME" variable is empty. --- a/configure.ac +++ b/configure.ac -@@ -840,7 +840,7 @@ if test x_$ub_test_python != x_no; then +@@ -842,7 +842,7 @@ if test x_$ub_test_python != x_no; then fi fi diff --git a/utils/dysk/Makefile b/utils/dysk/Makefile new file mode 100644 index 0000000000..cc559b0830 --- /dev/null +++ b/utils/dysk/Makefile @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2023 Facundo Acevedo + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dysk +PKG_VERSION:=2.8.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/Canop/dysk/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=3e0f3a470539721748d7bc1acc867bdddcb824695b2f766e3a1f230ebac28c2c + +PKG_MAINTAINER:=Facundo Acevedo +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENCE + +PKG_BUILD_DEPENDS:=rust/host +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include ../../lang/rust/rust-package.mk + +define Package/dysk + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Utility for efficient file and directory management + DEPENDS:=$(RUST_ARCH_DEPENDS) + URL:=https://dystroy.org/dysk +endef + +define Package/dysk/description + Dysk is a command-line tool designed for efficient file and + directory management in Unix-like environments. It offers a + streamlined approach to organizing and manipulating files, + potentially simplifying various file-related tasks. +endef + +$(eval $(call RustBinPackage,dysk)) +$(eval $(call BuildPackage,dysk)) diff --git a/utils/irqbalance/Makefile b/utils/irqbalance/Makefile index 6717c352e5..23d4b3899d 100644 --- a/utils/irqbalance/Makefile +++ b/utils/irqbalance/Makefile @@ -5,13 +5,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=irqbalance -PKG_VERSION:=1.9.2 -PKG_RELEASE:=3 +PKG_VERSION:=1.9.3 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/Irqbalance/irqbalance.git PKG_SOURCE_VERSION:=v$(PKG_VERSION) -PKG_MIRROR_HASH:=e2c81725e7b6d711a47d68755a222236d7081726d567aca1c1295e6fe1caa865 +PKG_MIRROR_HASH:=ff2936e9b7486e802206cbf9e16aa6cb7e1501bdf502441d31f409d104e757b8 PKG_MAINTAINER:=Hannu Nyman PKG_LICENSE:=GPL-2.0-or-later diff --git a/utils/irqbalance/patches/001-upstream-fix-aarch64-irq-parsing.patch b/utils/irqbalance/patches/001-upstream-fix-aarch64-irq-parsing.patch deleted file mode 100644 index 33213f0673..0000000000 --- a/utils/irqbalance/patches/001-upstream-fix-aarch64-irq-parsing.patch +++ /dev/null @@ -1,68 +0,0 @@ -From bbcd9a42c3cec0935b960b7f2046f1fdfab4f7ef Mon Sep 17 00:00:00 2001 -From: Vignesh Raghavendra -Date: Wed, 7 Dec 2022 19:46:19 +0530 -Subject: [PATCH] procinterrupts: Fix IRQ name parsing on certain arm64 SoC - -On arm64 SoCs like TI's K3 SoC and few other SoCs, IRQ names don't get -parsed correct due to which they end up being classified into wrong -class. Fix this by considering last token to contain IRQ name always. - -Eg.: /proc/interrupt - -cat /proc/interrupts - CPU0 CPU1 CPU2 CPU3 - 11: 7155 8882 7235 7791 GICv3 30 Level arch_timer - 14: 0 0 0 0 GICv3 23 Level arm-pmu - 15: 0 0 0 0 GICv3 208 Level 4b00000.spi - 16: 0 0 0 0 GICv3 209 Level 4b10000.spi -116: 0 0 0 0 MSI-INTA 1716234 Level 485c0100.dma-controller chan6 -134: 166 0 0 0 MSI-INTA 1970707 Level 8000000.ethernet-tx0 -224: 149 0 0 0 MSI-INTA 1971731 Level 8000000.ethernet - -W/o patch irqbalance -d -IRQ (11) guessed as class 0 -IRQ (14) guessed as class 0 -IRQ (15) guessed as class 0 -IRQ (16) guessed as class 0 -IRQ 485c0100.dma-controller chan6(116) guessed as class 0 -IRQ (134) guessed as class 0 -IRQ (224) guessed as class 0 - -W/ this patch -IRQ arch_timer(11) guessed as class 0 -IRQ arm-pmu(14) guessed as class 0 -IRQ 4b00000.spi(15) guessed as class 0 -IRQ 4b10000.spi(16) guessed as class 0 -IRQ 485c0100.dma-controller chan6(116) guessed as class 0 -IRQ 8000000.ethernet-tx0(134) guessed as class 5 -IRQ 8000000.ethernet(224) guessed as class 5 -IRQ 8000000.ethernet(257) guessed as class 5 -IRQ -davinci_gpio wl18xx(362) guessed as class - -Signed-off-by: Vignesh Raghavendra ---- - procinterrupts.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - ---- a/procinterrupts.c -+++ b/procinterrupts.c -@@ -178,12 +178,14 @@ void init_irq_class_and_type(char *saved - } - - #ifdef AARCH64 -- if (savedptr && strlen(savedptr) > 0) { -+ if (savedptr && strlen(savedptr) > 0) - snprintf(irq_fullname, PATH_MAX, "%s %s", last_token, savedptr); -- tmp = strchr(irq_fullname, '\n'); -- if (tmp) -- *tmp = 0; -- } -+ else -+ snprintf(irq_fullname, PATH_MAX, "%s", last_token); -+ -+ tmp = strchr(irq_fullname, '\n'); -+ if (tmp) -+ *tmp = 0; - #else - snprintf(irq_fullname, PATH_MAX, "%s", last_token); - #endif