Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
If there is no remote pkg to install, don't warn that there is a newer one. Fixes #241
Bryan Drewery committed 13 years ago
commit 5873fd5e2ad7e104c6b94b9a0d5ac1ef30974f9e
parent c5569a2
1 file changed +8 -0
modified libpkg/pkgdb.c
@@ -2301,9 +2301,17 @@ pkgdb_query_newpkgversion(struct pkgdb *db, const char *repo)
	sbuf_finish(sql);
	sql_exec(db->sqlite, sbuf_get(sql));

+
	/* If no rows were INSERTED then pkg is not listed in the remote remo
+
	 * so there's nothing to upgrade to.  */
+
	if (sqlite3_changes(db->sqlite) == 0) {
+
		sbuf_delete(sql);
+
		return NULL;
+
	}
+

	/* Delete where the current version is higher than the remote version */
	sql_exec(db->sqlite, "DELETE FROM pkgjobs WHERE PKGGT(version, newversion) OR version == newversion;");

+
	/* Return NULL if pkg was deleted */
	if (sqlite3_changes(db->sqlite) > 0) {
		sbuf_delete(sql);
		return NULL;