diff --git a/backpoft-fix_regression_of_unwanted_trailing_colons.patch b/backpoft-fix_regression_of_unwanted_trailing_colons.patch new file mode 100644 index 0000000000000000000000000000000000000000..cbc91d68769085516cfdfb3583d02053427a0453 --- /dev/null +++ b/backpoft-fix_regression_of_unwanted_trailing_colons.patch @@ -0,0 +1,75 @@ +commit c2f83e0436208ef2bfa9c762bc28ff6374ba0c73 +Author: Koichi Murase +Date: Sun Mar 10 11:40:57 2024 +0900 + + fix(available_interfaces): fix regression of unwanted trailing colons + + This is a fix for regression introduced in commit b6035350 and + reported in GitHub #1129 [1]. The trailing colons of the generated + interface names were removed before, but not they are not removed. + + [1] https://github.com/scop/bash-completion/issues/1129 + + In addition, generated words can have the form `veth0@veth1`, where we + want only the first part `veth0` not containing any punctuation + characters. + + In this patch, we remove any [[:punct:]] and all the later characters + in the generated words. + +diff --git a/bash_completion b/bash_completion +index e245cc55..82d73b53 100644 +--- a/bash_completion ++++ b/bash_completion +@@ -1737,7 +1737,7 @@ _comp_compgen_available_interfaces() + fi + } 2>/dev/null | _comp_awk \ + '/^[^ \t]/ { if ($1 ~ /^[0-9]+:/) { print $2 } else { print $1 } }')" && +- _comp_compgen -U generated set "${generated[@]}" ++ _comp_compgen -U generated set "${generated[@]%%[[:punct:]]*}" + } + + # Echo number of CPUs, falling back to 1 on failure. +diff --git a/test/t/unit/Makefile.am b/test/t/unit/Makefile.am +index 54722dea..a9bead09 100644 +--- a/test/t/unit/Makefile.am ++++ b/test/t/unit/Makefile.am +@@ -2,6 +2,7 @@ EXTRA_DIST = \ + test_unit_abspath.py \ + test_unit_command_offset.py \ + test_unit_compgen.py \ ++ test_unit_compgen_available_interfaces.py \ + test_unit_compgen_commands.py \ + test_unit_count_args.py \ + test_unit_delimited.py \ +diff --git a/test/t/unit/test_unit_compgen_available_interfaces.py b/test/t/unit/test_unit_compgen_available_interfaces.py +new file mode 100644 +index 00000000..5e931006 +--- /dev/null ++++ b/test/t/unit/test_unit_compgen_available_interfaces.py +@@ -0,0 +1,25 @@ ++import pytest ++ ++from conftest import assert_bash_exec ++ ++ ++@pytest.mark.bashcomp(cmd=None) ++class TestUtilCompgenAvailableInterfaces: ++ @pytest.fixture ++ def functions(self, bash): ++ assert_bash_exec( ++ bash, ++ "_comp__test_dump() { ((${#arr[@]})) && printf '<%s>' \"${arr[@]}\"; echo; }", ++ ) ++ assert_bash_exec( ++ bash, ++ '_comp__test_compgen() { local -a arr=(00); _comp_compgen -v arr "$@"; _comp__test_dump; }', ++ ) ++ ++ def test_1_trailing_colons(self, bash, functions): ++ output = assert_bash_exec( ++ bash, ++ "_comp__test_compgen available_interfaces", ++ want_output=True, ++ ) ++ assert ":" not in output.strip() diff --git a/bash-completion-1.99-noblacklist.patch b/bash-completion-1.99-noblacklist.patch deleted file mode 100644 index f3cd42e160f06a0ddc3a1dd405c17b7adab16c85..0000000000000000000000000000000000000000 --- a/bash-completion-1.99-noblacklist.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up bash-completion-1.99/bash_completion~ bash-completion-1.99/bash_completion ---- bash-completion-1.99/bash_completion~ 2012-01-08 01:03:46.000000000 +0200 -+++ bash-completion-1.99/bash_completion 2012-01-08 13:50:33.412012530 +0200 -@@ -45,7 +45,7 @@ readonly BASH_COMPLETION_COMPAT_DIR - - # Blacklisted completions, causing problems with our code. - # --_blacklist_glob='@(acroread.sh)' -+_blacklist_glob='@()' - - # Turn on extended globbing and programmable completion - shopt -s extglob progcomp diff --git a/bash-completion-remove-python2.patch b/bash-completion-remove-python2.patch deleted file mode 100644 index 8501568092650c121b7201ce59568b4b72893962..0000000000000000000000000000000000000000 --- a/bash-completion-remove-python2.patch +++ /dev/null @@ -1,70 +0,0 @@ -From f13d6bc1c1675eddf148db3d0b942872aef398ec Mon Sep 17 00:00:00 2001 -From: renhongxun -Date: Mon, 20 Jun 2022 10:54:26 +0800 -Subject: [PATCH] bash-completion remove python2 - ---- - completions/Makefile.am | 4 +--- - completions/Makefile.in | 4 +--- - completions/python | 2 +- - 3 files changed, 3 insertions(+), 7 deletions(-) - -diff --git a/completions/Makefile.am b/completions/Makefile.am -index 723b42f..2d0c0f2 100644 ---- a/completions/Makefile.am -+++ b/completions/Makefile.am -@@ -666,8 +666,6 @@ CLEANFILES = \ - pypy3 \ - pytest-2 \ - pytest-3 \ -- python2 \ -- python2.7 \ - python3 \ - python3.3 \ - python3.4 \ -@@ -890,7 +888,7 @@ symlinks: $(DATA) - $(ss) pylint \ - pylint-2 pylint-3 - $(ss) python \ -- micropython pypy pypy3 python2 python2.7 python3 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 -+ micropython pypy pypy3 python3 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 - $(ss) pyvenv \ - pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8 - $(ss) qdbus \ -diff --git a/completions/Makefile.in b/completions/Makefile.in -index b8a439f..fe2ad1c 100644 ---- a/completions/Makefile.in -+++ b/completions/Makefile.in -@@ -890,8 +890,6 @@ CLEANFILES = \ - pypy3 \ - pytest-2 \ - pytest-3 \ -- python2 \ -- python2.7 \ - python3 \ - python3.3 \ - python3.4 \ -@@ -1332,7 +1330,7 @@ symlinks: $(DATA) - $(ss) pylint \ - pylint-2 pylint-3 - $(ss) python \ -- micropython pypy pypy3 python2 python2.7 python3 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 -+ micropython pypy pypy3 python3 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 - $(ss) pyvenv \ - pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8 - $(ss) qdbus \ -diff --git a/completions/python b/completions/python -index d50c18f..a8c17db 100644 ---- a/completions/python -+++ b/completions/python -@@ -62,6 +62,6 @@ _python() - COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) - fi - } && -- complete -F _python python python2 python2.7 python3 python3.{3..8} pypy pypy3 micropython -+ complete -F _python python python3 python3.{3..8} pypy pypy3 micropython - - # ex: filetype=sh --- -1.8.3.1 - diff --git a/bash-completion-remove-redundant-python2-links.patch b/bash-completion-remove-redundant-python2-links.patch deleted file mode 100644 index 557ba2ffad4af467bff7c8b493d39cfff0cfde7e..0000000000000000000000000000000000000000 --- a/bash-completion-remove-redundant-python2-links.patch +++ /dev/null @@ -1,79 +0,0 @@ -From e67d1ffcb510e314f3bd37446ab8e79078ea9a0b Mon Sep 17 00:00:00 2001 -From: liyuan -Date: Tue, 2 Aug 2022 15:15:09 +0800 -Subject: [PATCH] bash completion remove redundant python2 links - ---- - completions/Makefile.am | 7 ++----- - completions/Makefile.in | 7 ++----- - 2 files changed, 4 insertions(+), 10 deletions(-) - -diff --git a/completions/Makefile.am b/completions/Makefile.am -index 2d0c0f2..91a6a90 100644 ---- a/completions/Makefile.am -+++ b/completions/Makefile.am -@@ -657,14 +657,11 @@ CLEANFILES = \ - pvscan \ - pxz \ - py.test \ -- py.test-2 \ - py.test-3 \ - pydoc3 \ -- pylint-2 \ - pylint-3 \ - pypy \ - pypy3 \ -- pytest-2 \ - pytest-3 \ - python3 \ - python3.3 \ -@@ -882,11 +879,11 @@ symlinks: $(DATA) - filebucket puppetca puppetd puppetdoc puppetmasterd puppetqd \ - puppetrun ralsh - $(ss) pytest \ -- py.test py.test-2 py.test-3 pytest-2 pytest-3 -+ py.test py.test-3 pytest-3 - $(ss) pydoc \ - pydoc3 - $(ss) pylint \ -- pylint-2 pylint-3 -+ pylint-3 - $(ss) python \ - micropython pypy pypy3 python3 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 - $(ss) pyvenv \ -diff --git a/completions/Makefile.in b/completions/Makefile.in -index fe2ad1c..897faba 100644 ---- a/completions/Makefile.in -+++ b/completions/Makefile.in -@@ -881,14 +881,11 @@ CLEANFILES = \ - pvscan \ - pxz \ - py.test \ -- py.test-2 \ - py.test-3 \ - pydoc3 \ -- pylint-2 \ - pylint-3 \ - pypy \ - pypy3 \ -- pytest-2 \ - pytest-3 \ - python3 \ - python3.3 \ -@@ -1324,11 +1321,11 @@ symlinks: $(DATA) - filebucket puppetca puppetd puppetdoc puppetmasterd puppetqd \ - puppetrun ralsh - $(ss) pytest \ -- py.test py.test-2 py.test-3 pytest-2 pytest-3 -+ py.test py.test-3 pytest-3 - $(ss) pydoc \ - pydoc3 - $(ss) pylint \ -- pylint-2 pylint-3 -+ pylint-3 - $(ss) python \ - micropython pypy pypy3 python3 python3.3 python3.4 python3.5 python3.6 python3.7 python3.8 - $(ss) pyvenv \ --- -2.33.0 - diff --git a/bash-completion.spec b/bash-completion.spec index bc6b1d47f27b38fd053f4bc672f9222f30e5b45a..44136e60ebaa369a8e533fd95d04af400eb58c1f 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -3,7 +3,7 @@ Name: bash-completion Version: 2.12.0 -Release: 2 +Release: 3 Epoch: 1 Summary: Completion for bash command License: GPLv2+ @@ -13,6 +13,7 @@ Source0: https://github.com/scop/%{name}/releases/download/%{version}/%{na Patch0: bash-completion-2.12.0-remove-python2.patch Patch1: backport-fix-feh-fix-nounset-error.patch Patch2: backport-fix-_umount-feh-sbopkg-check-diretory-name-for-_comp.patch +Patch3: backpoft-fix_regression_of_unwanted_trailing_colons.patch BuildArch: noarch @@ -66,6 +67,9 @@ make -C completions check %doc CHANGELOG.md README.md doc/configuration.md CONTRIBUTING.md %changelog +* Thu Aug 14 2025 Yu Peng - 1:2.12.0-3 +- Fix regression of unwanted trailing colons + * Tue May 27 2025 Linux_zhang - 1:2.12.0-2 - check diretory name for _comp_compgen -C