From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 7 00:03:54 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FBD316A401 for ; Wed, 7 Feb 2007 00:03:54 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (vpn.mired.org [66.92.153.74]) by mx1.freebsd.org (Postfix) with SMTP id B6DB913C47E for ; Wed, 7 Feb 2007 00:03:51 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 56294 invoked by uid 1001); 7 Feb 2007 00:04:42 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Tue, 06 Feb 2007 19:04:41 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17865.6041.605201.772296@bhuda.mired.org> Date: Tue, 6 Feb 2007 19:04:41 -0500 To: "Henry Lenzi" In-Reply-To: <8b4c81f0702061514r5a753e48yea0ce9b937236fc3@mail.gmail.com> References: <8b4c81f0702061514r5a753e48yea0ce9b937236fc3@mail.gmail.com> X-Mailer: VM 7.17 under 21.4 (patch 20) "Double Solitaire" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Mike Meyer Cc: freebsd-hackers@freebsd.org Subject: Re: pkg_add does not backtrack, does it? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2007 00:03:54 -0000 In <8b4c81f0702061514r5a753e48yea0ce9b937236fc3@mail.gmail.com>, Henry Lenzi typed: > I haven't found the pkg_add code (it's in Ruby, is it?). It's in /usr/src/usr.sbin/pkg_install/add. And no, it's not in ruby. > But from the behaviour of pkg_add -r, it's safe to say that it > doesn't backtrack to resolve dependencies, does it? Why should using a remote repository change the behavior of pkg_add? Are you sure you're not thinking of portupgrade? The -r otion to it causes things to be recursive, and it is sourced in ruby. And it's in the ports tree, not the base system (because it's sourced in ruby), so you'll need to look for the source (or maybe a tarball) there. > Like, for instance (a real example), during gnome2 installation on 6.2: > > warning: 'gstreamer-plugins-gconf-0.10.4_3,2' requires > 'gstreamer-plugins-0.10.10,2', but 'gstreamer-plugins-0.10.9,1' is > installed > > pkg_add goes right ahead. It does not com back to deinstalling > 'gstreamer-plugins-0.10.9,1' and all its dependencies and _then_ goes > back to that point. This looks a little bit confused. "not com back to deinstalling"? Since it wasn't deinstalling that package, it can't come back to it. For that matter, pkg_add doesn't deinstall packages at all as far as I know. I think you're asking if pkg_add will deinstall a package if a newer one is required by a package being installed. That isn't a decision it can really make - you don't know what will break if you do that. > Isn't this a classic AI backtracking problem? (ok, complete noob opinion here). Backtracking is usually associated with a search for a goal. Only the human invoking pkg_add knows the goal, so to decide whether or not a port should be deinstalled requires information from that person. The previously mentioned portupgrade has some flags to provide specific instances of that information for special cases. The port also has some commands for achieving specific goals. If you let us know what your goals are, we might be able to help you get there. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.