From a454790395e40d8cadf3c4c5b4765117dfceb80c Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Wed, 27 May 2015 13:58:18 +0200 Subject: [PATCH] zypper-fsearch: allow to override solvfiledir via zypp.conf --- tools/zypper-fsearch | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 $!;