Subject: pkg/7566: pkg_add fails once if /var/db/pkg does not exist.
To: None <gnats-bugs@gnats.netbsd.org>
From: Roland Dowdeswell <elric@arioch.midgard.net>
List: netbsd-bugs
Date: 05/12/1999 12:21:38
>Number:         7566
>Category:       pkg
>Synopsis:       pkg_add fails once if /var/db/pkg does not exist.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 12 12:05:01 1999
>Last-Modified:
>Originator:     
>Organization:
	
>Release:        <NetBSD-current source date>
>Environment:
	
System: NetBSD arioch.midgard.net 1.4 NetBSD 1.4 (ARIOCH) #0: Mon May 10 16:49:16 PDT 1999 elric@arioch.midgard.net:/usr/Portico/NetBSD-1.4/src/sys/arch/i386/compile/ARIOCH i386


>Description:
	The first time I run pkg_add, it fails.
>How-To-Repeat:
	rm -rf /var/db/pkg
	pkg_add foo.tgz
>Fix:

Just looks like the sense of this test is not correct.

--- perform.c.orig      Wed May 12 11:47:22 1999
+++ perform.c   Wed May 12 11:47:40 1999
@@ -97,7 +97,7 @@
 
     /* make sure dbdir actually exists! */
     if (!(isdir(dbdir) || islinktodir(dbdir))) {
-       if (! vsystem("/bin/mkdir -p -m 755 %s", dbdir)) {
+       if (vsystem("/bin/mkdir -p -m 755 %s", dbdir)) {
            errx(1, "Database-dir %s cannot be generated, aborting.",
                 dbdir); 
        }

>Audit-Trail:
>Unformatted: