From owner-freebsd-ports@FreeBSD.ORG Sat Jan 10 04:05:02 2009 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F810106564A for ; Sat, 10 Jan 2009 04:05:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 27A6A8FC19 for ; Sat, 10 Jan 2009 04:05:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 30533 invoked by uid 399); 10 Jan 2009 04:05:01 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 10 Jan 2009 04:05:01 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <49681E6C.9060703@FreeBSD.org> Date: Fri, 09 Jan 2009 20:05:00 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.19 (X11/20090102) MIME-Version: 1.0 To: Josh Rickmar References: <53980.67.177.142.45.1224810884.squirrel@ssl.eumx.net> In-Reply-To: <53980.67.177.142.45.1224810884.squirrel@ssl.eumx.net> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-ports@FreeBSD.org Subject: Removing stale dependencies (Was: Re: Concern about using pkg_delete -r) 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, 10 Jan 2009 04:05:02 -0000 Josh Rickmar wrote: > I'm hoping that this list covers port tools as well as the usual > discussions about the actual ports. If not, please CC this to the proper > list. > > I want to use pkg_delete to remove an installed port, but also want to > remove its orphaned dependencies along with it. After looking at the > pkg_delete(1) man page, the -r flag seems to be the option to use for this > job. My concern, though, is about the wording: > >> In addition to specified packages, delete all >> packages that depend on those packages as well. > > Does this mean that if I pkg_delete -r pkgA, than pkgB (a dependency) will > be removed with it, even though it is dependency of pkgC? Or is > pkg_delete (or pkg_deinstall) smart enough to understand this dependency > and keep pkgB installed? > > If in this scenario pkgB would be deleted, should an extra warning be > added to the man page so that users know that using this flag could > potentially break their other ports? ports-mgmt/portmaster has options to do what you want. The -s option will detect any port that was installed as a dependency of another port (or ports) but is no longer needed; and will give you an option to delete it. (It's an option because things can sometimes move from being a leaf port to being a dependency.) The -e option allows you to "expunge" a leaf port that you no longer want and then runs portmaster again with -s to detect any newly orphaned dependencies. Both options are compatible with the -[dD] options to delete or not delete the relevant distfiles and the -b option to create backup packages of the installed bits before deleting them. I suggest running -s first, then 'portmaster -l' to get a list of what you have installed. Anything listed as a "root" or "leaf" port can be fed to the -e option. hth, Doug -- This .signature sanitized for your protection