Bug 1220626 - bash-completion: error: "bash: have: command not found"
Summary: bash-completion: error: "bash: have: command not found"
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Dr. Werner Fink
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-29 09:10 UTC by Petr Vorel
Modified: 2024-05-17 09:11 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Vorel 2024-02-29 09:10:13 UTC
This was problem in the past (#1060111) and now, after update to 2.12.0-1.1 (https://build.opensuse.org/request/show/1149849) it strikes again:

bash: have: command not found
bash: have: command not found
bash: have: command not found

$ rpm -qa |grep bash-completion
perf-bash-completion-6.7.6-83.14.x86_64
SwayNotificationCenter-bash-completion-0.10.0-1.1.noarch
bash-completion-2.12.0-1.1.noarch
playerctl-bash-completion-2.4.1-1.11.noarch
cpupower-bash-completion-6.7.6-6.9.noarch
ethtool-bash-completion-6.7-1.1.noarch
lightdm-bash-completion-1.32.0-2.5.noarch
tig-bash-completion-2.5.8-1.6.noarch
python-tqdm-bash-completion-4.66.1-3.4.noarch
firewalld-bash-completion-2.1.1-1.2.noarch
udisks2-bash-completion-2.10.0-2.2.noarch
augeas-bash-completion-1.14.1-1.2.x86_64
virt-v2v-bash-completion-2.4.0-3.1.noarch
docker-bash-completion-25.0.3_ce-2.1.noarch
alacritty-bash-completion-0.13.1-1.2.noarch
whois-bash-completion-5.5.20-1.2.noarch
subversion-bash-completion-1.14.3-1.4.noarch
kmod-bash-completion-31-2.2.noarch
android-tools-bash-completion-34.0.4-2.3.noarch
iproute2-bash-completion-6.7-1.2.x86_64
wl-clipboard-bash-completion-2.2.0-1.2.noarch
btrfsprogs-bash-completion-6.7.1-1.1.x86_64
mbimcli-bash-completion-1.28.4-2.2.noarch
pulseaudio-bash-completion-17.0-2.1.x86_64
yt-dlp-bash-completion-2023.12.30-1.4.noarch
nvme-cli-bash-completion-2.8-1.1.noarch
fwupd-bash-completion-1.9.13-1.1.noarch
ModemManager-bash-completion-1.20.6-2.2.noarch
mpv-bash-completion-0.37.0+git20231121.2a57a6ee-1.3.noarch

$ rpm -q bash
bash-5.2.26-10.3.x86_64
Comment 1 Dr. Werner Fink 2024-02-29 09:23:07 UTC
And WHICH completion is using the depricated shell function have() 

from old bash-completion:

# This function checks whether we have a given program on the system.
#
_have()
{
    # Completions for system administrator commands are installed as well in
    # case completion is attempted via `sudo command ...'.
    PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null
}

# Backwards compatibility for compat completions that use have().
# @deprecated should no longer be used; generally not needed with dynamically
#             loaded completions, and _have is suitable for runtime use.
have()
{
    unset -v have
    _have $1 && have=yes
}
Comment 2 Dr. Werner Fink 2024-02-29 09:24:59 UTC
s/depricated/deprecated/
Comment 3 Dr. Werner Fink 2024-02-29 09:26:49 UTC
Note that this is NOT a bug of bash-completion but of any package which uses have() instread of _comp_have_command()

# This function checks whether we have a given program on the system.
#
# @since 2.12
_comp_have_command()
{
    # Completions for system administrator commands are installed as well in
    # case completion is attempted via `sudo command ...'.
    PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type "$1" &>/dev/null
}
Comment 4 Petr Vorel 2024-02-29 09:38:31 UTC
/usr/share/bash-completion/completions/grub and /usr/share/bash-completion/completions/inkscape. But removing both of them does not help. Actually removing whole /usr/share/bash-completion/completions/ does not help. Maybe it's a problem in my setup.


$ grep -r ^have /usr/share/bash-completion/completions/
/usr/share/bash-completion/completions/grub:have ${__grub_set_default_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_reboot_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_editenv_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_mkconfig_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_bios_setup_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_sparc64_setup_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_install_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_mkfont_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_mkrescue_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_mkimage_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_mkpasswd_pbkdf2_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_probe_program} && \
/usr/share/bash-completion/completions/grub:have ${__grub_script_check_program} && \

$ grep -r ^_have /usr/share/bash-completion/completions/  
/usr/share/bash-completion/completions/inkscape:_have inkscape &&