From owner-freebsd-ports Sat Nov 9 5: 5:28 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3A3437B401; Sat, 9 Nov 2002 05:05:25 -0800 (PST) Received: from shale.csir.co.za (shale.csir.co.za [146.64.46.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 416AD43E3B; Sat, 9 Nov 2002 05:05:22 -0800 (PST) (envelope-from reg@shale.csir.co.za) Received: (from reg@localhost) by shale.csir.co.za (8.11.6/8.11.6) id gA9D4oI17959; Sat, 9 Nov 2002 15:04:50 +0200 (SAT) (envelope-from reg) Date: Sat, 9 Nov 2002 15:04:50 +0200 From: Jeremy Lea To: Kris Kennaway Cc: ports@FreeBSD.ORG, portmgr@FreeBSD.ORG, re@FreeBSD.ORG Subject: Re: Need to use a different INDEX for 5.0 Message-ID: <20021109130450.GA4131@shale.csir.co.za> References: <20021109034006.GA28876@rot13.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021109034006.GA28876@rot13.obsecurity.org> User-Agent: Mutt/1.4i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, On Fri, Nov 08, 2002 at 07:40:08PM -0800, Kris Kennaway wrote: > I'm going to add a /usr/ports/INDEX-5 This might also help... Index: perform.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/version/perform.c,v retrieving revision 1.4 diff -u -r1.4 perform.c --- perform.c 9 Sep 2002 11:13:00 -0000 1.4 +++ perform.c 9 Nov 2002 12:59:53 -0000 @@ -52,14 +52,19 @@ * Try to find and open the INDEX. We only check IndexFile != NULL * later, if we actually need the INDEX. */ - if (*indexarg == NULL) - snprintf(tmp, PATH_MAX, "%s/INDEX", PORTS_DIR); - else + if (*indexarg == NULL) { + snprintf(tmp, PATH_MAX, "%s/INDEX-5", PORTS_DIR); + if ((IndexFile = fopen(tmp, "r")) == NULL) { + snprintf(tmp, PATH_MAX, "%s/INDEX", PORTS_DIR); + IndexFile = fopen(tmp, "r"); + } + } else { strlcpy(tmp, *indexarg, PATH_MAX); - if (isURL(tmp)) - IndexFile = fetchGetURL(tmp, ""); - else - IndexFile = fopen(tmp, "r"); + if (isURL(tmp)) + IndexFile = fetchGetURL(tmp, ""); + else + IndexFile = fopen(tmp, "r"); + } /* Get a list of all the installed packages */ pkgs = matchinstalled(MATCH_ALL, NULL, &err_cnt); Index: pkg_version.1 =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/version/pkg_version.1,v retrieving revision 1.22 diff -u -r1.22 pkg_version.1 --- pkg_version.1 24 Jun 2002 16:03:24 -0000 1.22 +++ pkg_version.1 9 Nov 2002 12:59:53 -0000 @@ -156,9 +156,10 @@ .Xr fetch 1 can be used here. If no .Ar index -file is specified on the command line, -.Pa /usr/ports/INDEX -is used. +file is specified on the command line then +.Pa /usr/ports/INDEX-5 +is tried first, followed by +.Pa /usr/ports/INDEX . .El .Sh SEE ALSO .Xr fetch 1 , @@ -167,9 +168,11 @@ .Xr pkg_delete 1 , .Xr pkg_info 1 .Sh FILES -.Bl -tag -width /usr/ports/INDEX -compact +.Bl -tag -width /usr/ports/INDEX-5 -compact .It Pa /usr/ports/INDEX -Default index file. +Default index file on 5.x. +.It Pa /usr/ports/INDEX +Default index file on earlier versions. .El .Sh EXAMPLES The following is a typical invocation of the Salt to taste... -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-ports" in the body of the message