pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files Re-add the checks for HAVE_...
details: https://anonhg.NetBSD.org/pkgsrc/rev/5af901ab6c22
branches: trunk
changeset: 460621:5af901ab6c22
user: jlam <jlam%pkgsrc.org@localhost>
date: Tue Sep 02 01:37:04 2003 +0000
description:
Re-add the checks for HAVE_CHFLAGS and HAVE_DBOPEN so that this can build
on systems that don't have either function.
diffstat:
pkgtools/pkg_install/files/add/extract.c | 8 ++++++--
pkgtools/pkg_install/files/lib/pkgdb.c | 19 +++++++++++++++++--
2 files changed, 23 insertions(+), 4 deletions(-)
diffs (89 lines):
diff -r 98193135f7b0 -r 5af901ab6c22 pkgtools/pkg_install/files/add/extract.c
--- a/pkgtools/pkg_install/files/add/extract.c Tue Sep 02 01:19:47 2003 +0000
+++ b/pkgtools/pkg_install/files/add/extract.c Tue Sep 02 01:37:04 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extract.c,v 1.4 2003/09/01 16:27:11 jlam Exp $ */
+/* $NetBSD: extract.c,v 1.5 2003/09/02 01:37:04 jlam Exp $ */
#include <nbcompat.h>
#if HAVE_CONFIG_H
@@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "FreeBSD - Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp";
#else
-__RCSID("$NetBSD: extract.c,v 1.4 2003/09/01 16:27:11 jlam Exp $");
+__RCSID("$NetBSD: extract.c,v 1.5 2003/09/02 01:37:04 jlam Exp $");
#endif
#endif
@@ -88,7 +88,9 @@
if (q->type == PLIST_FILE) {
(void) snprintf(try, sizeof(try), "%s/%s", dir, q->name);
if (make_preserve_name(bup, sizeof(bup), name, try) && fexists(bup)) {
+#if HAVE_CHFLAGS
(void) chflags(try, 0);
+#endif
(void) unlink(try);
if (rename(bup, try))
warnx("rollback: unable to rename %s back to %s", bup, try);
@@ -181,7 +183,9 @@
/* first try to rename it into place */
(void) snprintf(try, sizeof(try), "%s/%s", Directory, p->name);
if (fexists(try)) {
+#if HAVE_CHFLAGS
(void) chflags(try, 0); /* XXX hack - if truly immutable, rename fails */
+#endif
if (preserve && PkgName) {
char pf[FILENAME_MAX];
diff -r 98193135f7b0 -r 5af901ab6c22 pkgtools/pkg_install/files/lib/pkgdb.c
--- a/pkgtools/pkg_install/files/lib/pkgdb.c Tue Sep 02 01:19:47 2003 +0000
+++ b/pkgtools/pkg_install/files/lib/pkgdb.c Tue Sep 02 01:37:04 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pkgdb.c,v 1.11 2003/09/01 16:27:15 jlam Exp $ */
+/* $NetBSD: pkgdb.c,v 1.12 2003/09/02 01:37:05 jlam Exp $ */
#include <nbcompat.h>
#if HAVE_CONFIG_H
@@ -8,7 +8,7 @@
#include <sys/cdefs.h>
#endif
#ifndef lint
-__RCSID("$NetBSD: pkgdb.c,v 1.11 2003/09/01 16:27:15 jlam Exp $");
+__RCSID("$NetBSD: pkgdb.c,v 1.12 2003/09/02 01:37:05 jlam Exp $");
#endif
/*
@@ -74,10 +74,13 @@
/* just in case we change the environment variable name */
#define PKG_DBDIR "PKG_DBDIR"
+#if HAVE_DBOPEN
static DB *pkgdbp;
+#endif
static char *pkgdb_dir = NULL;
static char pkgdb_cache[FILENAME_MAX];
+#if HAVE_DBOPEN
/*
* Open the pkg-database
* Return value:
@@ -250,6 +253,18 @@
return ret;
}
+#else /* if !HAVE_DBOPEN */
+
+int pkgdb_open(int mode) { return -1; }
+void pkgdb_close(void) {}
+int pkgdb_store(const char *key, const char *val) { return EXIT_SUCCESS; }
+char *pkgdb_retrieve(const char *key) { return NULL; }
+void pkgdb_dump(void) {}
+int pkgdb_remove(const char *key) { return EXIT_SUCCESS; }
+int pkgdb_remove_pkg(const char *pkg) { return EXIT_SUCCESS; }
+
+#endif /* HAVE_DBOPEN */
+
/*
* Return name of cache file in the buffer that was passed.
*/
Home |
Main Index |
Thread Index |
Old Index