diff --git a/tools/zypper-fsearch b/tools/zypper-fsearch index 29137d4df2..07045e283f 100755 --- a/tools/zypper-fsearch +++ b/tools/zypper-fsearch @@ -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 $!;