diff options
author | joerg <joerg@pkgsrc.org> | 2008-02-04 14:03:10 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-02-04 14:03:10 +0000 |
commit | 2166986eddd0d08788173b435535bd52fcfe76fd (patch) | |
tree | b12a2dc6fd9fef98cbeb7e578bd69eaec615fc9a | |
parent | 77c8f54daa877c7d372c4e9ccff8de29b9e2b9c7 (diff) | |
download | pkgsrc-2166986eddd0d08788173b435535bd52fcfe76fd.tar.gz |
pkg_install-20080204:
Try to remove all +* files from the pkgdb first. If the log directory is
not empty afterwards, be noisy, but try rm -rf on it for the force case.
-rw-r--r-- | pkgtools/pkg_install/files/delete/perform.c | 31 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/version.h | 4 |
2 files changed, 19 insertions, 16 deletions
diff --git a/pkgtools/pkg_install/files/delete/perform.c b/pkgtools/pkg_install/files/delete/perform.c index 3eb9f1a882a..729291c8a80 100644 --- a/pkgtools/pkg_install/files/delete/perform.c +++ b/pkgtools/pkg_install/files/delete/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.21 2008/01/26 09:23:31 rillig Exp $ */ +/* $NetBSD: perform.c,v 1.22 2008/02/04 14:03:10 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -11,7 +11,7 @@ #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.21 2008/01/26 09:23:31 rillig Exp $"); +__RCSID("$NetBSD: perform.c,v 1.22 2008/02/04 14:03:10 joerg Exp $"); #endif #endif @@ -839,19 +839,22 @@ pkg_do(char *pkg) warnx("Oops - removed current working directory. Oh, well."); if (!Fake) { /* Finally nuke the +-files and the pkgdb-dir (/var/db/pkg/foo) */ - if (is_depoted_pkg) { - (void) remove_files(LogDir, "+*"); - if (isemptydir(LogDir)) - (void)rmdir(LogDir); - else - warnx("%s is not empty", LogDir); - return 0; - } else { - if (fexec(REMOVE_CMD, "-rf", LogDir, NULL)) { - warnx("couldn't remove log entry in %s, deinstall failed", LogDir); - if (!Force) - return 1; + (void) remove_files(LogDir, "+*"); + if (isemptydir(LogDir)) + (void)rmdir(LogDir); + else if (is_depoted_pkg) + warnx("%s is not empty", LogDir); + else if (Force) { + if (fexec(REMOVE_CMD, "-rf", LogDir, NULL) != 0) { + warnx("couldn't remove log entry in %s", LogDir); + return 1; + } else { + warnx("log entry forcefully removed in %s", LogDir); + return 0; } + } else { + warnx("couldn't remove log entry in %s", LogDir); + return 1; } } return 0; diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h index 68ecc41d3b7..2e76d8b83c6 100644 --- a/pkgtools/pkg_install/files/lib/version.h +++ b/pkgtools/pkg_install/files/lib/version.h @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.89 2008/02/02 16:21:46 joerg Exp $ */ +/* $NetBSD: version.h,v 1.90 2008/02/04 14:03:10 joerg Exp $ */ /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -33,6 +33,6 @@ #ifndef _INST_LIB_VERSION_H_ #define _INST_LIB_VERSION_H_ -#define PKGTOOLS_VERSION "20080202" +#define PKGTOOLS_VERSION "20080204" #endif /* _INST_LIB_VERSION_H_ */ |