From owner-freebsd-current Mon Jun 26 10: 5:38 2000 Delivered-To: freebsd-current@freebsd.org Received: from shale.csir.co.za (shale.csir.co.za [146.64.46.5]) by hub.freebsd.org (Postfix) with ESMTP id BA8A737B902 for ; Mon, 26 Jun 2000 10:05:28 -0700 (PDT) (envelope-from reg@shale.csir.co.za) Received: from C992631-A.pinol1.sfba.home.com (C992631-A.pinol1.sfba.home.com [24.12.58.155]) by shale.csir.co.za (8.9.3/8.9.3) with ESMTP id TAA98104; Mon, 26 Jun 2000 19:04:58 +0200 (SAT) (envelope-from reg@shale.csir.co.za) Received: (from reg@localhost) by C992631-A.pinol1.sfba.home.com (8.9.3/8.9.3) id KAA57814; Mon, 26 Jun 2000 10:04:52 -0700 (PDT) (envelope-from reg) Date: Mon, 26 Jun 2000 10:04:52 -0700 From: Jeremy Lea To: Sheldon Hearn Cc: current@FreeBSD.ORG Subject: Re: Call for review: pkg_which. Message-ID: <20000626100452.D311@shale.csir.co.za> References: <20000626005659.B311@shale.csir.co.za> <44785.962015409@axl.ops.uunet.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <44785.962015409@axl.ops.uunet.co.za>; from sheldonh@uunet.co.za on Mon, Jun 26, 2000 at 12:30:09PM +0200 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, On Mon, Jun 26, 2000 at 12:30:09PM +0200, Sheldon Hearn wrote: > Argh, yet another pkg_* command that looks (at first glance anyway) like > it should have been implemented as a feature enhancement to the existing > pkg_* tools. > > What is it that makes this unsuitable for incorporation into the > existing tools? I thought about doing it within pkg_info, but it would mean changing the logic flow there a lot. Basically, pkg_info takes package names on the command line, and itterates over them. pkg_which takes file names, and (will) itterate over them. Also, pkg_which always operates on all of the installed packages, and never on packages which it must obtain via FTP. I don't see any reason to check a subset of packages, or to check packages which have not been installed. I've yet to implement a few features, one being support for multiple files (not difficult once things work for one). With this I can do things like: CHK_PLIST=`cat ${PLIST} | sed -e '/^@/d' -e 's#^#${PREFIX}#'` CONFLICTING_PACKAGES=`pkg_which ${CHK_PLIST}` if [ -n ${CONFLICT_PACKAGES} ]; then ${ECHO_MSG} "WARNING: This port will overwrite existing " \ "files installed by the following package(s): " \ ${CONFLICTING_PACAKGES} fi in bsd.port.mk. I also want to move most of the core logic into the pkg_install library, so that I can use it for pkg_add. My next task is an extension to pkg_add which will make it's dependency mechanism work like that for ports. It will look like this in the PLIST (to preserve compatability): @pkgdep glib-1.2.8 @comment libdep:glib12.3 Which I can add magic processing for into pkg_add, which will check for the existance of glib12.3 (via pkg_which -l) and work out that it might rather depend on an installed glib-1.2.7. Also, pkg_upgrade is going to need to know why packages depend on one another. Regards, -Jeremy -- FreeBSD - Because the best things in life are free... http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message