Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a configuration option to allow not using the unix-dotfile on nfs
Baptiste Daroussin committed 9 years ago
commit 6ed10aa80256b340b4e5c422438c435e7aa70c45
parent 5259e83
3 files changed +13 -1
modified docs/pkg.conf.5
@@ -15,7 +15,7 @@
.\"     @(#)pkg.1
.\" $FreeBSD$
.\"
-
.Dd June 22, 2015
+
.Dd February 02, 2017
.Dt PKG.CONF 5
.Os
.Sh NAME
@@ -182,6 +182,8 @@ When given as a hostname, will be converted to a list of IPv4 or IPv6
addresses by the default mechanisms configured on the system.
See
.Xr getaddrinfo 3 .
+
.It Cm NFS_WITH_PROPER_LOCKING: boolean
+
If set pkg will use its regular locking system instead of a directory lock.
.It Cm PERMISSIVE: boolean
Ignore conflicts while registering a package.
Note that the conflicting files will not be recorded as owned by the new
modified libpkg/pkg_config.c
@@ -412,6 +412,12 @@ static struct config_entry c[] = {
		NULL,
		"Write out the METALOG to the specified file",
	},
+
	{
+
		PKG_BOOL,
+
		"NFS_WITH_PROPER_LOCKING",
+
		"NO",
+
		"Set if running on NFS with properly setup locking system",
+
	},
};

static bool parsed = false;
modified libpkg/pkgdb.c
@@ -1022,9 +1022,13 @@ pkgdb_setup_lock(void)
{
	const char *dbdir = pkg_object_string(pkg_config_get("PKG_DBDIR"));

+
	if (pkg_object_bool(pkg_config_get("NFS_WITH_PROPER_LOCKING")))
+
		return;
+

	/*
	 * Fall back on unix-dotfile locking strategy if on a network filesystem
	 */
+

#if defined(HAVE_SYS_STATVFS_H) && defined(ST_LOCAL)
	struct statvfs stfs;