diff options
author | jschauma <jschauma> | 2003-03-16 19:44:09 +0000 |
---|---|---|
committer | jschauma <jschauma> | 2003-03-16 19:44:09 +0000 |
commit | c0a6cffa6482cc928a3634ac8fe8997508c8c779 (patch) | |
tree | a4241dec65f768adb89e77723cc2d31dafcff38e /pkgtools/pkg_install/files/admin | |
parent | 0d3eb3aaaacbec1749bbd2f150dd1e2130e9384c (diff) | |
download | pkgsrc-c0a6cffa6482cc928a3634ac8fe8997508c8c779.tar.gz |
Sync with main sources:
Date: Sat Mar 15 20:49:27 UTC 2003
Introduce a pkgdb_dump() function, which dumps the cache file of
(filename, package) pairs.
Modify calling functions to use pkgdb_dump() directly, rather than
sequences of
pkgdb_open
{ pkgdb_iter, pkgdb_retrieve }
pkgdb_close
calls.
Remove the now unnecessary pkgdb_iter function.
Date: Sat Mar 15 20:50:15 UTC 2003
Bump version string for pkgdb_dump changes.
Date: Sat Mar 15 20:54:26 UTC 2003
Catch one more place that could result in Current not being set properly
(and thus in the execution of "rm -fr /") if ^C is pressed at the wrong time.
See also PR 19436.
Diffstat (limited to 'pkgtools/pkg_install/files/admin')
-rw-r--r-- | pkgtools/pkg_install/files/admin/main.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c index f006ecf6cef..e64b29bb626 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.5 2003/01/14 15:18:33 jschauma Exp $ */ +/* $NetBSD: main.c,v 1.6 2003/03/16 19:44:09 jschauma Exp $ */ #if 0 #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: main.c,v 1.5 2003/01/14 15:18:33 jschauma Exp $"); +__RCSID("$NetBSD: main.c,v 1.6 2003/03/16 19:44:09 jschauma Exp $"); #endif #endif @@ -539,23 +539,7 @@ main(int argc, char *argv[]) } else if (strcasecmp(argv[1], "list") == 0 || strcasecmp(argv[1], "dump") == 0) { - - char *key, *val; - char cachename[FILENAME_MAX]; - - - printf("Dumping pkgdb %s:\n", _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename))); - - if (!pkgdb_open(ReadOnly)) { - err(EXIT_FAILURE, "cannot open %s", cachename); - } - while ((key = pkgdb_iter())) { - val = pkgdb_retrieve(key); - - printf("file: %-50s pkg: %s\n", key, val); - } - pkgdb_close(); - + pkgdb_dump(); } #ifdef PKGDB_DEBUG else if (strcasecmp(argv[1], "del") == 0 || |