Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
jobs: allow user to not reinstall on option change
Baptiste Daroussin committed 1 year ago
commit c3d0c24810b7cc7d7b6fa07285714a8177d66839
parent b9437a8
3 files changed +13 -1
modified docs/pkg.conf.5
@@ -15,7 +15,7 @@
.\"     @(#)pkg.1
.\" $FreeBSD$
.\"
-
.Dd November 24, 2023
+
.Dd July 02, 2024
.Dt PKG.CONF 5
.Os
.Sh NAME
@@ -375,6 +375,10 @@ If set to 0,
.Va hw.ncpu
is used.
Default: 0.
+
.It Cm PKG_REINSTALL_ON_OPTIONS_CHANGE
+
Reinstall packages if options changed between the local version and the
+
remote version.
+
Default: true
.El
.Sh REPOSITORY CONFIGURATION
To use a repository you will need at least one repository
modified libpkg/pkg_config.c
@@ -521,6 +521,12 @@ static struct config_entry c[] = {
		"COMPRESSION_THREADS",
		"-1",
		"Set the default number of threads used for compression",
+
	},
+
	{
+
		PKG_BOOL,
+
		"PKG_REINSTALL_ON_OPTIONS_CHANGE",
+
		"TRUE",
+
		"Decide if packages gets reinstalled when local options does not match remote one",
	}
};

modified libpkg/pkg_jobs.c
@@ -1175,6 +1175,8 @@ pkg_jobs_need_upgrade(struct pkg *rp, struct pkg *lp)

	/* compare options */
	for (;;) {
+
		if (!pkg_object_bool(pkg_config_get("PKG_REINSTALL_ON_OPTIONS_CHANGE")))
+
			break;
		ret1 = pkg_options(rp, &ro);
		ret2 = pkg_options(lp, &lo);
		if (ret1 != ret2) {