Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
remove dead code
Baptiste Daroussin committed 6 years ago
commit 172a85c7656db75b310066b70f466d1fbd101446
parent 4e5856d
6 files changed +0 -155
modified libpkg/libpkg.ver
@@ -6,7 +6,6 @@ global:
	pkg_add_port;
	pkg_adddep;
	pkg_addrdep;
-
	pkg_addscript_file;
	pkg_addscript_fileat;
	pkg_analyse_files;
	pkg_asprintf;
@@ -82,7 +81,6 @@ global:
	pkg_manifest_keys_new;
	pkg_manifest_parser_free;
	pkg_manifest_parser_new;
-
	pkg_need_message;
	pkg_new;
	pkg_object_bool;
	pkg_object_count;
modified libpkg/pkg.c
@@ -485,35 +485,6 @@ pkg_set_from_fileat(int fd, struct pkg *pkg, pkg_attr attr, const char *path,
	return (ret);
}

-
int
-
pkg_set_from_file(struct pkg *pkg, pkg_attr attr, const char *path, bool trimcr)
-
{
-
	char *buf = NULL;
-
	char *cp;
-
	off_t size = 0;
-
	int ret = EPKG_OK;
-

-
	assert(pkg != NULL);
-
	assert(path != NULL);
-

-
	if ((ret = file_to_buffer(path, &buf, &size)) !=  EPKG_OK)
-
		return (ret);
-

-
	if (trimcr) {
-
		cp = buf + strlen(buf) - 1;
-
		while (cp > buf && *cp == '\n') {
-
			*cp = 0;
-
			cp--;
-
		}
-
	}
-

-
	ret = pkg_set(pkg, attr, buf);
-

-
	free(buf);
-

-
	return (ret);
-
}
-

#define pkg_each(name, type, field)		\
int						\
pkg_##name(const struct pkg *p, type **t) {	\
@@ -910,66 +881,6 @@ cleanup:
}

int
-
pkg_addscript_file(struct pkg *pkg, const char *path)
-
{
-
	char *filename;
-
	char *data;
-
	pkg_script type;
-
	int ret = EPKG_OK;
-
	off_t sz = 0;
-

-
	assert(pkg != NULL);
-
	assert(path != NULL);
-

-
	pkg_debug(1, "Adding script from: '%s'", path);
-

-
	if ((ret = file_to_buffer(path, &data, &sz)) != EPKG_OK)
-
		return (ret);
-

-
	filename = strrchr(path, '/');
-
	filename[0] = '\0';
-
	filename++;
-

-
	if (strcmp(filename, "pkg-pre-install") == 0 ||
-
			strcmp(filename, "+PRE_INSTALL") == 0) {
-
		type = PKG_SCRIPT_PRE_INSTALL;
-
	} else if (strcmp(filename, "pkg-post-install") == 0 ||
-
			strcmp(filename, "+POST_INSTALL") == 0) {
-
		type = PKG_SCRIPT_POST_INSTALL;
-
	} else if (strcmp(filename, "pkg-install") == 0 ||
-
			strcmp(filename, "+INSTALL") == 0) {
-
		type = PKG_SCRIPT_INSTALL;
-
	} else if (strcmp(filename, "pkg-pre-deinstall") == 0 ||
-
			strcmp(filename, "+PRE_DEINSTALL") == 0) {
-
		type = PKG_SCRIPT_PRE_DEINSTALL;
-
	} else if (strcmp(filename, "pkg-post-deinstall") == 0 ||
-
			strcmp(filename, "+POST_DEINSTALL") == 0) {
-
		type = PKG_SCRIPT_POST_DEINSTALL;
-
	} else if (strcmp(filename, "pkg-deinstall") == 0 ||
-
			strcmp(filename, "+DEINSTALL") == 0) {
-
		type = PKG_SCRIPT_DEINSTALL;
-
	} else if (strcmp(filename, "pkg-pre-upgrade") == 0 ||
-
			strcmp(filename, "+PRE_UPGRADE") == 0) {
-
		type = PKG_SCRIPT_PRE_UPGRADE;
-
	} else if (strcmp(filename, "pkg-post-upgrade") == 0 ||
-
			strcmp(filename, "+POST_UPGRADE") == 0) {
-
		type = PKG_SCRIPT_POST_UPGRADE;
-
	} else if (strcmp(filename, "pkg-upgrade") == 0 ||
-
			strcmp(filename, "+UPGRADE") == 0) {
-
		type = PKG_SCRIPT_UPGRADE;
-
	} else {
-
		pkg_emit_error("unknown script '%s'", filename);
-
		ret = EPKG_FATAL;
-
		goto cleanup;
-
	}
-

-
	ret = pkg_addscript(pkg, data, type);
-
cleanup:
-
	free(data);
-
	return (ret);
-
}
-

-
int
pkg_appendscript(struct pkg *pkg, const char *cmd, pkg_script type)
{

@@ -1642,25 +1553,6 @@ pkg_is_installed(struct pkgdb *db, const char *name)
}

bool
-
pkg_need_message(struct pkg *p, struct pkg *old)
-
{
-
	bool ret = true;
-

-
	if (old != NULL) {
-
		if (p->message->maximum_version) {
-
			ret = (pkg_version_cmp(old->version, p->message->maximum_version)
-
					<= 0);
-
		}
-
		if (ret && p->message->minimum_version) {
-
			ret = (pkg_version_cmp(old->version, p->message->minimum_version)
-
								>= 0);
-
		}
-
	}
-

-
	return (ret);
-
}
-

-
bool
pkg_has_message(struct pkg *p)
{
	return (p->message != NULL);
modified libpkg/pkg.h.in
@@ -722,7 +722,6 @@ int pkg_addrdep(struct pkg *pkg, const char *name, const char *origin, const
 * Helper which call pkg_addscript() with the content of the file and
 * with the correct type.
 */
-
int pkg_addscript_file(struct pkg *pkg, const char *path);
int pkg_addscript_fileat(int fd, struct pkg *pkg, const char *path);

/**
@@ -1636,7 +1635,6 @@ UT_string *pkg_utstring_vprintf(UT_string * restrict sbuf,
#endif

bool pkg_has_message(struct pkg *p);
-
bool pkg_need_message(struct pkg *p, struct pkg *old);
bool pkg_is_locked(const struct pkg * restrict p);


modified libpkg/pkgdb.c
@@ -201,24 +201,6 @@ pkgdb_now(sqlite3_context *ctx, int argc, __unused sqlite3_value **argv)
	sqlite3_result_int64(ctx, (int64_t)time(NULL));
}

-
void
-
pkgdb_myarch(sqlite3_context *ctx, int argc, sqlite3_value **argv)
-
{
-
	const unsigned char	*arch = NULL;
-

-
	if (argc > 1) {
-
		sqlite3_result_error(ctx, "Invalid usage of myarch\n", -1);
-
		return;
-
	}
-

-
	if (argc == 0 || (arch = sqlite3_value_text(argv[0])) == NULL) {
-
		arch = pkg_object_string(pkg_config_get("ABI"));
-
		sqlite3_result_text(ctx, arch, strlen(arch), NULL);
-
		return;
-
	}
-
	sqlite3_result_text(ctx, arch, strlen(arch), NULL);
-
}
-

static void
pkgdb_vercmp(sqlite3_context *ctx, int argc, sqlite3_value **argv)
{
@@ -2656,10 +2638,6 @@ pkgdb_sqlcmd_init(sqlite3 *db, __unused const char **err,
{
	sqlite3_create_function(db, "now", 0, SQLITE_ANY|SQLITE_DETERMINISTIC, NULL,
	    pkgdb_now, NULL, NULL);
-
	sqlite3_create_function(db, "myarch", 0, SQLITE_ANY|SQLITE_DETERMINISTIC, NULL,
-
	    pkgdb_myarch, NULL, NULL);
-
	sqlite3_create_function(db, "myarch", 1, SQLITE_ANY|SQLITE_DETERMINISTIC, NULL,
-
	    pkgdb_myarch, NULL, NULL);
	sqlite3_create_function(db, "regexp", 2, SQLITE_ANY|SQLITE_DETERMINISTIC, NULL,
	    pkgdb_regex, NULL, NULL);
	sqlite3_create_function(db, "split_version", 2, SQLITE_ANY|SQLITE_DETERMINISTIC, NULL,
@@ -3175,17 +3153,3 @@ pkgdb_is_dir_used(struct pkgdb *db, struct pkg *p, const char *dir, int64_t *res

	return (EPKG_OK);
}
-

-
int
-
pkgdb_repo_count(struct pkgdb *db)
-
{
-
	struct _pkg_repo_list_item *cur;
-
	int result = 0;
-

-
	if (db != NULL) {
-
		LL_FOREACH(db->repos, cur)
-
			result ++;
-
	}
-

-
	return (result);
-
}
modified libpkg/private/pkg.h
@@ -833,7 +833,6 @@ enum pkg_metalog_type {
	PKG_METALOG_LINK,
};

-
int pkg_set_from_file(struct pkg *pkg, pkg_attr attr, const char *file, bool trimcr);
int pkg_set_from_fileat(int fd, struct pkg *pkg, pkg_attr attr, const char *file, bool trimcr);
void pkg_rollback_cb(void *);
void pkg_rollback_pkg(struct pkg *);
modified libpkg/private/pkgdb.h
@@ -168,12 +168,6 @@ int pkgdb_end_solver(struct pkgdb *db);
 */
int pkgdb_check_access(unsigned mode, const char* dbdir, const char *dbname);

-
/**
-
 * Returns number of attached repositories
-
 * @param db
-
 * @return
-
 */
-
int pkgdb_repo_count(struct pkgdb *db);
/*
 * SQLite utility functions
 */