Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix pkg deletion
Baptiste Daroussin committed 14 years ago
commit 0ccdb219bc95cfb2d442b75c83836fe35abf44e1
parent e4bc6d1
2 files changed +5 -2
modified libpkg/pkg.h
@@ -717,7 +717,7 @@ int pkg_create_fakeroot(const char *, pkg_formats, const char *, const char *);
 */
int pkg_delete(struct pkg *pkg, struct pkgdb *db, int flags);
#define PKG_DELETE_FORCE (1<<0)
-
#define PKG_DELETE_UPGRADE (1<<0)
+
#define PKG_DELETE_UPGRADE (1<<1)

int pkg_repo_fetch(struct pkg *pkg);
int pkg_repo_verify(const char *path, unsigned char *sig, unsigned int sig_len);
modified libpkg/pkg_jobs.c
@@ -229,7 +229,10 @@ pkg_jobs_deinstall(struct pkg_jobs *j, int force)
	int retcode;

	while (pkg_jobs(j, &p) == EPKG_OK) {
-
		retcode = pkg_delete(p, j->db, force);
+
		if (force)
+
			retcode = pkg_delete(p, j->db, PKG_DELETE_FORCE);
+
		else
+
			retcode = pkg_delete(p, j->db, 0);
		if (retcode != EPKG_OK)
			return (retcode);
	}