summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2015-01-02 14:26:16 +0000
committerwiz <wiz@pkgsrc.org>2015-01-02 14:26:16 +0000
commit2adc5145e1193565b2da4acf17f0aa5e23901b76 (patch)
tree4a1318dc3bac451371520d754bc787633b1449b8 /pkgtools/pkg_install
parent58ac3701757bb510f538caf988c30708616d3029 (diff)
downloadpkgsrc-2adc5145e1193565b2da4acf17f0aa5e23901b76.tar.gz
Restore pkg_admin 'add' command; it's still used by bootstrap in one place.
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r--pkgtools/pkg_install/files/admin/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c
index c7599b1e687..82017938368 100644
--- a/pkgtools/pkg_install/files/admin/main.c
+++ b/pkgtools/pkg_install/files/admin/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.63 2014/12/30 15:13:20 wiz Exp $ */
+/* $NetBSD: main.c,v 1.64 2015/01/02 14:26:16 wiz Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: main.c,v 1.63 2014/12/30 15:13:20 wiz Exp $");
+__RCSID("$NetBSD: main.c,v 1.64 2015/01/02 14:26:16 wiz Exp $");
/*-
* Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -103,6 +103,7 @@ usage(void)
" rebuild - rebuild pkgdb from +CONTENTS files\n"
" rebuild-tree - rebuild +REQUIRED_BY files from forward deps\n"
" check [pkg ...] - check md5 checksum of installed files\n"
+ " add pkg ... - add pkg files to database\n"
" set variable=value pkg ... - set installation variable for package\n"
" unset variable pkg ... - unset installation variable for package\n"
" lsall /path/to/pkgpattern - list all pkgs matching the pattern\n"
@@ -505,6 +506,15 @@ main(int argc, char *argv[])
pkgdb_dump();
+ } else if (strcasecmp(argv[0], "add") == 0) {
+ struct pkgdb_count count;
+
+ count.files = 0;
+ count.directories = 0;
+ count.packages = 0;
+
+ for (++argv; *argv != NULL; ++argv)
+ add_pkg(*argv, &count);
} else if (strcasecmp(argv[0], "set") == 0) {
argv++; /* "set" */
set_unset_variable(argv, FALSE);