Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/pkg_install/delete In require_delete(), actually us...



details:   https://anonhg.NetBSD.org/src/rev/c9517cc204d0
branches:  trunk
changeset: 485836:c9517cc204d0
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Sun May 07 00:33:28 2000 +0000

description:
In require_delete(), actually use the expanded wildcard passed in via
@pkgdep.

Fixes PR 10056 by Dan McMahill <mcmahill%mtl.mit.edu@localhost>

diffstat:

 usr.sbin/pkg_install/delete/perform.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r a0cf061513d6 -r c9517cc204d0 usr.sbin/pkg_install/delete/perform.c
--- a/usr.sbin/pkg_install/delete/perform.c     Sun May 07 00:31:42 2000 +0000
+++ b/usr.sbin/pkg_install/delete/perform.c     Sun May 07 00:33:28 2000 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.30 2000/01/19 23:28:30 hubertf Exp $     */
+/*     $NetBSD: perform.c,v 1.31 2000/05/07 00:33:28 hubertf Exp $     */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.30 2000/01/19 23:28:30 hubertf Exp $");
+__RCSID("$NetBSD: perform.c,v 1.31 2000/05/07 00:33:28 hubertf Exp $");
 #endif
 #endif
 
@@ -199,6 +199,9 @@
        fail = 0;
        lpp = TAILQ_FIRST(&lpdelq);
        for (; lpp; lpp = TAILQ_NEXT(lpp, lp_link)) {
+               int rm_installed;                /* delete expanded pkg, not @pkgdep value */
+               char installed[FILENAME_MAX];
+               
                /* go to the db dir */
                if (chdir(pkgdir) == FAIL) {
                        warnx("unable to change directory to %s, deinstall failed (1)",
@@ -208,12 +211,13 @@
                }
 
                /* look to see if package was already deleted */
+               rm_installed = 0;
                if (ispkgpattern(lpp->lp_name)) {
-                       char installed[FILENAME_MAX];
                        if (findmatchingname(".", lpp->lp_name, note_whats_installed, installed) != 1) {
                                warnx("%s appears to have been deleted", lpp->lp_name);
                                continue;
                        }
+                       rm_installed = 1;
                } else {
                        if (!fexists(lpp->lp_name)) {
                                warnx("%s appears to have been deleted", lpp->lp_name);
@@ -229,7 +233,7 @@
                }
 
                if (Verbose)
-                       printf("deinstalling %s\n", lpp->lp_name);
+                       printf("deinstalling %s\n", rm_installed?installed:lpp->lp_name);
 
                /* delete the package */
                if (Fake)
@@ -243,12 +247,12 @@
                            NoDeInstall ? "-D" : "",
                            CleanDirs ? "-d" : "",
                            Fake ? "-n" : "",
-                           lpp->lp_name);
+                           rm_installed?installed:lpp->lp_name);
 
                /* check for delete failure */
                if (rv && !tryall) {
                        fail = 1;
-                       warnx("had problem removing %s%s", lpp->lp_name,
+                       warnx("had problem removing %s%s", rm_installed?installed:lpp->lp_name,
                            Force ? ", continuing" : "");
                        if (!Force)
                                break;



Home | Main Index | Thread Index | Old Index