Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Nov 2002 15:04:50 +0200
From:      Jeremy Lea <reg@FreeBSD.ORG>
To:        Kris Kennaway <kris@obsecurity.org>
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>
In-Reply-To: <20021109034006.GA28876@rot13.obsecurity.org>
References:  <20021109034006.GA28876@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021109130450.GA4131>