Skip to content

Commit

Permalink
zypper-fsearch: allow to override solvfiledir via zypp.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwiedemann committed Jun 9, 2016
1 parent fffe6ce commit 7961851
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/zypper-fsearch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
use strict;

my $pattern=shift;
chdir("/var/cache/zypp/solv") or die;
my $solvdir="/var/cache/zypp/solv";
open(my $cnf, "/etc/zypp/zypp.conf") or die "zypp.conf: $!";
while(<$cnf>) {
if(m/^cachedir = (.*)/) {$solvdir="$1/solv"}
if(m/^solvfilesdir = (.*)/) {$solvdir=$1}
}
chdir($solvdir) or die;
my @idx=<*/solv.idx> or die "no solv.idx files";
open(my $pipe, "-|", "grep", "--with-filename", "--", $pattern, @idx) or die $!;

Expand Down

0 comments on commit 7961851

Please sign in to comment.