From owner-freebsd-questions@FreeBSD.ORG Wed Sep 20 19:12:31 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 7FDA816A4CE for ; Wed, 20 Sep 2006 19:12:31 +0000 (UTC) (envelope-from list-freebsd-2004@morbius.sent.com) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A5D043D72 for ; Wed, 20 Sep 2006 19:12:28 +0000 (GMT) (envelope-from list-freebsd-2004@morbius.sent.com) Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id 6927ADA8A8C for ; Wed, 20 Sep 2006 15:12:27 -0400 (EDT) Received: from heartbeat1.internal ([10.202.2.160]) by frontend3.internal (MEProxy); Wed, 20 Sep 2006 15:12:28 -0400 X-Sasl-enc: 3SgPPZG9EUCSwAFHKypa6ZOBDXPr8ZrSUsqs0mproPWV 1158779548 Received: from [192.168.1.2] (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mail.messagingengine.com (Postfix) with ESMTP id A502E8B80 for ; Wed, 20 Sep 2006 15:12:28 -0400 (EDT) From: RW To: freebsd-questions@freebsd.org Date: Wed, 20 Sep 2006 20:12:22 +0100 User-Agent: KMail/1.9.4 References: <20060920184533.98954.qmail@web35303.mail.mud.yahoo.com> In-Reply-To: <20060920184533.98954.qmail@web35303.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609202012.23996.list-freebsd-2004@morbius.sent.com> Subject: Re: extracting base names from package listing X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 19:12:31 -0000 On Wednesday 20 September 2006 19:45, Andrew Gould wrote: > pkg_info provides a nice listing of package names that > include version numbers. I'd like to have a list of > the names without the version numbers so that I can > write a script to install the newer versions after a > clean installation. > > Looking at the package names, I'm having a hard time > coming up with an algorithm for separating the package > names from the version numbers. Many package names > have dashes (postgresql-server), and some have letters > in the version numbers (libid3tag-0.15.1b). > > Does anyone have a good way of separating the package > names from the version numbers? > > Is there a better way of identifying and installing a > set of packages after a clean installation? What you actually want is the origins, pkg_info -oq "*" will give you that. What I think is a better idea is to get a list of the leaf origins, and let the ports sytem sort out the rest itself - you may end up with a cleaner set of dependencies. See the thread "Moving to new PC" above for a way to get these from portmanager.