From owner-freebsd-questions Tue Nov 5 10: 0:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E41537B401 for ; Tue, 5 Nov 2002 10:00:13 -0800 (PST) Received: from mx1.eskimo.com (mx1.eskimo.com [204.122.16.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15B9D43E3B for ; Tue, 5 Nov 2002 10:00:12 -0800 (PST) (envelope-from ripper@eskimo.com) Received: from eskimo.com (ripper@eskimo.com [204.122.16.13]) by mx1.eskimo.com (8.9.1a/8.8.8) with ESMTP id KAA04673 for ; Tue, 5 Nov 2002 10:00:04 -0800 Received: (from ripper@localhost) by eskimo.com (8.9.1a/8.9.1) id KAA06695 for questions@freebsd.org; Tue, 5 Nov 2002 10:00:04 -0800 (PST) Date: Tue, 5 Nov 2002 10:00:03 -0800 From: Ross Lippert To: questions@freebsd.org Subject: mapping ports to packages Message-ID: <20021105100003.A5846@eskimo.eskimo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i WWW-Home-Page: http://www.eskimo.com/~ripper Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I am writing a little utility to help me get an instant-workstation (the instant-workstation port is fine when you have high bandwidth, but not when you are low bandwidth and have CDs with some stuff already, blah blah blah, there are other reasons why I believe this would be a nice thing). Anyhow, I'm trying to make it flexible enough that it will fetch from ftp or the CDs or build the port, depending on user input. However, this bring up a bit of FreeBSD ugliness: port vs package names. Three bits of functionality are needed here, as I see it: 1) figuring out whether a specified package/port is installed 2) figuring out what package name to use with pkg_add -r 3) figuring out which port name to CD to to make install With the user specifying either a port name or a pkg name. If the user specifies a port directory, than #1 and #3 seem to be easy to take care of, since #1 can be check by looking for ORIGIN comments in /var/db/pkg. (note: if I go with package names, then I have to deal with their brittleness due to version information encoded in them in non-uniform way, which requires more patter matching than I really think I know how to do.) #2 is trickier. I know that somewhere in the Makefile of each port is a set of variables, such that when I concat them I can the package name, but port makefiles are a bit icky, and I was wondering if there was a quick way (like 'make package_name') to spit out the portname-->packagename map I want? So, how do I get a package name from a port nicely? -r To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message