From c3061885041688f8375a6e4a2effa25ed3ad8e3c Mon Sep 17 00:00:00 2001 From: hugel <2712504175@qq.com> Date: Fri, 29 Aug 2025 10:49:26 +0800 Subject: [PATCH] strip only trailing colon from entries (cherry picked from commit a4e7a17e8dd18ed377ec746cf623785dcdb1e07e) --- ...terfaces-strip-only-trailing-colon-f.patch | 40 +++++++++++++++++++ bash-completion.spec | 6 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 backport-fix-available_interfaces-strip-only-trailing-colon-f.patch diff --git a/backport-fix-available_interfaces-strip-only-trailing-colon-f.patch b/backport-fix-available_interfaces-strip-only-trailing-colon-f.patch new file mode 100644 index 0000000..5e8e2e7 --- /dev/null +++ b/backport-fix-available_interfaces-strip-only-trailing-colon-f.patch @@ -0,0 +1,40 @@ +From a452aee8fb58720ecfadbdaad95277ac9d9072ac Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Skytt=C3=A4?= +Date: Thu, 2 May 2024 21:22:09 +0300 +Subject: [PATCH] fix(available_interfaces): strip only trailing colon from + entries + +Leave other punctuation alone, at least for now. + +Closes https://github.com/scop/bash-completion/issues/1133 +--- + bash_completion | 2 +- + test/t/unit/test_unit_compgen_available_interfaces.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/bash_completion b/bash_completion +index 59c273ca..50446d7d 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[@]%%[[:punct:]]*}" ++ _comp_compgen -U generated set "${generated[@]%:}" + } + + # Echo number of CPUs, falling back to 1 on failure. +diff --git a/test/t/unit/test_unit_compgen_available_interfaces.py b/test/t/unit/test_unit_compgen_available_interfaces.py +index 5e931006..f3ebac01 100644 +--- a/test/t/unit/test_unit_compgen_available_interfaces.py ++++ b/test/t/unit/test_unit_compgen_available_interfaces.py +@@ -22,4 +22,4 @@ class TestUtilCompgenAvailableInterfaces: + "_comp__test_compgen available_interfaces", + want_output=True, + ) +- assert ":" not in output.strip() ++ assert ":>" not in output.strip() +-- +2.43.0 + diff --git a/bash-completion.spec b/bash-completion.spec index 44136e6..91ed88a 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -3,7 +3,7 @@ Name: bash-completion Version: 2.12.0 -Release: 3 +Release: 4 Epoch: 1 Summary: Completion for bash command License: GPLv2+ @@ -14,6 +14,7 @@ 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 +Patch4: backport-fix-available_interfaces-strip-only-trailing-colon-f.patch BuildArch: noarch @@ -67,6 +68,9 @@ make -C completions check %doc CHANGELOG.md README.md doc/configuration.md CONTRIBUTING.md %changelog +* Fri Aug 29 2025 hugel - 1:2.12.0-4 +- strip only trailing colon from entries + * Thu Aug 14 2025 Yu Peng - 1:2.12.0-3 - Fix regression of unwanted trailing colons -- Gitee