Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/pkg_install/delete Pull up revision 1.18 (requ...



details:   https://anonhg.NetBSD.org/src/rev/4ad5698fa246
branches:  netbsd-1-5
changeset: 492958:4ad5698fa246
user:      he <he%NetBSD.org@localhost>
date:      Wed Mar 20 22:06:18 2002 +0000

description:
Pull up revision 1.18 (requested by hubertf):
  Improve error reporting when a pattern is given but the system
  is freshly installed so the package DB doesn't exist.

diffstat:

 usr.sbin/pkg_install/delete/main.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r a7009d708ff4 -r 4ad5698fa246 usr.sbin/pkg_install/delete/main.c
--- a/usr.sbin/pkg_install/delete/main.c        Wed Mar 20 21:49:08 2002 +0000
+++ b/usr.sbin/pkg_install/delete/main.c        Wed Mar 20 22:06:18 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: main.c,v 1.16.2.1 2001/03/20 18:02:01 he Exp $ */
+/*     $NetBSD: main.c,v 1.16.2.2 2002/03/20 22:06:18 he Exp $ */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp";
 #else
-__RCSID("$NetBSD: main.c,v 1.16.2.1 2001/03/20 18:02:01 he Exp $");
+__RCSID("$NetBSD: main.c,v 1.16.2.2 2002/03/20 22:06:18 he Exp $");
 #endif
 #endif
 
@@ -158,8 +158,12 @@
                                errx(1, "No matching pkg for %s in pkgdb.", *argv);
                } else {
                        if (ispkgpattern(*argv)) {
-                               if (findmatchingname(_pkgdb_getPKGDB_DIR(), *argv, find_fn, NULL) == 0)
+                               int rc;
+                               rc = findmatchingname(_pkgdb_getPKGDB_DIR(), *argv, find_fn, NULL);
+                               if (rc == 0)
                                        errx(1, "No matching pkg for %s.", *argv);
+                               else if (rc == -1) 
+                                       errx(1, "error expanding '%s' ('%s' nonexistant?)\n", *argv, _pkgdb_getPKGDB_DIR());
                        } else {
                                lpp = alloc_lpkg(*argv);
                                TAILQ_INSERT_TAIL(&pkgs, lpp, lp_link);



Home | Main Index | Thread Index | Old Index