[Bug 1645815] Re: apt install of local debs does not tab-complete
Julian Andres Klode
jak at jak-linux.org
Thu Mar 16 09:43:15 UTC 2017
Verified in 1.2.20
** Description changed:
+ [Impact]
+ Previously apt's bash completion was such that, given
+
+ $ mkdir xyzzz
+ $ touch xyzzy.deb xyzzx.two.deb
+
+ you'd get
+
+ $ apt install xyzz<tab>
+ xyzzx.two.deb xyzzz/
+ $ apt install /tmp/foo/xyzz<tab>
+ xyzzx.two.deb xyzzz/
+
+ this is inconsistent (xyzzx.two.deb is listed but not xyzzy.deb), but
+ worse than that it offered things that apt would not actually
+ recognise as candidates for install:
+
+ $ sudo apt install xyzzx.two.deb
+ Reading package lists... Done
+ Building dependency tree
+ Reading state information... Done
+ E: Unable to locate package xyzzx.two.deb
+ E: Couldn't find any package by glob 'xyzzx.two.deb'
+ E: Couldn't find any package by regex 'xyzzx.two.deb'
+
+ [Test case]
+ With this small (trival, really) change, apt's bash completion should
+ only offer things apt understands, and won't recquire an aditional
+ period in the filename to offer it:
+
+ $ apt install xyzz<tab>^C
+ $ # (no completions!)
+ $ apt install ./xyzz<tab>
+ xyzzx.two.deb xyzzy.deb xyzzz/
+ $ apt install /tmp/foo/xyzz
+ xyzzx.two.deb xyzzy.deb xyzzz/
+
+
+ [Regression potential]
+ Only the expansion of filenames in the completion is affected:
+ - _filedir "*.deb"
+ + if [[ "$cur" == ./* || "$cur" == /* ]]; then
+ + _filedir "deb"
+ + fi
+ so it's unlikely to introduce any regression.
+
+ [Original bug report]
+
this fails:
$ touch xyzzy.deb
$ apt install xyzzy<tab>
because the completion support for install is using _filedir wrong.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt 1.2.15
ProcVersionSignature: Ubuntu 4.4.0-47.68-generic 4.4.24
Uname: Linux 4.4.0-47-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Nov 29 17:51:57 2016
InstallationDate: Installed on 2016-07-05 (147 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)
** Tags removed: verification-needed
** Tags added: verification-done
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1645815
Title:
apt install of local debs does not tab-complete
Status in apt package in Ubuntu:
Fix Released
Status in apt source package in Xenial:
Fix Committed
Status in apt source package in Yakkety:
In Progress
Bug description:
[Impact]
Previously apt's bash completion was such that, given
$ mkdir xyzzz
$ touch xyzzy.deb xyzzx.two.deb
you'd get
$ apt install xyzz<tab>
xyzzx.two.deb xyzzz/
$ apt install /tmp/foo/xyzz<tab>
xyzzx.two.deb xyzzz/
this is inconsistent (xyzzx.two.deb is listed but not xyzzy.deb), but
worse than that it offered things that apt would not actually
recognise as candidates for install:
$ sudo apt install xyzzx.two.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package xyzzx.two.deb
E: Couldn't find any package by glob 'xyzzx.two.deb'
E: Couldn't find any package by regex 'xyzzx.two.deb'
[Test case]
With this small (trival, really) change, apt's bash completion should
only offer things apt understands, and won't recquire an aditional
period in the filename to offer it:
$ apt install xyzz<tab>^C
$ # (no completions!)
$ apt install ./xyzz<tab>
xyzzx.two.deb xyzzy.deb xyzzz/
$ apt install /tmp/foo/xyzz
xyzzx.two.deb xyzzy.deb xyzzz/
[Regression potential]
Only the expansion of filenames in the completion is affected:
- _filedir "*.deb"
+ if [[ "$cur" == ./* || "$cur" == /* ]]; then
+ _filedir "deb"
+ fi
so it's unlikely to introduce any regression.
[Original bug report]
this fails:
$ touch xyzzy.deb
$ apt install xyzzy<tab>
because the completion support for install is using _filedir wrong.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt 1.2.15
ProcVersionSignature: Ubuntu 4.4.0-47.68-generic 4.4.24
Uname: Linux 4.4.0-47-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Nov 29 17:51:57 2016
InstallationDate: Installed on 2016-07-05 (147 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1645815/+subscriptions
More information about the foundations-bugs
mailing list