diff options
Diffstat (limited to 'pkgtools/pkg_install/files/lib/pkgdb.c')
-rw-r--r-- | pkgtools/pkg_install/files/lib/pkgdb.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/pkgtools/pkg_install/files/lib/pkgdb.c b/pkgtools/pkg_install/files/lib/pkgdb.c index 2d48d344c75..ae88f0465e4 100644 --- a/pkgtools/pkg_install/files/lib/pkgdb.c +++ b/pkgtools/pkg_install/files/lib/pkgdb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pkgdb.c,v 1.22 2004/12/29 12:16:56 agc Exp $ */ +/* $NetBSD: pkgdb.c,v 1.23 2005/02/04 09:10:13 jlam Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -8,7 +8,7 @@ #include <sys/cdefs.h> #endif #ifndef lint -__RCSID("$NetBSD: pkgdb.c,v 1.22 2004/12/29 12:16:56 agc Exp $"); +__RCSID("$NetBSD: pkgdb.c,v 1.23 2005/02/04 09:10:13 jlam Exp $"); #endif /* @@ -61,6 +61,9 @@ __RCSID("$NetBSD: pkgdb.c,v 1.22 2004/12/29 12:16:56 agc Exp $"); #if HAVE_STDIO_H #include <stdio.h> #endif +#if HAVE_STRING_H +#include <string.h> +#endif #include "lib.h" @@ -275,6 +278,22 @@ int pkgdb_remove_pkg(const char *pkg) { return 1; } #endif /* HAVE_DBOPEN */ /* + * Return the location of the package reference counts database directory. + */ +char * +pkgdb_refcount_dir(void) +{ + static char buf[MaxPathSize]; + char *tmp; + + if (tmp = getenv(PKG_REFCOUNT_DBDIR_VNAME)) + strlcpy(buf, tmp, sizeof(buf)); + else + snprintf(buf, sizeof(buf), "%s.refcount", _pkgdb_getPKGDB_DIR()); + return buf; +} + +/* * Return name of cache file in the buffer that was passed. */ char * |