Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix handle_rc_script during upgrade
Baptiste Daroussin committed 14 years ago
commit 4ab1bf36e2ee7ef2c70796fa29e69fe0b8e7c04f
parent adf2236
1 file changed +8 -0
modified libpkg/pkg_jobs.c
@@ -162,6 +162,7 @@ pkg_jobs_install(struct pkg_jobs *j)
	struct statfs fs;
	char dlsz[7];
	char fsz[7];
+
	bool handle_rc = false;

	STAILQ_INIT(&pkg_queue);

@@ -242,6 +243,13 @@ pkg_jobs_install(struct pkg_jobs *j)
					STAILQ_INSERT_TAIL(&pkg_queue, pkg, next);
					pkg_script_run(pkg, PKG_SCRIPT_PRE_DEINSTALL);
					pkg_get(pkg, PKG_ORIGIN, &origin);
+
					/*
+
					 * stop the different related services if the users do want that
+
					 * and that the service is running
+
					 */
+
					pkg_config_bool(PKG_CONFIG_HANDLE_RC_SCRIPTS, &handle_rc);
+
					if (handle_rc)
+
						pkg_stop_rc_scripts(pkg);
					pkgdb_unregister_pkg(j->db, origin);
					pkg = NULL;
				}