# HG changeset patch # User James Bowes # Date 1214518559 14400 # Node ID dc69c55cf46220bebd340d9a5a764a8c14726962 # Parent 75da311eda4591f1c5da948b96382eb575428905 get rpm -qpi working fully diff -r 75da311eda45 -r dc69c55cf462 librazor/rpm.c --- a/librazor/rpm.c Thu Jun 26 17:16:13 2008 -0400 +++ b/librazor/rpm.c Thu Jun 26 18:15:59 2008 -0400 @@ -781,7 +781,8 @@ RAZOR_EXPORT int razor_importer_add_rpm(struct razor_importer *importer, struct razor_rpm *rpm) { - const char *name, *version, *release, *arch, *summary; + const char *name, *version, *release, *arch; + const char *summary, *description, *url, *license; const uint32_t *epoch; char evr[128], buf[16]; @@ -790,7 +791,11 @@ version = razor_rpm_get_indirect(rpm, RPMTAG_VERSION, NULL); release = razor_rpm_get_indirect(rpm, RPMTAG_RELEASE, NULL); arch = razor_rpm_get_indirect(rpm, RPMTAG_ARCH, NULL); + summary = razor_rpm_get_indirect(rpm, RPMTAG_SUMMARY, NULL); + description = razor_rpm_get_indirect(rpm, RPMTAG_DESCRIPTION, NULL); + url = razor_rpm_get_indirect(rpm, RPMTAG_URL, NULL); + license = razor_rpm_get_indirect(rpm, RPMTAG_LICENSE, NULL); if (epoch) { snprintf(buf, sizeof buf, "%u", ntohl(*epoch)); @@ -800,6 +805,9 @@ } razor_importer_begin_package(importer, name, evr, arch); + razor_importer_add_details(importer, summary, description, url, + license); + import_properties(importer, RAZOR_PROPERTY_REQUIRES, rpm, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, diff -r 75da311eda45 -r dc69c55cf462 src/rpm.c --- a/src/rpm.c Thu Jun 26 17:16:13 2008 -0400 +++ b/src/rpm.c Thu Jun 26 18:15:59 2008 -0400 @@ -473,20 +473,20 @@ option_all = 1; } else { set = razor_root_open_read_only(option_root); + + /* FIXME: We need to figure out how to do this right. */ + details = "install/var/lib/razor/system-details.repo"; + if (option_info) + if (razor_set_open_details(set, details)) + return; + files = "install/var/lib/razor/system-files.repo"; + if (option_list) + if (razor_set_open_files(set, files)) + return; } 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) - if (razor_set_open_details(set, details)) - return; - files = "install/var/lib/razor/system-files.repo"; - if (option_list) - if (razor_set_open_files(set, files)) - return; - while (razor_package_iterator_next(pi, &package, &name, &version, &arch)) { if (option_conflicts)