pkg list origins?

dave

Well-Known Member

Reaction score: 24
Messages: 421

If I have some origins set for pkg using a command like..

Code:
# pkg set -o lang/php56:lang/php54
... then how do I list and manage those settings? I.e. if I have a machine I am not familiar with, how can I check what options have been changed for pkg using the set command?
 

tobik@

Daemon
Developer

Reaction score: 1,385
Messages: 1,909

AFAIK pkg-set(8) uses SQL UPDATEs under the hood, which means there is no way to list those settings as they are just overwritten in the package database.
 

kpa

Beastie's Twin

Reaction score: 1,810
Messages: 6,318

Yeah, any changes you make to the dependencies are not tracked and the original dependencies that were in effect when the package was installed the first time are not backed up anywhere. There might be a history for the SQLITE database but it's not exposed to the user at the moment.
 
OP
OP
dave

dave

Well-Known Member

Reaction score: 24
Messages: 421

This will show the package origin if set (nothing if not):

Code:
# pkg query '%o %v' php5
I still don't know how you would list set origins for all packages.
 

jrm@

Daemon
Developer

Reaction score: 473
Messages: 1,205

This is hacky, but it works: pkg info -o `pkg info -q`.
 
OP
OP
dave

dave

Well-Known Member

Reaction score: 24
Messages: 421

This is hacky, but it works: pkg info -o `pkg info -q`.
Your command works. Just remove the package name to query all packages: pkg query '%o %v'
None of these are really ideal, because they don't show the difference between what would be the default origins and the current ones. As per the example in the OP, I would have to know the default versions for everything in order to spot the changes. What I'd really like to see is a list of only packages for which the origin has been changed from the default. My command,

Code:
# pkg query '%o %v' php5
...shows output on a machine where the origin for lang/php5 has been set using the command in the OP, but shows no output on a machine where the origin has not been changed.
 

tobik@

Daemon
Developer

Reaction score: 1,385
Messages: 1,909

difference between what would be the default origins and the current ones.
When you ran pkg set you set the new default origin. There is no going back.

shows no output on a machine where the origin has not been changed.
I can't reproduce this. pkg query only shows no output if php5 isn't installed.
 
Top