Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
repos: remove deadcode
Baptiste Daroussin committed 2 years ago
commit c76c232bee2de2032cb27ca631ddef1d20853766
parent 525b9cf
1 file changed +0 -31
modified libpkg/repo/binary/init.c
@@ -50,34 +50,6 @@

extern struct pkg_ctx ctx;

-
static void
-
sqlite_file_exists(sqlite3_context *ctx, int argc, sqlite3_value **argv)
-
{
-
	char	 fpath[MAXPATHLEN];
-
	sqlite3	*db = sqlite3_context_db_handle(ctx);
-
	char	*path = get_dirname(xstrdup(sqlite3_db_filename(db, "main")));
-
	char	*cksum;
-

-
	if (argc != 2) {
-
		sqlite3_result_error(ctx, "file_exists needs two argument", -1);
-
		return;
-
	}
-

-
	snprintf(fpath, sizeof(fpath), "%s/%s", path, sqlite3_value_text(argv[0]));
-

-
	if (access(fpath, R_OK) == 0) {
-
		cksum = pkg_checksum_file(fpath, PKG_HASH_TYPE_SHA256_HEX);
-
		if (cksum && strcmp(cksum, sqlite3_value_text(argv[1])) == 0)
-
			sqlite3_result_int(ctx, 1);
-
		else
-
			sqlite3_result_int(ctx, 0);
-
		free(cksum);
-
	} else {
-
		sqlite3_result_int(ctx, 0);
-
	}
-
	free(path);
-
}
-

static int
pkg_repo_binary_get_user_version(sqlite3 *sqlite, int *reposcver)
{
@@ -484,9 +456,6 @@ pkg_repo_binary_init(struct pkg_repo *repo)
	int retcode = EPKG_OK;
	sqlite3 *sqlite = PRIV_GET(repo);

-
	sqlite3_create_function(sqlite, "file_exists", 2, SQLITE_ANY, NULL,
-
		    sqlite_file_exists, NULL, NULL);
-

	retcode = sql_exec(sqlite, "PRAGMA journal_mode=TRUNCATE;");
	if (retcode != EPKG_OK)
		return (retcode);