You are not logged in.

#1 2016-06-15 05:08:38

cubethethird
Member
Registered: 2016-01-25
Posts: 61
Website

Checking virtual dependencies.

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

#2 2016-06-15 09:12:57

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Checking virtual dependencies.

> 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

#3 2016-06-15 09:38:35

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Checking virtual dependencies.

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

#4 2016-06-15 12:03:16

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: Checking virtual dependencies.

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

#5 2016-06-15 14:30:43

cubethethird
Member
Registered: 2016-01-25
Posts: 61
Website

Re: Checking virtual dependencies.

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

#6 2016-06-16 14:19:44

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: Checking virtual dependencies.

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

Board footer

Powered by FluxBB