// Key
key = pakfire_repo_get_key(repo);
if (key) {
- r = pakfire_key_export(key, f, PAKFIRE_KEY_EXPORT_MODE_PUBLIC);
- if (r) {
- ERROR(repo->ctx, "Could not export the key: %m\n");
+ r = pakfire_key_export_string(key, &buffer, &length);
+ if (r < 0) {
+ ERROR(repo->ctx, "Could not export the key: %s\n", strerror(-r));
goto ERROR;
}
-#warning Are we actually exporting the key here?
-
- if (buffer) {
- r = pakfire_config_set_format(config, section, "key", "%.*s", (int)length, buffer);
- if (r) {
- ERROR(repo->ctx, "Could not set key: %m\n");
- goto ERROR;
- }
+ r = pakfire_config_set_format(config, section, "key", "%.*s", (int)length, buffer);
+ if (r < 0) {
+ ERROR(repo->ctx, "Could not set key: %s\n", strerror(-r));
+ goto ERROR;
}
}