diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-06-23 14:34:47 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-06-23 14:34:47 -0400 |
commit | d52745a2ec3f28dcdd4332e4e49f2255a4b704ad (patch) | |
tree | f60bdd48c049f7f9131fd82007dc019ba02c1a07 /src | |
parent | a29ab20718bafd0c02bce8e9dc9025a5479ff234 (diff) |
Add some support for --info.
Diffstat (limited to 'src')
-rw-r--r-- | src/rpm.c | 27 |
1 files changed, 23 insertions, 4 deletions
@@ -396,9 +396,23 @@ print_package_properties(struct razor_set *set, } static void -print_package_info(struct razor_set *set, struct razor_package *package) +print_package_info(struct razor_set *set, struct razor_package *package, + const char *name, const char *version, const char *arch) { - printf("FIXME: Package info not tracked.\n"); + const char *summary, *description, *url, *license; + + razor_package_get_details(set, package, &summary, &description, + &url, &license); + + printf("Name: %s\n", name); + printf("Arch: %s\n", arch); + printf("Version: %s\n", version); + printf("URL: %s\n", url); + printf("License: %s\n", license); + printf("Summary: %s\n", summary); + printf("Description:\n"); + printf("%s\n", description); + printf("\n"); } static void @@ -435,7 +449,7 @@ command_query(int argc, const char *argv[]) struct razor_set *set; struct razor_package_iterator *pi; struct razor_package *package; - const char *name, *version, *arch; + const char *name, *version, *arch, *details; if (option_package) { set = create_set_from_command_line(argc, argv); @@ -447,6 +461,11 @@ command_query(int argc, const char *argv[]) pi = get_query_packages(set, argc, argv); + /* FIXME: We need to figure out how to do this right. */ + details = "install/var/lib/razor/system-details.repo"; + if (option_info) + razor_set_open_details(set, details); + while (razor_package_iterator_next(pi, &package, &name, &version, &arch)) { if (option_conflicts) @@ -462,7 +481,7 @@ command_query(int argc, const char *argv[]) print_package_properties(set, package, RAZOR_PROPERTY_PROVIDES); if (option_info) - print_package_info(set, package); + print_package_info(set, package, name, version, arch); if (option_changelog) print_package_changelog(set, package); |