Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix flags testing
Baptiste Daroussin committed 14 years ago
commit a445d923a66300938f2f714fb770b46acc3a3397
parent 8fffe64
1 file changed +3 -3
modified libpkg/pkg_add.c
@@ -186,7 +186,7 @@ pkg_add(struct pkgdb *db, const char *path, int flags)

	/* register the package before installing it in case there are
	 * problems that could be caught here. */
-
	if (flags ^ PKG_ADD_UPGRADE)
+
	if ((flags & PKG_ADD_UPGRADE) == 0)
		retcode = pkgdb_register_pkg(db, pkg, 0);
	else
		retcode = pkgdb_register_pkg(db, pkg, 1);
@@ -196,7 +196,7 @@ pkg_add(struct pkgdb *db, const char *path, int flags)
	/*
	 * Execute pre-install scripts
	 */
-
	if (flags ^ PKG_ADD_UPGRADE_NEW)
+
	if ((flags & PKG_ADD_UPGRADE_NEW) == 0)
		pkg_script_run(pkg, PKG_SCRIPT_PRE_INSTALL);

	/*
@@ -212,7 +212,7 @@ pkg_add(struct pkgdb *db, const char *path, int flags)
	/*
	 * Execute post install scripts
	 */
-
	if (flags & PKG_ADD_UPGRADE_NEW)
+
	if ((flags & PKG_ADD_UPGRADE) == 0)
		pkg_script_run(pkg, PKG_SCRIPT_POST_UPGRADE);
	else
		pkg_script_run(pkg, PKG_SCRIPT_POST_INSTALL);