Re: Script to set/unset "automatic" status in PKGNG database

From: John Nielsen <lists_at_jnielsen.net>
Date: Fri, 31 Aug 2012 08:46:19 -0600
On Aug 30, 2012, at 11:56 PM, Matthew Seaman <matthew_at_freebsd.org> wrote:

> On 30/08/2012 22:44, John Nielsen wrote:
>> After dialog(1) exits the script has a list of packages to mark as
>> automatic. Is there a non-SQL way to efficiently get the inverse?
>> I.e. the set { all_packages - new_automatic_package_list } ?
> 
> Use pkg query - it is really quite powerful.  This shows all
> non-autoremove packages as name-version:
> 
> pkg query -e '%a == 0' '%n-%v'
> 
> and this shows the port origin for all autoremove packages:
> 
> pkg query -e '%a == 1' '%o'

Thanks. I know about pkg query (and in fact my script uses something very much like that to get the initial list of automatic packages). What I was trying to do was get a list of packages installed but not in another list. The other list represents _future_ automatic packages but not necessarily what is in the database now.

In any case, I worked around it but first unsetting all packages and then setting the user-selected list back to automatic.

JN
Received on Fri Aug 31 2012 - 12:46:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:30 UTC