summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2013-08-21 11:46:02 +0000
committerjperkin <jperkin@pkgsrc.org>2013-08-21 11:46:02 +0000
commita28c30def7072635dd03692bf87e83b185b3d2f4 (patch)
treeef7eb5a72df1f864a7b36224d7bb86af84ccc387
parent2dc8df142fedaaad05d570489d948f65fe612b6a (diff)
downloadpkgsrc-a28c30def7072635dd03692bf87e83b185b3d2f4.tar.gz
Remove files inside pkgdb directory before trying to remove the directory
itself. Copied from similar code in pkg_delete. This fixes the issue when an +INSTALL script fails but the pkgdb directory couldn't be removed, leading to an inconsistent state.
-rw-r--r--pkgtools/pkg_install/files/add/perform.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 6c792b08c45..fcafb16a5a8 100644
--- a/pkgtools/pkg_install/files/add/perform.c
+++ b/pkgtools/pkg_install/files/add/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.103 2013/01/31 10:25:30 wiz Exp $ */
+/* $NetBSD: perform.c,v 1.104 2013/08/21 11:46:02 jperkin Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -6,7 +6,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: perform.c,v 1.103 2013/01/31 10:25:30 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.104 2013/08/21 11:46:02 jperkin Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
@@ -1559,6 +1559,7 @@ nuke_pkg:
nuke_pkgdb:
if (!Fake) {
+ (void) remove_files(pkg->install_logdir, "+*");
if (recursive_remove(pkg->install_logdir, 1))
warn("Couldn't remove %s", pkg->install_logdir);
free(pkg->install_logdir_real);