From owner-freebsd-ports@FreeBSD.ORG Sat Jul 7 16:58:02 2007 Return-Path: X-Original-To: freebsd-ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46ED116A468 for ; Sat, 7 Jul 2007 16:58:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with SMTP id F1FA613C489 for ; Sat, 7 Jul 2007 16:58:01 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 30200 invoked by uid 399); 7 Jul 2007 16:58:01 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 7 Jul 2007 16:58:01 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <468FC617.6070304@FreeBSD.org> Date: Sat, 07 Jul 2007 09:57:59 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.4 (X11/20070617) MIME-Version: 1.0 To: Michel Talon References: <20070707145958.GA3472@lpthe.jussieu.fr> In-Reply-To: <20070707145958.GA3472@lpthe.jussieu.fr> X-Enigmail-Version: 0.95.1 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-ports@FreeBSD.org Subject: Re: Keeping track of automatically installed dependency-only ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2007 16:58:02 -0000 Michel Talon wrote: > Doug Barton said: > >> Jeremie Le Hen wrote: >>> Hi, >>> >>> Is there a way to track dependency-only ports, so that if I >>> install port0 which requires port1 which in turn requires port2 >>> and so on, deinstalling port0 will deinstall portN up to the >>> first one required by another port or one I explicitely >>> installed. >> I realize that this is an old post, but the thread it generated >> indicated that there is demand for this kind of functionality, >> and no solutions were presented that I could see. >> >> Portmaster actually has what I believe you are looking for. > > Finding installed packages which have no REQUIRED_BY is easy, > portmaster do it, check_pkg.py do it, but i don't think this is the > solution of the problem. Ok, thanks for clarifying how you see the problem. :) > For example, port1 may require port2 which itself requires port3. > Assume you remove port1, and that, as a consequence port2 and port3 > are no more necessary. It is only port2 which has an empty > REQUIRED_BY, Until you remove port2. > as long as you have not removed port2, port3 mentions it in > REQUIRED_BY. So the deletion should have to be recursive. The 'portmaster -s' function is indeed recursive, for exactly the reason you suggest. > Moreover on a large installation you may have a large number of > ports that should be removed and should require user approval to do > so. But it is hard to remember several months after the fact, if a > port without REQUIRED_BY has been installed as a dependency or for > a precise reason. I tend to disagree with you here, but since this is a matter of opinion, I'll agree to disagree. :) > The only reliable way to detect ports which have been installed as > a dependency is to create a database *shudder* You just tripped over your own argument here. There are plenty of ways that we could recognize a port that was installed as a dependency. The one that comes immediately to mind is to create a flag file in /var/db/pkg/foo (or /var/db/ports/foo) to indicate that the port was installed as a dependency. It would be trivial for portmaster and portupgrade to do this, slightly more complicated for it to be done in bsd.port.mk, but not impossible. > indicating which ports have been required by the end user, and > which ones have been automatically installed. Well, what happens if an application (rather than a library) gets installed as a dependency, but you decide that you like that application, and want to keep it? How do you "promote" something from "dependency installed" to "user installed?" Personally I think that portmaster's approach is the right one. If you accidentally delete something that it turns out you really do need, you can always install it again. On the other hand, the presence of an empty +REQUIRED_BY file is a very reliable indication that something was previously installed as a dependency, but is no longer needed. I'd be interested to hear if others have opinions about this ... Doug -- This .signature sanitized for your protection