summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-03-11 18:01:35 +0000
committerjoerg <joerg@pkgsrc.org>2008-03-11 18:01:35 +0000
commit2274b33c197709448a20206d81a172e6b043863c (patch)
treea3d2a9debbe2ff1841b75d0589485dd69828740a /pkgtools
parent5d38e8a96a87b2a92b43129332f9cfc1ca260b0b (diff)
downloadpkgsrc-2274b33c197709448a20206d81a172e6b043863c.tar.gz
pkg_install-20080311:
If the package db directory doesn't exist, handle it like an empty pkgdb and just return.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/lib/iterate.c8
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
2 files changed, 9 insertions, 3 deletions
diff --git a/pkgtools/pkg_install/files/lib/iterate.c b/pkgtools/pkg_install/files/lib/iterate.c
index 92b6736dfe8..36ddc996789 100644
--- a/pkgtools/pkg_install/files/lib/iterate.c
+++ b/pkgtools/pkg_install/files/lib/iterate.c
@@ -36,6 +36,9 @@
#if HAVE_ERR_H
#include <err.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#include "lib.h"
@@ -153,8 +156,11 @@ iterate_pkg_db(int (*matchiter)(const char *, void *), void *cookie)
DIR *dirp;
int retval;
- if ((dirp = opendir(_pkgdb_getPKGDB_DIR())) == NULL)
+ if ((dirp = opendir(_pkgdb_getPKGDB_DIR())) == NULL) {
+ if (errno == ENOENT)
+ return 0; /* No pkgdb directory == empty pkgdb */
return -1;
+ }
retval = iterate_pkg_generic_src(matchiter, cookie, pkg_db_iter, dirp);
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index 86b170c1c25..a2eb86a657b 100644
--- a/pkgtools/pkg_install/files/lib/version.h
+++ b/pkgtools/pkg_install/files/lib/version.h
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.95 2008/03/09 18:03:46 joerg Exp $ */
+/* $NetBSD: version.h,v 1.96 2008/03/11 18:01:35 joerg Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@@ -33,6 +33,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
-#define PKGTOOLS_VERSION "20080309"
+#define PKGTOOLS_VERSION "20080311"
#endif /* _INST_LIB_VERSION_H_ */