Package: apt-file
Version: 2.0.8.2
Severity: wishlist
Tags: patch
In the case of non-regexp searches, apt-file's speed can be increased by a
factor of two by using zgrep. Patch is attached.
--- apt-file 2008-03-11 15:51:32.000000000 +0100
+++ /usr/bin/apt-file 2006-11-14 15:43:42.000000000 +0100
@@ -238,9 +238,6 @@
my ($pack, $file);
debug "regexp: $pattern";
$|=1;
- my $zcat = $Conf->{is_regexp} ? "zcat" :
- $Conf->{ignore_case} ? "zfgrep -i $Conf->{pattern}" :
- "zfgrep $Conf->{pattern}";
my $regexp = eval { $Conf->{ignore_case} ? qr/$pattern/i : qr/$pattern/ };
error($@) if $@;
foreach(@$data) {
@@ -248,8 +245,8 @@
next if (! -f $file);
$file = quotemeta $file;
debug "Search in $file";
- open (ZCAT, "$zcat $file |") ||
- warning "Can't $zcat $file";
+ open (ZCAT, "zcat $file |") ||
+ warning "Can't zcat $file";
while(<ZCAT>) {
next if ! (($pack, $file) = /$regexp/);
debug_line ".";