apt-file cannot search for patterns starting with -
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt-file (Debian) |
Fix Released
|
Unknown
|
|||
apt-file (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
apt-file search -gtkmozembed
Unknown option: g
Unknown option: t
Unknown option: k
Unknown option: m
Unknown option: o
Unknown option: z
Unknown option: e
Unknown option: m
Unknown option: b
Unknown option: e
Option d requires an argument
apt-file version 2.4.2
(c) 2002 Sebastien J. Gross <email address hidden>
apt-file [options] action [pattern]
apt-file [options] -f action <file>
apt-file [options] -D action <debfile>
Configuration options:
--sources-list -s <file> sources.list location
--cache -c <dir> Cache directory
--architecture -a <arch> Use specific architecture
--cdrom-mount -d <cdrom> Use specific cdrom mountpoint
--from-file -f Read patterns from file(s), one per line
--from-deb -D Use file list of .deb package(s) as
--non-
--package-only -l Only display packages name
--fixed-string -F Do not expand pattern
--ignore-case -i Ignore case distinctions
--regexp -x pattern is a regular expression
--verbose -v run in verbose mode
--dummy -y run in dummy mode (no action)
--help -h Show this help.
--version -V Show version number
Action:
update Fetch Contents files from apt-sources.
search|find <pattern> Search files in packages
list|show <pattern> List files in packages
purge Remove cache files
Interpreting options after command both disables searching for patterns starting with - and is in conflict with the help text that mandates putting options before command.
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: apt-file 2.4.2
ProcVersionSign
Uname: Linux 3.0-1-generic x86_64
Architecture: amd64
Date: Thu Jun 23 22:37:02 2011
PackageArchitec
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: apt-file
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
Changed in apt-file (Debian): | |
status: | Unknown → New |
Changed in apt-file (Debian): | |
status: | New → Fix Committed |
Changed in apt-file (Debian): | |
status: | Fix Committed → Fix Released |
Thanks for your report.
Confirmed in oneiric. Usually Unix command use the '--' special flag to specify that there is no option in the remaining arguments. But apt-file protect the minus sign before passing it to zfgrep.
A possible fix would be to always protect the arguments passed to zfgrep like this:
$ zgrep_pattern =~ s{^\\/}{}; {ignore_ case} ? qr/$pattern/i : qr/$pattern/ };
--- /usr/bin/apt-file 2011-06-23 23:10:22.000000000 +0200
+++ ./apt-file.new 2011-06-23 23:13:04.000000000 +0200
@@ -355,7 +355,7 @@
else {
my $zgrep_pattern = $Conf->{pattern};
- $zcat = "zfgrep $ignore_case $zgrep_pattern";
+ $zcat = "zfgrep $ignore_case -- $zgrep_pattern";
}
}
my $regexp = eval { $Conf->
You can then call:
apt-file search -- -gtkmozembed