On Aug 30, 2012, at 3:28 PM, Baptiste Daroussin <bapt_at_freebsd.org> wrote: > On Thu, Aug 30, 2012 at 03:19:59PM -0600, 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. >> >> 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. > > Would you mind adding create a patch against the git tree of pkgng so that we > can include your script into the scripts subdirectory, so that we provide your > script along with the next pkg 1.0.1 as a contributed script? No problem. Attached is the output of "git diff origin" after dropping my script in to my local tree. Let me know if you need something else. Changes between this and the version I originally posted: Added 2-clause license and disclaimer Replaced SQL with 'pkg set' commands. Since I didn't come up with a fast way to list the packages not in the 'automatic' list, I first set all packages to 0 (not automatic), then set the ones in the list to 1. This is likely slower than the SQL variant was, but it's not bad and not something likely to be run frequently. JN
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:30 UTC