Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Clenaup hash variables
Baptiste Daroussin committed 5 years ago
commit d2e92f8469dd75290865c8f1546bf5960ce69083
parent 8c7d128
5 files changed +13 -34
modified docs/pkg-repo.8
@@ -14,7 +14,7 @@
.\"
.\"     @(#)pkg.8
.\"
-
.Dd April 11, 2017
+
.Dd November 5, 2020
.Dt PKG-REPO 8
.Os
.Sh NAME
@@ -195,6 +195,15 @@ Force quiet output.
.Sh FILES
See
.Xr pkg.conf 5 .
+
.Sh ENVIRONMENT
+
.Bl -tag -width "PKG_REPO_SYMLINK"
+
.It Ev PKG_REPO_HASH
+
When set, rename packages with the short hash of contents appended to the
+
filename.
+
.It Ev PKG_REPO_SYMLINK
+
When set, create a symlink between the short hash filename and the regular
+
filename.
+
.El
.Sh SEE ALSO
.Xr pkg_printf 3 ,
.Xr pkg_repos 3 ,
modified docs/pkg.conf.5
@@ -15,7 +15,7 @@
.\"     @(#)pkg.1
.\" $FreeBSD$
.\"
-
.Dd February 25, 2020
+
.Dd November 5, 2020
.Dt PKG.CONF 5
.Os
.Sh NAME
@@ -237,22 +237,6 @@ Directory which
will load plugins from.
Default:
.Pa /usr/local/lib/pkg
-
.It Cm PKG_REPO_HASH: boolean
-
When set to a
-
.Sy true
-
value, make
-
.Xr pkg-repo 8
-
rename packages with the short hash of contents appended to the filename.
-
Default:
-
.Sy false
-
.It Cm PKG_REPO_SYMLINK: boolean
-
When set to a
-
.Sy true
-
value, make
-
.Xr pkg-repo 8
-
create a symlink between the short hash filename and the regular filename.
-
Default:
-
.Sy false
.It Cm PKG_SSH_ARGS: string
Extra arguments to pass to
.Xr ssh 1 .
modified libpkg/pkg_config.c
@@ -382,18 +382,6 @@ static struct config_entry c[] = {
	},
	{
		PKG_BOOL,
-
		"PKG_REPO_HASH",
-
		"NO",
-
		"Rename packages with the short hash of their contents",
-
	},
-
	{
-
		PKG_BOOL,
-
		"PKG_REPO_SYMLINK",
-
		"NO",
-
		"Create symlinks from the hashed filename to the regular filename",
-
	},
-
	{
-
		PKG_BOOL,
		"AUTOCLEAN",
		"NO",
		"Always cleanup the cache directory after install/upgrade",
modified scripts/completion/_pkg.in
@@ -143,8 +143,6 @@ _pkg_config_opts() {
		'PKG_ENABLE_PLUGINS[activate plugin support]:boolean:(yes no)' \
		'PKG_ENV[key/value pair of environment variables]:key/value list' \
		'PKG_PLUGINS_DIR[specify directory for plugins]:directory:_files -/' \
-
		'PKG_REPO_HASH[make pkg_repo(8) rename files using a short hash]:boolean:(yes no)' \
-
		'PKG_REPO_SYMLINK[make pkg_repo(8) symlink the hashed filename to the regular filename]:boolean:(yes no)' \
		'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)' \
modified src/repo.c
@@ -98,8 +98,8 @@ exec_repo(int argc, char **argv)
	bool	 hash = false;
	bool	 hash_symlink = false;

-
	hash = pkg_object_bool(pkg_config_get("PKG_REPO_HASH"));
-
	hash_symlink = pkg_object_bool(pkg_config_get("PKG_REPO_SYMLINK"));
+
	hash = (getenv("PKG_REPO_HASH") != NULL);
+
	hash_symlink = (getenv("PKG_REPO_SYMLINK") != NULL);

	struct option longopts[] = {
		{ "hash",	no_argument,		NULL,	'h' },