Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
plist: remove PLIST_ACCEPT_DIRECTORIES
Baptiste Daroussin committed 4 years ago
commit 6192cd479f18a68c9f2cd64eaec469e8197149bc
parent 12ff4b0
4 files changed +10 -32
modified docs/pkg.conf.5
@@ -15,7 +15,7 @@
.\"     @(#)pkg.1
.\" $FreeBSD$
.\"
-
.Dd March 7, 2022
+
.Dd April 26, 2022
.Dt PKG.CONF 5
.Os
.Sh NAME
@@ -281,9 +281,6 @@ Default: not set.
.It Cm PLIST_KEYWORDS_DIR: string
Directory containing definitions of plist keywords.
Default: PORTSDIR/keyword.
-
.It Cm PLIST_ACCEPT_DIRECTORIES: boolean
-
Accept directories listed like plain files in plist.
-
Default: NO.
.It Cm PLUGINS: array
List of plugins that
.Xr pkg 8
modified libpkg/pkg_config.c
@@ -347,12 +347,6 @@ static struct config_entry c[] = {
		"Use read locking for query database"
	},
	{
-
		PKG_BOOL,
-
		"PLIST_ACCEPT_DIRECTORIES",
-
		"NO",
-
		"Accept directories listed like plain files in plist"
-
	},
-
	{
		PKG_INT,
		"IP_VERSION",
		"0",
modified libpkg/pkg_ports.c
@@ -368,34 +368,22 @@ meta_file(struct plist *p, char *line, struct file_attr *a, bool is_config)
		}
	}

-
	if (S_ISDIR(st.st_mode) &&
-
	    !pkg_object_bool(pkg_config_get("PLIST_ACCEPT_DIRECTORIES"))) {
+
	if (S_ISDIR(st.st_mode)) {
		pkg_emit_error("Plist error, directory listed as a file: %s",
		    line);
		free(buf);
		return (EPKG_FATAL);
	}

-
	if (S_ISDIR(st.st_mode)) {
-
		if (a != NULL)
-
			ret = pkg_adddir_attr(p->pkg, path,
-
			    a->owner ? a->owner : p->uname,
-
			    a->group ? a->group : p->gname,
-
			    a->mode ? a->mode : p->perm,
-
			    true, true);
-
		else
-
			ret = pkg_adddir_attr(p->pkg, path, p->uname, p->gname,
-
			    p->perm, true, true);
+
	if (a != NULL) {
+
		ret = pkg_addfile_attr(p->pkg, path, buf,
+
		    a->owner ? a->owner : p->uname,
+
		    a->group ? a->group : p->gname,
+
		    a->mode ? a->mode : p->perm,
+
		    a->fflags, true);
	} else {
-
		if (a != NULL)
-
			ret = pkg_addfile_attr(p->pkg, path, buf,
-
			    a->owner ? a->owner : p->uname,
-
			    a->group ? a->group : p->gname,
-
			    a->mode ? a->mode : p->perm,
-
			    a->fflags, true);
-
		else
-
			ret = pkg_addfile_attr(p->pkg, path, buf, p->uname,
-
			    p->gname, p->perm, 0, true);
+
		ret = pkg_addfile_attr(p->pkg, path, buf, p->uname,
+
		    p->gname, p->perm, 0, true);
	}

	free(buf);
modified scripts/completion/_pkg.in
@@ -145,7 +145,6 @@ _pkg_config_opts() {
		'PKG_PLUGINS_DIR[specify directory for plugins]:directory:_files -/' \
		'PKG_SSH_ARGS[extra arguments for ssh(1)]:ssh(1) arguments' \
		'PLIST_KEYWORDS_DIR[directory containing definitions of plist keywords]:directory:_files -/' \
-
		'PLIST_ACCEPT_DIRECTORIES[accept directories listed like plain files in plist]:boolean:(yes no)' \
		'PLUGINS[list of plugins pkg(8) should load]:plugins' \
		'PLUGINS_CONF_DIR[directory containing per-plugin configurations files]:directory:_files -/' \
		'PORTSDIR[specify location of ports directory]:directory:_files -/' \