summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjschauma <jschauma@pkgsrc.org>2003-01-07 16:10:02 +0000
committerjschauma <jschauma@pkgsrc.org>2003-01-07 16:10:02 +0000
commit37f8100ca0eb8bc3250e1f48e27ee95b72422751 (patch)
treecb0150fe5101d7c84901b279f5b730664f8f7744 /pkgtools
parent9eb59bb721d7c9e48350ce39a5f130ae97167b3e (diff)
downloadpkgsrc-37f8100ca0eb8bc3250e1f48e27ee95b72422751.tar.gz
Unlike pkg_install in src, this version of pkg_install contains
a pkgdb_open that may return one of _three_ values (0,1,-1), so that we can not simply use if (!pkgdb_open(ReadOnly)) but need to use if (pkgdb_open(ReadOnly) == -1) Mea culpa.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/admin/main.c12
-rw-r--r--pkgtools/pkg_install/files/delete/main.c8
-rw-r--r--pkgtools/pkg_install/files/info/perform.c6
3 files changed, 13 insertions, 13 deletions
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c
index 2ff9d2d66f4..a3a6155550e 100644
--- a/pkgtools/pkg_install/files/admin/main.c
+++ b/pkgtools/pkg_install/files/admin/main.c
@@ -1,9 +1,9 @@
-/* $NetBSD: main.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $ */
+/* $NetBSD: main.c,v 1.3 2003/01/07 16:10:02 jschauma Exp $ */
#if 0
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $");
+__RCSID("$NetBSD: main.c,v 1.3 2003/01/07 16:10:02 jschauma Exp $");
#endif
#endif
@@ -192,7 +192,7 @@ rebuild(void)
if (unlink(_pkgdb_getPKGDB_FILE(cachename, sizeof(cachename))) != 0 && errno != ENOENT)
err(EXIT_FAILURE, "unlink %s", cachename);
- if (!pkgdb_open(ReadWrite))
+ if (pkgdb_open(ReadWrite) == -1)
err(EXIT_FAILURE, "cannot open pkgdb");
setbuf(stdout, NULL);
@@ -546,7 +546,7 @@ main(int argc, char *argv[])
printf("Dumping pkgdb %s:\n", _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename)));
- if (!pkgdb_open(ReadOnly)) {
+ if (pkgdb_open(ReadOnly) == -1) {
err(EXIT_FAILURE, "cannot open %s", cachename);
}
while ((key = pkgdb_iter())) {
@@ -563,7 +563,7 @@ main(int argc, char *argv[])
int rc;
- if (!pkgdb_open(ReadWrite))
+ if (pkgdb_open(ReadWrite) == -1)
err(EXIT_FAILURE, "cannot open pkgdb");
rc = pkgdb_remove(argv[2]);
@@ -580,7 +580,7 @@ main(int argc, char *argv[])
int rc;
- if (!pkgdb_open(ReadWrite)) {
+ if (pkgdb_open(ReadWrite) == -1) {
err(EXIT_FAILURE, "cannot open pkgdb");
}
diff --git a/pkgtools/pkg_install/files/delete/main.c b/pkgtools/pkg_install/files/delete/main.c
index ad69dd98d51..0a5774cdc6f 100644
--- a/pkgtools/pkg_install/files/delete/main.c
+++ b/pkgtools/pkg_install/files/delete/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $ */
+/* $NetBSD: main.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $ */
#if 0
#include <sys/cdefs.h>
@@ -6,7 +6,7 @@
#if 0
static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp";
#else
-__RCSID("$NetBSD: main.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $");
+__RCSID("$NetBSD: main.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $");
#endif
#endif
#endif
@@ -133,7 +133,7 @@ main(int argc, char **argv)
/* Get all the remaining package names, if any */
if (File2Pkg)
- if (!pkgdb_open(ReadOnly)) {
+ if (pkgdb_open(ReadOnly) == -1) {
err(EXIT_FAILURE, "cannot open pkgdb");
}
/* Get all the remaining package names, if any */
@@ -182,7 +182,7 @@ main(int argc, char **argv)
char *key, *val;
char cachename[FILENAME_MAX];
- if (!pkgdb_open(ReadWrite)) {
+ if (pkgdb_open(ReadWrite) == -1) {
err(EXIT_FAILURE, "cannot open %s", _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename)));
}
diff --git a/pkgtools/pkg_install/files/info/perform.c b/pkgtools/pkg_install/files/info/perform.c
index 61fed767765..caa0ea77f30 100644
--- a/pkgtools/pkg_install/files/info/perform.c
+++ b/pkgtools/pkg_install/files/info/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $ */
+/* $NetBSD: perform.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $ */
#if 0
#include <sys/cdefs.h>
@@ -6,7 +6,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp";
#else
-__RCSID("$NetBSD: perform.c,v 1.2 2003/01/06 04:34:16 jschauma Exp $");
+__RCSID("$NetBSD: perform.c,v 1.3 2003/01/07 16:10:03 jschauma Exp $");
#endif
#endif
#endif
@@ -338,7 +338,7 @@ pkg_perform(lpkg_head_t *pkghead)
char *file, *pkg;
/* pkg_info -Fa => Dump pkgdb */
- if (!pkgdb_open(ReadOnly)) {
+ if (pkgdb_open(ReadOnly) == -1) {
err(EXIT_FAILURE, "cannot open pkgdb");
}
while ((file = pkgdb_iter())) {