Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/88a79ae216b6
branches:  netbsd-1-6
changeset: 529541:88a79ae216b6
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Nov 24 22:37:47 2002 +0000

description:
Pull up revision 1.38 (requested by jschauma in ticket #1011):
Do not abort incomplete deletion if the cwd was removed.  Instead, warn,
stay in no-longer existing dir and continue with removal of db-files;
otherwise, the packages contents would be removed, but the package not
uninstalled.  Pointed out by Grant in PR pkg/18384.  OK'd by hubertf.

diffstat:

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

diffs (33 lines):

diff -r 7c7b9290a2ef -r 88a79ae216b6 usr.sbin/pkg_install/delete/perform.c
--- a/usr.sbin/pkg_install/delete/perform.c     Sun Nov 24 22:37:39 2002 +0000
+++ b/usr.sbin/pkg_install/delete/perform.c     Sun Nov 24 22:37:47 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.34.2.2 2002/11/24 22:34:21 tron Exp $    */
+/*     $NetBSD: perform.c,v 1.34.2.3 2002/11/24 22:37:47 tron 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.34.2.2 2002/11/24 22:34:21 tron Exp $");
+__RCSID("$NetBSD: perform.c,v 1.34.2.3 2002/11/24 22:37:47 tron Exp $");
 #endif
 #endif
 
@@ -647,11 +647,10 @@
                        }
                }
        }
-       /* Change out of LogDir before we remove it */
-       if (chdir(home) == FAIL) {
-               cleanup(0);
-               errx(2, "Toto! This doesn't look like Kansas anymore!");
-       }
+       /* Change out of LogDir before we remove it.
+        * Do not fail here, as the package is not yet completely deleted! */
+       if (chdir(home) == FAIL)
+               warnx("Oops - removed current working directory.  Oh, well.");
        if (!Fake) {
                /* Finally nuke the +-files and the pkgdb-dir (/var/db/pkg/foo) */
                if (vsystem("%s -r %s", REMOVE_CMD, LogDir)) {



Home | Main Index | Thread Index | Old Index