summaryrefslogtreecommitdiff
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
commitc3a1c7459f1abd59273810c494d4532cbe286b67 (patch)
treea3d2a9debbe2ff1841b75d0589485dd69828740a
parentc8dd8228367a152527a7e3332637a0795079a112 (diff)
downloadpkgsrc-c3a1c7459f1abd59273810c494d4532cbe286b67.tar.gz
pkg_install-20080311:
If the package db directory doesn't exist, handle it like an empty pkgdb and just return.
-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_ */