# pkg list origins?



## dave (Oct 22, 2015)

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


```
# 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@ (Oct 22, 2015)

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 (Oct 22, 2015)

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.


----------



## dave (Nov 6, 2015)

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


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


----------



## jrm@ (Nov 6, 2015)

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


----------



## tobik@ (Nov 6, 2015)

dave said:


> I still don't know how you would list set origins for all packages.


Your command works. Just remove the package name to query all packages: `pkg query '%o %v'`


----------



## dave (Nov 6, 2015)

jrm said:


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





tobik said:


> 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,


```
# 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@ (Nov 6, 2015)

dave said:


> _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.



dave said:


> 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.


----------

