You are not logged in.
I was wondering if there was a way to check what packages are included in virtual dependencies, such as java-runtime. I have managed to find examples of such info by looking at existing packages, but from what I can tell, there doesn't appear to be a simple way of checking this manually using some sort of command.
Offline
> pacman -Qi java-runtime
Name : jre7-openjdk
Version : 7.u101_2.6.6-1
Description : OpenJDK Java 7 full runtime environment
Architecture : x86_64
Edit.... that may just be in pacman-git
Offline
Here's a perl one-liner to search through the "Provides : ..." line of the output you get with "pacman -Si" or "pacman -Qi":
$ pacman -Si | perl -n00E 'BEGIN{ $search = shift } ($p) = /^Provides +: (.*)$/m; if ( $p =~ /(?<![\w-])$search(?![\w-])/ ) { ($n) = /^Name +: (.*)$/m; say "$n : $p" }' java-runtime
jre7-openjdk : java-runtime=7 java-runtime-openjdk=7
jre8-openjdk : java-runtime=8 java-runtime-openjdk=8
Last edited by Ropid (2016-06-15 09:40:40)
Offline
pactree can resolve provides of installed packages.
pactree -d 0 java-runtime
If you are interested in provides in the sync databases, expac is a nice tool for extracting such data.
$ expac -Ss '%n: %P' java-runtime
java-runtime-common:
jre7-openjdk: java-runtime=7 java-runtime-openjdk=7
jre7-openjdk-headless: java-runtime-headless=7 java-runtime-headless-openjdk=7
jre8-openjdk: java-runtime=8 java-runtime-openjdk=8
jre8-openjdk-headless: java-runtime-headless=8 java-runtime-headless-openjdk=8
It can also be used to query the local database.
Offline
Awesome thanks! Looks like the expac method may have the most complete output. I don't suppose any of these methods could be adapted to work with AUR packages as well?
Offline
I don't think this information is easily accessible for AUR packages. You have to get a list of all packages first and then could use the API or git clone all repositories to get all the provides.
There is a feature request for the AUR that asks for the same.
Offline