Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Aug 2012 08:46:19 -0600
From:      John Nielsen <lists@jnielsen.net>
To:        Matthew Seaman <matthew@freebsd.org>
Cc:        "ports@freebsd.org" <ports@freebsd.org>, "current@freebsd.org" <current@freebsd.org>, Julien Laffaye <jlaffaye@freebsd.org>
Subject:   Re: Script to set/unset "automatic" status in PKGNG database
Message-ID:  <95FAC698-F7DA-4E49-BB20-EBB023ACF1F2@jnielsen.net>
In-Reply-To: <50405219.8090804@FreeBSD.org>
References:  <CFA2273E-4498-4A64-BC9F-CE5AA560409D@jnielsen.net> <503FDB2A.4000609@freebsd.org> <D1F2FA16-85D7-4365-B4BB-235C1A7D5327@jnielsen.net> <50405219.8090804@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 30, 2012, at 11:56 PM, Matthew Seaman <matthew@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 } ?
>=20
> Use pkg query - it is really quite powerful.  This shows all
> non-autoremove packages as name-version:
>=20
> pkg query -e '%a =3D=3D 0' '%n-%v'
>=20
> and this shows the port origin for all autoremove packages:
>=20
> pkg query -e '%a =3D=3D 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?95FAC698-F7DA-4E49-BB20-EBB023ACF1F2>