Date: Thu, 30 Aug 2012 15:44:23 -0600 From: John Nielsen <lists@jnielsen.net> To: Julien Laffaye <jlaffaye@freebsd.org> Cc: "ports@freebsd.org" <ports@freebsd.org>, "current@freebsd.org" <current@freebsd.org> Subject: Re: Script to set/unset "automatic" status in PKGNG database Message-ID: <D1F2FA16-85D7-4365-B4BB-235C1A7D5327@jnielsen.net> In-Reply-To: <503FDB2A.4000609@freebsd.org> References: <CFA2273E-4498-4A64-BC9F-CE5AA560409D@jnielsen.net> <503FDB2A.4000609@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 30, 2012, at 3:29 PM, Julien Laffaye <jlaffaye@freebsd.org> = wrote: > On 8/30/2012 11:19 PM, John Nielsen wrote: >> I today noticed the "pkg autoremove" command for the first time, = which does much the same thing as pkg_cutleaves but relies on the = "automatic" flag in the pkgng database rather than user input to = determine which "leaf" ports can be removed. Unfortunately, the pkg2ng = utility has no way of knowing which old-style packages it converts were = installed automatically as dependencies, so they are all marked as = non-automatic (i.e. user-requested). In my case, this was not true for = the majority of installed ports. Since I really like this functionality, = I decided to update my local package database to match my preferences. >>=20 >> Having succeeded, I decided a tool to make doing so easy could well = benefit others (as well as my future self). (Plus I wanted an excuse to = play with dialog(1) and "pkg query" a bit.) So here's the result. I'm = not too attached to the name. It shouldn't eat your package database or = steal your lunch money, but I'm not responsible if it does. Other than = that, feedback is welcome. >>=20 > You want to use `pkg set -A` :) > We make zero promises concerning the SQL schema in pkgng so it can = change at every time and break your script. Thanks. I looked for something like that but not hard enough obviously. = I'll change it. 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 } ? JN
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D1F2FA16-85D7-4365-B4BB-235C1A7D5327>