From mharo@patrol.area51.fremont.ca.us Wed Apr  7 21:54:20 1999
Return-Path: <mharo@patrol.area51.fremont.ca.us>
Received: from patrol.area51.fremont.ca.us (d60-076.leach.ucdavis.edu [169.237.60.76])
	by hub.freebsd.org (Postfix) with ESMTP id 713E9150AF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  7 Apr 1999 21:54:20 -0700 (PDT)
	(envelope-from mharo@patrol.area51.fremont.ca.us)
Received: (from mharo@localhost)
	by patrol.area51.fremont.ca.us (8.9.2/8.9.2) id VAA25643;
	Wed, 7 Apr 1999 21:52:20 -0700 (PDT)
	(envelope-from mharo)
Message-Id: <199904080452.VAA25643@patrol.area51.fremont.ca.us>
Date: Wed, 7 Apr 1999 21:52:20 -0700 (PDT)
From: mharo@area51.fremont.ca.us
Sender: mharo@patrol.area51.fremont.ca.us
Reply-To: mharo@area51.fremont.ca.us
To: FreeBSD-gnats-submit@freebsd.org
Subject: Patch: pkg_info tries to cd to .mkversion
X-Send-Pr-Version: 3.2

>Number:         11016
>Category:       bin
>Synopsis:       Patch: pkg_info tries to cd to .mkversion
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr  7 22:00:00 PDT 1999
>Closed-Date:    Thu Apr 29 23:13:15 PDT 1999
>Last-Modified:  Thu Apr 29 23:14:10 PDT 1999
>Originator:     Michael Haro
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
>Environment:

	

>Description:

> From: "Stephen J. Roznowski" <sjr@home.net>
> Subject: pkg_info error?

> When I run "pkg_info -aI", I get the following error:
>     pkg_info: can't change directory to '/var/db/pkg/.mkversion'!

The following patch fixes this problem.  A better patch might be to
stat the files in the directory and only attempt a chdir on
directories.  I didn't do that as you might want to just have non-
directories return the error and stating all the files would probably
take more time to run in which case the following is fine.

>How-To-Repeat:

pkg_info -aI

>Fix:
	
===================================================================
RCS file: /host/trang.nuxi.com/FBSD/CVS-repository/src/usr.sbin/pkg_install/info/perform.c,v
retrieving revision 1.26
diff -u -r1.26 perform.c
--- perform.c	1998/12/16 13:59:31	1.26
+++ perform.c	1999/04/08 04:46:06
@@ -134,7 +134,7 @@
 	    warnx("can't find package `%s' installed or in a file!", pkg);
 	    return 1;
 	}
-	if (chdir(log_dir) == FAIL) {
+	if (chdir(log_dir) == FAIL && strcmp(pkg, ".mkversion")) {
 	    warnx("can't change directory to '%s'!", log_dir);
 	    return 1;
 	}


>Release-Note:
>Audit-Trail:

From: Jacques Vidrine <n@nectar.com>
To: mharo@area51.fremont.ca.us
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/11016: Patch: pkg_info tries to cd to .mkversion 
Date: Thu, 08 Apr 1999 10:42:29 -0500

 On 7 April 1999 at 21:52, mharo@area51.fremont.ca.us wrote:
 > When I run "pkg_info -aI", I get the following error:
 >    pkg_info: can't change directory to '/var/db/pkg/.mkversion'!
 
 The location of the ``.mkversion'' is being moved out of /var/db/pkg
 shortly.  When the change has been committed, this report can be
 closed.
 
 Jacques Vidrine / n@nectar.com / nectar@FreeBSD.org
 
 
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Thu Apr 29 23:13:15 PDT 1999 
State-Changed-Why:  
.mkversion has been moved to /var/db/. 
>Unformatted:
