summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg>2008-08-25 18:43:04 +0000
committerjoerg <joerg>2008-08-25 18:43:04 +0000
commit606ecbaab3bbc30367a2abe95d42fe29aaa22a09 (patch)
tree04f8e3cf4d3a58da816aee41dfbcd4598f86ce6a
parent7bcba961c3ce980df6945c1cb3c987b1eee1d49f (diff)
downloadpkgsrc-606ecbaab3bbc30367a2abe95d42fe29aaa22a09.tar.gz
If the file removal fails for e.g. due to checksum mismatch, still
update the pkgdb. This restores the expectation of installing a package over it working fine.
-rw-r--r--pkgtools/pkg_install/files/lib/plist.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c
index a5734c3f411..4437630fedb 100644
--- a/pkgtools/pkg_install/files/lib/plist.c
+++ b/pkgtools/pkg_install/files/lib/plist.c
@@ -1,4 +1,4 @@
-/* $NetBSD: plist.c,v 1.17.4.11 2008/08/25 18:31:14 joerg Exp $ */
+/* $NetBSD: plist.c,v 1.17.4.12 2008/08/25 18:43:04 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: plist.c,v 1.24 1997/10/08 07:48:15 charnier Exp";
#else
-__RCSID("$NetBSD: plist.c,v 1.17.4.11 2008/08/25 18:31:14 joerg Exp $");
+__RCSID("$NetBSD: plist.c,v 1.17.4.12 2008/08/25 18:43:04 joerg Exp $");
#endif
#endif
@@ -574,7 +574,7 @@ delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg,
Force ? "deleting anyway" : "not deleting", tmp);
if (!Force) {
fail = FAIL;
- continue;
+ goto pkgdb_cleanup;
}
}
}
@@ -587,7 +587,7 @@ delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg,
if ((cc = readlink(tmp, &buf[SymlinkHeaderLen],
sizeof(buf) - SymlinkHeaderLen - 1)) < 0) {
warn("can't readlink `%s'", tmp);
- continue;
+ goto pkgdb_cleanup;
}
buf[SymlinkHeaderLen + cc] = 0x0;
if (strcmp(buf, p->next->name) != 0) {
@@ -597,7 +597,7 @@ delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg,
buf, Force ? "deleting anyway" : "not deleting", tmp);
if (!Force) {
fail = FAIL;
- continue;
+ goto pkgdb_cleanup;
}
}
buf[SymlinkHeaderLen + cc] = 0x0;
@@ -606,7 +606,7 @@ delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg,
buf, Force ? "deleting anyway" : "not deleting", tmp);
if (!Force) {
fail = FAIL;
- continue;
+ goto pkgdb_cleanup;
}
}
}
@@ -632,6 +632,7 @@ delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg,
}
}
+pkgdb_cleanup:
if (!Fake) {
if (!restored) {
errno = 0;