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 Pullup rev 1.39-1.40 (reque...



details:   https://anonhg.NetBSD.org/src/rev/494c69fa72af
branches:  netbsd-1-6
changeset: 530080:494c69fa72af
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sat Feb 08 07:49:56 2003 +0000

description:
Pullup rev 1.39-1.40 (requested by abs in ticket #1141)
 Catchup to -current as of version 20030202.

diffstat:

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

diffs (56 lines):

diff -r 98f5d6d86ffb -r 494c69fa72af usr.sbin/pkg_install/delete/perform.c
--- a/usr.sbin/pkg_install/delete/perform.c     Sat Feb 08 07:49:39 2003 +0000
+++ b/usr.sbin/pkg_install/delete/perform.c     Sat Feb 08 07:49:56 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.34.2.3 2002/11/24 22:37:47 tron Exp $    */
+/*     $NetBSD: perform.c,v 1.34.2.4 2003/02/08 07:49:56 jmc 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.3 2002/11/24 22:37:47 tron Exp $");
+__RCSID("$NetBSD: perform.c,v 1.34.2.4 2003/02/08 07:49:56 jmc Exp $");
 #endif
 #endif
 
@@ -180,7 +180,7 @@
        /* save cwd */
        oldcwd = open(".", O_RDONLY, 0);
        if (oldcwd == -1)
-               err(1, "cannot open \".\"");
+               err(EXIT_FAILURE, "cannot open \".\"");
 
        (void) snprintf(pkgdir, sizeof(pkgdir), "%s",
            (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR);
@@ -548,6 +548,12 @@
                warnx("unable to change directory to %s! deinstall failed", LogDir);
                return 1;
        }
+       if (fexists(PRESERVE_FNAME)) {
+               printf("Package `%s' is marked as not for deletion\n", pkg);
+               if (!Force) {
+                       return 1;
+               }
+       }
        if (!isemptyfile(REQUIRED_BY_FNAME)) {
                /* This package is required by others. Either nuke
                 * them (-r), or stop. */
@@ -672,14 +678,14 @@
        /* save cwd */
        oldcwd = open(".", O_RDONLY, 0);
        if (oldcwd == -1)
-               err(1, "cannot open \".\"");
+               err(EXIT_FAILURE, "cannot open \".\"");
 
        while ((lpp = TAILQ_FIRST(pkghead))) {
                err_cnt += pkg_do(lpp->lp_name);
                TAILQ_REMOVE(pkghead, lpp, lp_link);
                free_lpkg(lpp);
                if (fchdir(oldcwd) == FAIL)
-                       err(1, "unable to change to previous directory");
+                       err(EXIT_FAILURE, "unable to change to previous directory");
        }
        close(oldcwd);
        return err_cnt;



Home | Main Index | Thread Index | Old Index