summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bowes <jbowes@redhat.com>2008-06-26 18:15:59 -0400
committerJames Bowes <jbowes@redhat.com>2008-06-26 18:15:59 -0400
commit145002da7ffa173c14c6560e6ee26e6487554008 (patch)
treea65181ba16bdf4aaa4b381b971560235e88415c1
parentc57370decf4e204cf4e3323e669cc676a2760707 (diff)
get rpm -qpi working fully
-rw-r--r--librazor/rpm.c10
-rw-r--r--src/rpm.c20
2 files changed, 19 insertions, 11 deletions
diff --git a/librazor/rpm.c b/librazor/rpm.c
index b8cca09..7eb5b01 100644
--- a/librazor/rpm.c
+++ b/librazor/rpm.c
@@ -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,
diff --git a/src/rpm.c b/src/rpm.c
index bb91354..872f926 100644
--- 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)