summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2011-08-05 07:04:28 +0000
committeragc <agc@pkgsrc.org>2011-08-05 07:04:28 +0000
commit2c27b9f1b5262d34106ca946d86e8c1e443265c9 (patch)
tree25a4970c195f20be9ea86ec5611c0e31f7349c2a /pkgtools
parentef308af89c12dc473fc489ae90f8401e04c0425d (diff)
downloadpkgsrc-2c27b9f1b5262d34106ca946d86e8c1e443265c9.tar.gz
Fix for pkg_delete on NFS from Anthony Mallet.
Problem analysis from Anthony: On Wednesday, at 23:52, Anthony Mallet wrote: > # rm -rf ~tmp && mkdir ~/tmp > # pkg_add -K ~/tmp/var/db/pkg -p ~/tmp /usr/pkgsrc/packages/All/digest-20080510.tgz > # pkg_add -U -K ~/tmp/var/db/pkg -p ~/tmp /usr/pkgsrc/packages/All/digest-20080510.tgz > pkg_delete: Couldn't remove package directory in `/home/tho/tmp/var/db/pkg/digest-20080510' > Also, the dir var/db/pkg/digest-20080510.xxxxxxx is never cleaned. > > The problem apparently is that pkg_delete finds some stalled NFS entries > (.nfs*) in the var/db/pkg/digest-20080510 dir, so it does not delete the > directory. Is this due to pkg_add not correctly closing file descriptors before > exec'ing pkg_delete? For instance, I really don't understand the logic in > check_already_installed() (add/perform.c:375) regarding the open() of +CONTENTS > which is almost never closed (and never used as well...). Shouldn't this be > closed before running pkg_delete? ktrace shows that the +CONTENTS file is open() by pkg_add, I believe this is in check_already_installed(), add/perform.c:381. Then pkg_delete is run and when it comes to deleting the pkgdir entry, it finds that .nfs file and aborts. Bump version to 20110805
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/add/perform.c6
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 89f402427f5..3be2f04f8b0 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.99 2010/12/12 13:18:38 wiz Exp $ */
+/* $NetBSD: perform.c,v 1.100 2011/08/05 07:04:28 agc 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.99 2010/12/12 13:18:38 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.100 2011/08/05 07:04:28 agc Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
@@ -382,6 +382,7 @@ check_already_installed(struct pkg_task *pkg)
free(filename);
if (fd == -1)
return 1;
+ close(fd);
if (ReplaceSame) {
struct stat sb;
@@ -411,7 +412,6 @@ check_already_installed(struct pkg_task *pkg)
warnx("package `%s' already recorded as installed",
pkg->pkgname);
}
- close(fd);
return 0;
}
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index 911be5e16a6..488decacaf7 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.161 2011/02/18 15:59:52 aymeric Exp $ */
+/* $NetBSD: version.h,v 1.162 2011/08/05 07:04:28 agc Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@@ -27,6 +27,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
-#define PKGTOOLS_VERSION 20110215
+#define PKGTOOLS_VERSION 20110805
#endif /* _INST_LIB_VERSION_H_ */