[zypp-devel] [PATCH] Support searching file with full path
This patch enable zypper searching file with full path, which is the function as 'yum provides'. --- src/Zypper.cc | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/Zypper.cc b/src/Zypper.cc index a43ec47..817b10e 100644 --- a/src/Zypper.cc +++ b/src/Zypper.cc @@ -3646,6 +3646,12 @@ void Zypper::doCommand() query.addString(*it); if (!query.matchGlob() && it->find_first_of("?*") != string::npos) query.setMatchGlob(); + if (it->substr(0, 1) == "/") + { + query.addAttribute(sat::SolvAttr::filelist); + query.setFilesMatchFullPath(true); + query.setMatchExact(); + } } query.addAttribute(sat::SolvAttr::name); if (cOpts().count("search-descriptions")) -- 1.7.2.2 -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (1)
-
Zhang Qiang