Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix auto upgrade for for example py26 -> py27
Baptiste Daroussin committed 14 years ago
commit 07e85215be34eb689ddaf03a3949a2d9a8ad0a03
parent 69c5f1c
1 file changed +2 -2
modified libpkg/pkgdb.c
@@ -2405,7 +2405,7 @@ pkgdb_query_installs(struct pkgdb *db, match_t match, int nbpkgs, char **pkgs, c
	/* Report and remove packages already installed and at the latest version */
	report_already_installed(db->sqlite);
	if (!force)
-
		sql_exec(db->sqlite, "DELETE from pkgjobs where (select p.origin from main.packages as p where p.origin=pkgjobs.origin and p.version=pkgjobs.version) IS NOT NULL;");
+
		sql_exec(db->sqlite, "DELETE from pkgjobs where (select p.origin from main.packages as p where p.origin=pkgjobs.origin and p.version=pkgjobs.version and p.name = pkgjobs.name) IS NOT NULL;");

	/* Append dependencies */
	sbuf_reset(sql);
@@ -2524,7 +2524,7 @@ pkgdb_query_upgrades(struct pkgdb *db, const char *repo, bool all)

	/* Remove packages already installed and in the latest version */
	if (!all)
-
		sql_exec(db->sqlite, "DELETE from pkgjobs where (select p.origin from main.packages as p where p.origin=pkgjobs.origin and version=pkgjobs.version) IS NOT NULL;");
+
		sql_exec(db->sqlite, "DELETE from pkgjobs where (select p.origin from main.packages as p where p.origin=pkgjobs.origin and p.version=pkgjobs.version and p.name = pkgjobs.name) IS NOT NULL;");

	sbuf_reset(sql);
	sbuf_printf(sql, pkgjobs_sql_2, reponame, reponame);