get rpm -qpi working fully
authorJames Bowes <jbowes@redhat.com>
Thu, 26 Jun 2008 22:15:59 +0000 (18:15 -0400)
committerJames Bowes <jbowes@redhat.com>
Thu, 26 Jun 2008 22:15:59 +0000 (18:15 -0400)
librazor/rpm.c
src/rpm.c

index b8cca09..7eb5b01 100644 (file)
@@ -781,7 +781,8 @@ razor_rpm_close(struct razor_rpm *rpm)
 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 @@ razor_importer_add_rpm(struct razor_importer *importer, struct razor_rpm *rpm)
        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_add_rpm(struct razor_importer *importer, struct razor_rpm *rpm)
        }
        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,
index bb91354..872f926 100644 (file)
--- a/src/rpm.c
+++ b/src/rpm.c
@@ -473,20 +473,20 @@ command_query(int argc, const char *argv[])
                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)