Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
db: vacuum if the db becomes empty
Baptiste Daroussin committed 3 years ago
commit 1c53e081d82733a6887f6055e1a328e56ac2e573
parent 2071723
1 file changed +1 -1
modified libpkg/pkgdb.c
@@ -2396,7 +2396,7 @@ pkgdb_compact(struct pkgdb *db)
	 * used space.
	 */

-
	if (freelist_count / (float)page_count < 0.25)
+
	if (freelist_count > 0 && freelist_count / (float)page_count < 0.25)
		return (EPKG_OK);

	return (sql_exec(db->sqlite, "VACUUM;"));