From owner-freebsd-bugs Wed Apr 7 22: 2: 1 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 3C7F515238 for ; Wed, 7 Apr 1999 22:02:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id WAA13750; Wed, 7 Apr 1999 22:00:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) 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 ; 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 Reply-To: mharo@area51.fremont.ca.us To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/11016: Patch: pkg_info tries to cd to .mkversion Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 11016 >Category: bin >Synopsis: Patch: pkg_info tries to cd to .mkversion >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 7 22:00:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Michael Haro >Release: FreeBSD 3.1-STABLE i386 >Organization: >Environment: >Description: > From: "Stephen J. Roznowski" > 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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message