Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge pull request #1515 from ThomasAdam/ta/compilation-fixes
Baptiste Daroussin committed 9 years ago
commit b31cda9de68de4cbac45ce0e5f7d2e5b21558a26
parent 7d27486
4 files changed +0 -138
modified libpkg/pkg_repo_create.c
@@ -95,66 +95,6 @@ pkg_repo_new_conflict(const char *uniqueid, struct pkg_conflict_bulk *bulk)
	HASH_ADD_KEYPTR(hh, bulk->conflicts, new->uid, strlen(new->uid), new);
}

-
static void
-
pkg_repo_write_conflicts (struct pkg_conflict_bulk *bulk, FILE *out)
-
{
-
	struct pkg_conflict_bulk	*pkg_bulk = NULL, *cur, *tmp, *s;
-
	struct pkg_conflict	*c1, *c1tmp, *c2, *c2tmp, *ctmp;
-

-
	/*
-
	 * Here we reorder bulk hash from hash by file
-
	 * to hash indexed by a package, so we iterate over the
-
	 * original hash and create a new hash indexed by package name
-
	 */
-

-
	HASH_ITER (hh, bulk, cur, tmp) {
-
		HASH_ITER (hh, cur->conflicts, c1, c1tmp) {
-
			HASH_FIND_STR(pkg_bulk, c1->uid, s);
-
			if (s == NULL) {
-
				/* New entry required */
-
				s = malloc(sizeof(struct pkg_conflict_bulk));
-
				if (s == NULL) {
-
					pkg_emit_errno("malloc", "struct pkg_conflict_bulk");
-
					goto out;
-
				}
-
				memset(s, 0, sizeof(struct pkg_conflict_bulk));
-
				s->file = c1->uid;
-
				HASH_ADD_KEYPTR(hh, pkg_bulk, s->file, strlen(s->file), s);
-
			}
-
			/* Now add all new entries from this file to this conflict structure */
-
			HASH_ITER (hh, cur->conflicts, c2, c2tmp) {
-
				if (strcmp(c1->uid, c2->uid) == 0)
-
					continue;
-

-
				HASH_FIND_STR(s->conflicts, c2->uid, ctmp);
-
				if (ctmp == NULL)
-
					pkg_repo_new_conflict(c2->uid, s);
-
			}
-
		}
-
	}
-

-
	HASH_ITER (hh, pkg_bulk, cur, tmp) {
-
		fprintf(out, "%s:", cur->file);
-
		HASH_ITER (hh, cur->conflicts, c1, c1tmp) {
-
			if (c1->hh.next != NULL)
-
				fprintf(out, "%s,", c1->uid);
-
			else
-
				fprintf(out, "%s\n", c1->uid);
-
		}
-
	}
-
out:
-
	HASH_ITER (hh, pkg_bulk, cur, tmp) {
-
		HASH_ITER (hh, cur->conflicts, c1, c1tmp) {
-
			HASH_DEL(cur->conflicts, c1);
-
			free(c1->uid);
-
			free(c1);
-
		}
-
		HASH_DEL(pkg_bulk, cur);
-
		free(cur);
-
	}
-
	return;
-
}
-

struct pkg_fts_item {
	char *fts_accpath;
	char *pkg_path;
@@ -787,13 +727,6 @@ pkg_create_repo(char *path, const char *output_dir, bool filelist,
	/* Now sort all digests */
	DL_SORT(dlist, pkg_digest_sort_compare_func);

-
	/*
-
	 * XXX: it is not used actually
-
	 */
-
#if 0
-
	pkg_repo_write_conflicts(conflicts, fconflicts);
-
#endif
-

	/* Write metafile */
	if (!legacy) {
		ucl_object_t *meta_dump;
modified libpkg/private/pkg_printf.h
@@ -185,7 +185,6 @@ _static UT_string *format_file_perms(UT_string *, const void *, struct percent_e
_static UT_string *format_file_sha256(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_file_user(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_groups(UT_string *, const void *, struct percent_esc *);
-
_static UT_string *format_group_gidstr(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_group_name(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_row_counter(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_licenses(UT_string *, const void *, struct percent_esc *);
@@ -201,7 +200,6 @@ _static UT_string *format_repo_path(UT_string *, const void *, struct percent_es
_static UT_string *format_char_string(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_users(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_user_name(UT_string *, const void *, struct percent_esc *);
-
_static UT_string *format_user_uidstr(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_old_version(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_autoremove(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_shlibs_provided(UT_string *, const void *, struct percent_esc *);
modified libpkg/rsa.c
@@ -69,29 +69,6 @@ _load_rsa_private_key(struct rsa_key *rsa)
}

static RSA *
-
_load_rsa_public_key(const char *rsa_key_path)
-
{
-
	FILE *fp;
-
	RSA *rsa = NULL;
-
	char errbuf[1024];
-

-
	if ((fp = fopen(rsa_key_path, "rb")) == NULL) {
-
		pkg_emit_errno("fopen", rsa_key_path);
-
		return (NULL);
-
	}
-

-
	if (!PEM_read_RSA_PUBKEY(fp, &rsa, NULL, NULL)) {
-
		pkg_emit_error("error reading public key(%s): %s", rsa_key_path,
-
		    ERR_error_string(ERR_get_error(), errbuf));
-
		fclose(fp);
-
		return (NULL);
-
	}
-

-
	fclose(fp);
-
	return (rsa);
-
}
-

-
static RSA *
_load_rsa_public_key_buf(unsigned char *cert, int certlen)
{
	RSA *rsa = NULL;
modified src/event.c
@@ -86,7 +86,6 @@ static bool signal_handler_installed = false;

/* units for format_size */
static const char *unit_SI[] = { " ", "k", "M", "G", "T", };
-
static const char *unit_IEC[] = { "  ", "Ki", "Mi", "Gi", "Ti", };

static void draw_progressbar(int64_t current, int64_t total);

@@ -107,38 +106,6 @@ cleanup_handler(int dummy __unused)
}

static void
-
format_rate_IEC(char *buf, int size, off_t bytes)
-
{
-
	int i;
-

-
	bytes *= 100;
-
	for (i = 0; bytes >= 100*1000 && unit_IEC[i][0] != 'T'; i++)
-
		bytes = (bytes + 512) / 1024;
-
	if (i == 0) {
-
		i++;
-
		bytes = (bytes + 512) / 1024;
-
	}
-
	snprintf(buf, size, "%3lld.%1lld%s%s",
-
	    (long long) (bytes + 5) / 100,
-
	    (long long) (bytes + 5) / 10 % 10,
-
	    unit_IEC[i],
-
	    i ? "B" : " ");
-
}
-

-
static void
-
format_size_IEC(char *buf, int size, off_t bytes)
-
{
-
	int i;
-

-
	for (i = 0; bytes >= 10000 && unit_IEC[i][0] != 'T'; i++)
-
		bytes = (bytes + 512) / 1024;
-
	snprintf(buf, size, "%4lld%s%s",
-
	    (long long) bytes,
-
	    unit_IEC[i],
-
	    i ? "B" : " ");
-
}
-

-
static void
format_rate_SI(char *buf, int size, off_t bytes)
{
	int i;
@@ -157,19 +124,6 @@ format_rate_SI(char *buf, int size, off_t bytes)
	    i ? "B" : " ");
}

-
static void
-
format_size_SI(char *buf, int size, off_t bytes)
-
{
-
	int i;
-

-
	for (i = 0; bytes >= 10000 && unit_SI[i][0] != 'T'; i++)
-
		bytes = (bytes + 500) / 1000;
-
	snprintf(buf, size, "%4lld%s%s",
-
	    (long long) bytes,
-
	    unit_SI[i],
-
	    i ? "B" : " ");
-
}
-

void
job_status_end(UT_string *msg)
{