Bash completion for Inkscape does not work

Bug #1792835 reported by Håkon A. Hjortland
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt-xapian-index (Ubuntu)
New
Undecided
Unassigned
cowdancer (Ubuntu)
Fix Released
Undecided
Mattia Rizzolo
dpatch (Ubuntu)
New
Undecided
Unassigned
inkscape (Ubuntu)
Fix Released
Undecided
Mattia Rizzolo
jackd2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Bash completion for Inkscape does not work in Ubuntu 18.04. It will for example suggest non-svg files.

The reason seems to be that /usr/share/bash-completion/completions/inkscape uses the have() function, which is temporarily defined in /usr/share/bash-completion/bash_completion, but then unset at the end of that file.

Workaround: Copy /usr/share/bash-completion/completions/inkscape to ~/.local/share/bash-completion/completions/inkscape and remove the uses of "have".

The bash completion for some other commands seem to use have() too, e.g. jackd, ufw, cowbuilder, dpatch_edit_patch, and axi-cache, so bash completion for these commands will presumably not work either.

From /usr/share/bash-completion/bash_completion:
-----------------------------------------------------------------------------
# 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
}
[...]
unset -f have
unset have
-----------------------------------------------------------------------------

From /usr/share/bash-completion/completions/inkscape:
-----------------------------------------------------------------------------
[...]
have inkscape &&
_inkscape()
{
  [...]
}
[ "${have:-}" ] && complete -F _inkscape $filenames inkscape
-----------------------------------------------------------------------------

System information:

$ lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04

$ apt-cache policy inkscape
inkscape:
  Installed: 0.92.3-1
  Candidate: 0.92.3-1
  Version table:
 *** 0.92.3-1 500
        500 http://no.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Mattia Rizzolo (mapreri) wrote :
Changed in inkscape (Ubuntu):
status: New → Fix Committed
Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :

jackd, ufw, cowbuilder, dpatch_edit_patch, and axi-cache should maybe also be fixed.

Mattia Rizzolo (mapreri)
Changed in inkscape (Ubuntu):
assignee: nobody → Mattia Rizzolo (mapreri)
Changed in cowdancer (Ubuntu):
assignee: nobody → Mattia Rizzolo (mapreri)
Revision history for this message
Mattia Rizzolo (mapreri) wrote :
Changed in cowdancer (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package inkscape - 0.92.3-4

---------------
inkscape (0.92.3-4) unstable; urgency=medium

  [ Mattia Rizzolo ]
  * d/bash-completion: fix completion to use the runtime-evaluating _have()
    instead of the static check have(). LP: #1792835
  * Mark inkscape-tutorials as Multi-Arch:foreign (from the m-a hinter).
  * Bump Standards-Version to 4.2.1, no changes needed.
  * Add patch from upstream to make the command-line PDF output reproducible.
    Thanks to Chris Lamb <email address hidden> for the patch! Closes: #893314

  [ Andrej Shadura ]
  * Add patch from upstream to fix crash when resizing elements with snapping
    enabled. Closes: #910379; LP: #1796046

 -- Mattia Rizzolo <email address hidden> Mon, 08 Oct 2018 11:27:04 +0200

Changed in inkscape (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

The ufw bug is being tracking in bug 1775043. Removing that task.

no longer affects: ufw (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cowdancer - 0.88

---------------
cowdancer (0.88) unstable; urgency=medium

  [ Mattia Rizzolo ]
  * Fix bash completion to work with a dynamic _have() instead of the static
    have(). LP: #1792835
  * Bump debhelper compat level to 12, using the new debhelper-compat.
    + Move from the deprecated dh_install --fail-missing to dh_missing.
  * Bump Standards-Version to 4.3.0, no changes needed.

  [ James Clarke ]
  * Fix FTBFS with glibc 2.28. Closes: #916062

 -- Mattia Rizzolo <email address hidden> Mon, 07 Jan 2019 14:43:20 +0100

Changed in cowdancer (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.