Remove xbps_print_hexfp() from API and move it xbps-rindex, where it belongs.

This commit is contained in:
Juan RP
2013-11-08 09:12:29 +01:00
parent 2952c69c7a
commit 53ecaf9819
3 changed files with 17 additions and 27 deletions

View File

@@ -53,6 +53,20 @@ usage(bool fail)
exit(fail ? EXIT_FAILURE : EXIT_SUCCESS);
}
static void
print_hexfp(unsigned const char *fp)
{
unsigned int i, c, len;
len = strlen((const char *)fp);
for (i = 0; i < len; i++) {
fprintf(stdout, "%02x", fp[i]);
c = i + 1;
if (c < len)
fprintf(stdout, ":");
}
}
static int
state_cb(struct xbps_state_cb_data *xscd, void *cbd _unused)
{
@@ -63,7 +77,7 @@ state_cb(struct xbps_state_cb_data *xscd, void *cbd _unused)
case XBPS_STATE_REPO_KEY_IMPORT:
printf("%s\n", xscd->desc);
printf("Fingerprint: ");
xbps_print_hexfp(xscd->arg);
print_hexfp((unsigned const char *)xscd->arg);
printf("\n");
rv = noyes("Do you want to import this public key?");
break;
@@ -117,7 +131,7 @@ repo_info_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused)
printf(" %u ", rpubkeysiz);
fp = xbps_pubkey2fp(repo->xhp, rpubkey);
assert(fp);
xbps_print_hexfp((const char *)fp);
print_hexfp(fp);
free(fp);
printf("\n");
}