-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zypper does not have an equivalent to "dnf whatprovides" #469
Comments
Our -f, --file-list Search in the file list of packages. Note that the full file list is available for installed packages only. For remote packages only an abstract of their file list is available within the metadata (files containing /etc/, /bin/, or /sbin/). And we kind of have an equivalent to what-provides (wp) capability List all packages providing the specified capability (case- insensitive search). See also the install command for info about specifying capabilities. The command line is automatically transformed into the corresponding search command: $ zypper what-provides 'zypper>1.6' $ zypper search --provides --match-exact 'zypper>1.6' For a case-sensitive search call $ zypper search --provides --match-exact --case-sensitive 'zypper>1.6' I'm not sure, but I think DNF distros -- Fedora/CentOS/RHEL -- generates capabilities for each file in their packages, opposed to what we do, defining file provisions in OBS project configurations, like we see in openSUSE:Factory:
And I wonder why Zypper doesn't search for other locations as well, when the right package is not installed, aside from |
Answering myself here, I hope. It seems that Zypper gets the filelist from libsolv, and that filelist is filtered. So, the search for files in non-installed packages was implemented, primarily, for dependency resolution of binary files, which makes sense. I'm probably missing something, though. Nonetheless, if Zypper would implement searches for any file in non-installed packages, it has to use something different than what P.S. But I wonder if something else would do too, a standalone script to parse the xml file wouldn't be that hard to come up with. |
The main reason is that we do not download/refresh the repositories filelists.xml (TW-oss ~48M for TW-oss ) and other.xml (~37MB for TW-oss; contains the changelogs) at all. Due to their size it is very expensive to keep them up-to-date. We could think about a flag to include them if your bandwith is big enough. Or we could try to download them on demand only , though this would delay searches for files/chanelogs a lot. For listing changelog/files of a specific package we could download the packages .rpm header on demand and query this. But a free search in all filelists/changelogs will be expensive. Currently we just see the files which are explicitly provided by package. Those provides are injected when building the repo metadata on the server and they live in the repos primary.xml . So the client (zypper) can actually not tell which directories (/etc/, /bin/,...) the server covers. OBS AFAIK focuses on files which may actually be required by other packages. |
I think that if someone requests a what provides, you should download the complete metadata to answer that query. It's what yum/dnf have done in the same situation when you request a what provides. Second, we should be able to search the full filesystem hierachy, especially because someone may be looking for libraries or similar. I have needed (and so have others) the ability to answer "what provides libblah.so" more than once. |
Yeah, indeed it's a somewhat beefy file. And I wonder what if we used a compression method other than GZIP, maybe XZ or even the fast decompression ratios ZSTD. I remember reading -- in the Heroes mailing list, if memory serves -- a thread where Bernhard W. played a little with XZ and ZSTD, and compared them. Both XZ and ZSTD had better numbers than GZIP.
Agreed, it's very expensive. Anyone who uses DNF can feel the slowness when it has to refresh repo metadata, even more so when people is using a rolling distribution. Now, here I am wondering if this wouldn't be a job for a secondary tool, one that wouldn't block Zypper. Something like what Debian/Ubuntu did. They have an
Yes, the In the versions to come, OBS will show us the list of files in the web UI, along with the current symbol provision/requirement view for the generated RPM package. And this, in turn, makes me wonder if we could implement the full filesystem hierarchy search in OSC instead. |
ZSTD is significantly faster than XZ too. we are starting to swap to it for compression in rust packaging. And to reiterate, you could just download the file when a user does a provides command. |
ZYPP downloads whatever the server provides. ZYPP itself could handle XZ as well as ZCK. We extra added support for ZCK and thought the build service would want to switch to it, but they AFAIK prefer GZ (--rsyncable) because of it 's faster compression. Benjamin and Andreii are working on #openSUSE/libzypp#417 and also try to get proper zsync data to d.o.o and the mirrors, so we can at least benefit from --rsyncayble and download only the changed ranges. But we also found that d.o.o and some mirros refuse to provide more than a few ranges in one request. So we won't be able to fetch all ranges in one go, but may at least benefit from a reduced download size, if only small parts in the metadata changed. And yes, donwloading filelist/other on demand might be an option. |
That's interesting, Zstd has
Oh, this sounds promising to me. |
On fedora and rhel you can use dnf whatprovides to locate a specific file that is provided by a package, even if that package is not installed.
zypper has no equivalent to this. zypper se -f seems to only search already installed packages.
An example of why this is useful is you can type "dnf whatprovides '*/ldapsearch'" and get an answer. There is, easy to access and obvious equivalent in zypper.
Having something like zypper whatprovides would be a great equaliser and accesibility tool.
The text was updated successfully, but these errors were encountered: