Thu Oct 8 16:16:12 2009 UTC ()
pkg_install-20091008:
- Fix German accent
- Don't dereference a null pointer for pkg_admin add


(joerg)
diff -r1.56 -r1.57 pkgsrc/pkgtools/pkg_install/files/admin/main.c
diff -r1.138 -r1.139 pkgsrc/pkgtools/pkg_install/files/lib/version.h

cvs diff -r1.56 -r1.57 pkgsrc/pkgtools/pkg_install/files/admin/main.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/admin/main.c 2009/10/07 12:53:26 1.56
+++ pkgsrc/pkgtools/pkg_install/files/admin/main.c 2009/10/08 16:16:12 1.57
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1/* $NetBSD: main.c,v 1.56 2009/10/07 12:53:26 joerg Exp $ */ 1/* $NetBSD: main.c,v 1.57 2009/10/08 16:16:12 joerg Exp $ */
2 2
3#if HAVE_CONFIG_H 3#if HAVE_CONFIG_H
4#include "config.h" 4#include "config.h"
5#endif 5#endif
6#include <nbcompat.h> 6#include <nbcompat.h>
7#if HAVE_SYS_CDEFS_H 7#if HAVE_SYS_CDEFS_H
8#include <sys/cdefs.h> 8#include <sys/cdefs.h>
9#endif 9#endif
10__RCSID("$NetBSD: main.c,v 1.56 2009/10/07 12:53:26 joerg Exp $"); 10__RCSID("$NetBSD: main.c,v 1.57 2009/10/08 16:16:12 joerg Exp $");
11 11
12/*- 12/*-
13 * Copyright (c) 1999-2009 The NetBSD Foundation, Inc. 13 * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
14 * All rights reserved. 14 * All rights reserved.
15 * 15 *
16 * This code is derived from software contributed to The NetBSD Foundation 16 * This code is derived from software contributed to The NetBSD Foundation
17 * by Hubert Feyrer <hubert@feyrer.de> and 17 * by Hubert Feyrer <hubert@feyrer.de> and
18 * by Joerg Sonnenberger <joerg@NetBSD.org>. 18 * by Joerg Sonnenberger <joerg@NetBSD.org>.
19 * 19 *
20 * Redistribution and use in source and binary forms, with or without 20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions 21 * modification, are permitted provided that the following conditions
22 * are met: 22 * are met:
23 * 1. Redistributions of source code must retain the above copyright 23 * 1. Redistributions of source code must retain the above copyright
@@ -243,27 +243,27 @@ rebuild(void) @@ -243,27 +243,27 @@ rebuild(void)
243 count.files = 0; 243 count.files = 0;
244 count.directories = 0; 244 count.directories = 0;
245 count.packages = 0; 245 count.packages = 0;
246 246
247 (void) _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename)); 247 (void) _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename));
248 if (unlink(cachename) != 0 && errno != ENOENT) 248 if (unlink(cachename) != 0 && errno != ENOENT)
249 err(EXIT_FAILURE, "unlink %s", cachename); 249 err(EXIT_FAILURE, "unlink %s", cachename);
250 250
251 setbuf(stdout, NULL); 251 setbuf(stdout, NULL);
252 252
253 iterate_pkg_db(add_pkg, &count); 253 iterate_pkg_db(add_pkg, &count);
254 254
255 printf("\n"); 255 printf("\n");
256 printf("Stored %zu file%s and %zu explizit director%s" 256 printf("Stored %zu file%s and %zu explicit director%s"
257 " from %zu package%s in %s.\n", 257 " from %zu package%s in %s.\n",
258 count.files, count.files == 1 ? "" : "s", 258 count.files, count.files == 1 ? "" : "s",
259 count.directories, count.directories == 1 ? "y" : "ies", 259 count.directories, count.directories == 1 ? "y" : "ies",
260 count.packages, count.packages == 1 ? "" : "s", 260 count.packages, count.packages == 1 ? "" : "s",
261 cachename); 261 cachename);
262} 262}
263 263
264static int 264static int
265lspattern(const char *pkg, void *vp) 265lspattern(const char *pkg, void *vp)
266{ 266{
267 const char *dir = vp; 267 const char *dir = vp;
268 printf("%s/%s\n", dir, pkg); 268 printf("%s/%s\n", dir, pkg);
269 return 0; 269 return 0;
@@ -507,28 +507,34 @@ main(int argc, char *argv[]) @@ -507,28 +507,34 @@ main(int argc, char *argv[])
507 else 507 else
508 printf("%s/%s\n", dir, p); 508 printf("%s/%s\n", dir, p);
509 free(p); 509 free(p);
510 } 510 }
511  511
512 argv++; 512 argv++;
513 } 513 }
514 } else if (strcasecmp(argv[0], "list") == 0 || 514 } else if (strcasecmp(argv[0], "list") == 0 ||
515 strcasecmp(argv[0], "dump") == 0) { 515 strcasecmp(argv[0], "dump") == 0) {
516 516
517 pkgdb_dump(); 517 pkgdb_dump();
518 518
519 } else if (strcasecmp(argv[0], "add") == 0) { 519 } else if (strcasecmp(argv[0], "add") == 0) {
 520 struct pkgdb_count count;
 521
 522 count.files = 0;
 523 count.directories = 0;
 524 count.packages = 0;
 525
520 for (++argv; *argv != NULL; ++argv) 526 for (++argv; *argv != NULL; ++argv)
521 add_pkg(*argv, NULL); 527 add_pkg(*argv, &count);
522 } else if (strcasecmp(argv[0], "delete") == 0) { 528 } else if (strcasecmp(argv[0], "delete") == 0) {
523 argv++; /* "delete" */ 529 argv++; /* "delete" */
524 while (*argv != NULL) { 530 while (*argv != NULL) {
525 delete1pkg(*argv); 531 delete1pkg(*argv);
526 argv++; 532 argv++;
527 } 533 }
528 } else if (strcasecmp(argv[0], "set") == 0) { 534 } else if (strcasecmp(argv[0], "set") == 0) {
529 argv++; /* "set" */ 535 argv++; /* "set" */
530 set_unset_variable(argv, FALSE); 536 set_unset_variable(argv, FALSE);
531 } else if (strcasecmp(argv[0], "unset") == 0) { 537 } else if (strcasecmp(argv[0], "unset") == 0) {
532 argv++; /* "unset" */ 538 argv++; /* "unset" */
533 set_unset_variable(argv, TRUE); 539 set_unset_variable(argv, TRUE);
534 } else if (strcasecmp(argv[0], "config-var") == 0) { 540 } else if (strcasecmp(argv[0], "config-var") == 0) {

cvs diff -r1.138 -r1.139 pkgsrc/pkgtools/pkg_install/files/lib/version.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/lib/version.h 2009/10/07 12:53:27 1.138
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h 2009/10/08 16:16:12 1.139
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: version.h,v 1.138 2009/10/07 12:53:27 joerg Exp $ */ 1/* $NetBSD: version.h,v 1.139 2009/10/08 16:16:12 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Thomas Klausner. All rights reserved. 4 * Copyright (c) 2001 Thomas Klausner. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -17,16 +17,16 @@ @@ -17,16 +17,16 @@
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#ifndef _INST_LIB_VERSION_H_ 27#ifndef _INST_LIB_VERSION_H_
28#define _INST_LIB_VERSION_H_ 28#define _INST_LIB_VERSION_H_
29 29
30#define PKGTOOLS_VERSION "20091006" 30#define PKGTOOLS_VERSION "20091008"
31 31
32#endif /* _INST_LIB_VERSION_H_ */ 32#endif /* _INST_LIB_VERSION_H_ */