bash completion not working: uses deprecated have()

Bug #1775043 reported by Paulo Marcel Coelho Aragão on 2018-06-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Jamie Strandboge
ufw (Ubuntu)
Status tracked in Cosmic
Jamie Strandboge
Jamie Strandboge

Bug Description

bash completion, defined in /usr/share/bash-completion/completions/ufw, doesn't work: the completion is not dynamically loaded, because it uses deprecated helper function have().

According to /usr/share/bash-completions/bash_completion, which defines the helper functions:

# 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.

and at the end of the file:

unset -f have
unset have

which means: function have() is not available for usage. The bash completion for ufw conditionally defines _ufw and the comspec:

have ufw &&

[ "$have" ] && complete -F _ufw ufw

These should be changed to:

_have ufw &&

_have ufw && complete -F _ufw ufw

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ufw 0.35-5
ProcVersionSignature: Ubuntu 4.15.0-22.24-generic 4.15.17
Uname: Linux 4.15.0-22-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Mon Jun 4 14:34:11 2018
InstallationDate: Installed on 2018-04-28 (37 days ago)
InstallationMedia: Xubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
PackageArchitecture: all
SourcePackage: ufw
UpgradeStatus: No upgrade log present (probably fresh install)

Jamie Strandboge (jdstrand) wrote :

Thank you for reporting this. I'll get it fixed in upstream ufw, Debian and Ubuntu 18.10. I'll then do an SRU for 18.04 LTS.

Changed in ufw:
assignee: nobody → Jamie Strandboge (jdstrand)
status: New → In Progress
Changed in ufw (Ubuntu Bionic):
status: New → Triaged
Changed in ufw (Ubuntu Cosmic):
status: New → Triaged
Changed in ufw (Ubuntu Bionic):
assignee: nobody → Jamie Strandboge (jdstrand)
Changed in ufw (Ubuntu Cosmic):
assignee: nobody → Jamie Strandboge (jdstrand)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers