bash-completion.pc doesn't allow to redefine prefix variable

Bug #1856840 reported by Enrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
New
Undecided
Unassigned

Bug Description

On Ubuntu 19.10 the file /usr/share/pkgconfig/bash-completion.pc has hard-coded values for completionsdir and helpersdir:

# cat /usr/share/pkgconfig/bash-completion.pc
prefix=/usr
compatdir=/etc/bash_completion.d
completionsdir=/usr/share/bash-completion/completions
helpersdir=/usr/share/bash-completion/helpers

 whereas in Ubuntu 19.04 it looks like this:

# cat /usr/share/pkgconfig/bash-completion.pc
prefix=/usr
compatdir=/etc/bash_completion.d
completionsdir=${prefix}/share/bash-completion/completions
helpersdir=${prefix}/share/bash-completion/helpers

 the problem with the first one is that one cannot override the prefix variable:

Ubuntu 19.10:
# pkg-config --variable=completionsdir --define-variable=prefix=/other_dir bash-completion
/usr/share/bash-completion/completions

Ubuntu 19.04:
# pkg-config --variable=completionsdir --define-variable=prefix=/other_dir bash-completion
/other_dir/share/bash-completion/completions

 This is a problem for software that tries to install as a non-root user software in non-system directories.

 The problem is known upstream and has been fixed:
https://github.com/scop/bash-completion/commit/8c5302581ad20954cfa164dcae26f1ed6277dd90#diff-42e567633e7af054a0d01d8f2b93ddf1

Updating the version of bash-completion to 2.10 (https://github.com/scop/bash-completion/releases/tag/2.10) will help to fix the issue. In the new version completionsdir is defined in terms of datadir, so a way to verify that the bug is fixed and one gets the same thing in Ubuntu 19.06 and Ubuntu 19.10 would be:

# pkg-config --variable=completionsdir --define-variable=datadir=/other_dir/share --define-variable=prefix=/other_dir bash-completion
/other_dir/share/bash-completion/completions

 The currently installed package in my system:

# apt-cache policy bash-completion
bash-completion:
  Installed: 1:2.9-1ubuntu1
  Candidate: 1:2.9-1ubuntu1
  Version table:
 *** 1:2.9-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: bash-completion 1:2.9-1ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-65.74-generic 4.15.18
Uname: Linux 4.15.0-65-generic x86_64
ApportVersion: 2.20.11-0ubuntu8.2
Architecture: amd64
Date: Wed Dec 18 11:44:40 2019
Dependencies:

PackageArchitecture: all
SourcePackage: bash-completion
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Enrique (enrique-garcia) wrote :
Revision history for this message
Enrique (enrique-garcia) wrote :

Hi,

this bug seems to be have a well defined patch upstream. Would it be possible to apply it to Ubuntu 19.10?
Also, it would be good that a patched version of bash-completion is included in 20.04.

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.