On Fri, Sep 29, 2006 at 04:26:01PM +0200, Marc Espie wrote: > Just remove everything you don't need that was not tagged as explicitly > installed, wanted by the user.
Be specific. Remove what? The dependencies won't be marked as explicitly installed. They are going to be removed? They should not. > You do pkg_add pkg1 pkg2 pkg3 -> means you want to have pkg1, pkg2, pkg3, > they're tagged as manual installation. Other packages (say pkg4, pkg5, pkg6) > have been installed manually. (there's a -a switch to pkg_add already, > to be able to install stuff from scripts, where the user doesn't say they > want that package. You do pkg_add pkg1 pkg2 pkg3 and these 3 packages are recorded as explicitly installed. Cause these are the ones that you defined in the command line to be installed, not installed as dependencies. > You do some changes to the installation (updates, removal...) and suddenly > pkg5, pkg6 are no longer needed by anything: the system can remove them. > > It will probably remove them later: if you do pkg_delete without any package > name, the system will remove any stuff that's not tagged as installed by > the user, and that's not needed by any package that was explicitly installed > by the user. Almost agree. Using any method will leave you with orphans from package removals AND updates. Using my method will leave you with orphans only from updates that, yes, can be easily detected and uninstalled. > In fact, the only thing I really need to do is flatten the way pkg_add > handles already installed packages, because you need to be able to say > pkg_add pkg5 to tell it you want to mark pkg5 as installed manually, even > if it was just a dependency of something. Totally wrong, according to my idea. Again using my way keeps the package list as minimal as possible, without any extra/uneeded packages. > Computing the list of unwanted packages is trivial: it's just a graph > closure. Maintaining the info manual install/not manual install is a bit > more fun, especially as it means cleaning up some ad-hoc parts of the > package code. Maintaining info about manual, or not, install is one line, in one file, under the package directory in /var/db/pkg. -- Sideris Michael http://black.daemons.gr/msid/
