Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix regression preventing upgrade from running post-install
Baptiste Daroussin committed 12 years ago
commit bee9ffe0ccc33fa7a185eb7c78cae5d9b7293a0a
parent 31273c0
2 files changed +6 -6
modified libpkg/pkg.h.in
@@ -1055,11 +1055,11 @@ int pkgdb_compact(struct pkgdb *db);
 */
int pkg_add(struct pkgdb *db, const char *path, unsigned flags, struct pkg_manifest_key *keys);

-
#define PKG_ADD_UPGRADE			(1U << 0)
-
#define PKG_ADD_USE_UPGRADE_SCRIPTS	(1U << 1)
-
#define PKG_ADD_AUTOMATIC		(1U << 2)
-
#define PKG_ADD_FORCE			(1U << 3)
-
#define PKG_ADD_NOSCRIPT		(1U << 4)
+
#define PKG_ADD_UPGRADE			(1U << 1)
+
#define PKG_ADD_USE_UPGRADE_SCRIPTS	(1U << 2)
+
#define PKG_ADD_AUTOMATIC		(1U << 3)
+
#define PKG_ADD_FORCE			(1U << 4)
+
#define PKG_ADD_NOSCRIPT		(1U << 5)

/**
 * Allocate a new pkg_jobs.
modified libpkg/pkg_add.c
@@ -312,7 +312,7 @@ pkg_add(struct pkgdb *db, const char *path, unsigned flags, struct pkg_manifest_
	 * Execute post install scripts
	 */
	if ((flags & PKG_ADD_NOSCRIPT) == 0) {
-
		if (flags & PKG_ADD_USE_UPGRADE_SCRIPTS)
+
		if ((flags & PKG_ADD_USE_UPGRADE_SCRIPTS) == PKG_ADD_USE_UPGRADE_SCRIPTS)
			pkg_script_run(pkg, PKG_SCRIPT_POST_UPGRADE);
		else
			pkg_script_run(pkg, PKG_SCRIPT_POST_INSTALL);