xbps-query: print 'source-revisions' obj as any other metadata obj.

There's no reason to special case it anymore.
This commit is contained in:
Juan RP 2014-11-25 09:01:16 +01:00
parent 89d11e871f
commit ad9cbaf777

View File

@ -160,21 +160,6 @@ show_pkg_info_one(xbps_dictionary_t d, const char *keys)
free(key);
}
static void
print_srcrevs(const char *keyname, xbps_string_t obj, const char *bold, const char *reset)
{
const char *str = xbps_string_cstring_nocopy(obj);
printf("%s%s%s:\n ", bold, keyname, reset);
for (unsigned int i = 0; i < strlen(str); i++) {
if (str[i] == '\n')
printf("\n ");
else
putchar(str[i]);
}
putchar('\n');
}
void
show_pkg_info(xbps_dictionary_t dict)
{
@ -203,11 +188,6 @@ show_pkg_info(xbps_dictionary_t dict)
(strcmp(keyname, "links") == 0))
continue;
/* special case for source-revisions obj */
if (strcmp(keyname, "source-revisions") == 0) {
print_srcrevs(keyname, obj, bold, reset);
continue;
}
/* anything else */
print_value_obj(keyname, obj, NULL, bold, reset, false);
}