get rpm -qpi working fully
authorJames Bowes <jbowes@redhat.com>
Thu Jun 26 18:15:59 2008 -0400 (2008-06-26)
changeset 289dc69c55cf462
parent 288 75da311eda45
child 290 f2461ae87dde
get rpm -qpi working fully
librazor/rpm.c
src/rpm.c
     1.1 --- a/librazor/rpm.c	Thu Jun 26 17:16:13 2008 -0400
     1.2 +++ b/librazor/rpm.c	Thu Jun 26 18:15:59 2008 -0400
     1.3 @@ -781,7 +781,8 @@
     1.4  RAZOR_EXPORT int
     1.5  razor_importer_add_rpm(struct razor_importer *importer, struct razor_rpm *rpm)
     1.6  {
     1.7 -	const char *name, *version, *release, *arch, *summary;
     1.8 +	const char *name, *version, *release, *arch;
     1.9 +	const char *summary, *description, *url, *license;
    1.10  	const uint32_t *epoch;
    1.11  	char evr[128], buf[16];
    1.12  
    1.13 @@ -790,7 +791,11 @@
    1.14  	version = razor_rpm_get_indirect(rpm, RPMTAG_VERSION, NULL);
    1.15  	release = razor_rpm_get_indirect(rpm, RPMTAG_RELEASE, NULL);
    1.16  	arch = razor_rpm_get_indirect(rpm, RPMTAG_ARCH, NULL);
    1.17 +
    1.18  	summary = razor_rpm_get_indirect(rpm, RPMTAG_SUMMARY, NULL);
    1.19 +	description = razor_rpm_get_indirect(rpm, RPMTAG_DESCRIPTION, NULL);
    1.20 +	url = razor_rpm_get_indirect(rpm, RPMTAG_URL, NULL);
    1.21 +	license = razor_rpm_get_indirect(rpm, RPMTAG_LICENSE, NULL);
    1.22  
    1.23  	if (epoch) {
    1.24  		snprintf(buf, sizeof buf, "%u", ntohl(*epoch));
    1.25 @@ -800,6 +805,9 @@
    1.26  	}
    1.27  	razor_importer_begin_package(importer, name, evr, arch);
    1.28  
    1.29 +	razor_importer_add_details(importer, summary, description, url,
    1.30 +				   license);
    1.31 +
    1.32  	import_properties(importer, RAZOR_PROPERTY_REQUIRES, rpm,
    1.33  			  RPMTAG_REQUIRENAME,
    1.34  			  RPMTAG_REQUIREVERSION,
     2.1 --- a/src/rpm.c	Thu Jun 26 17:16:13 2008 -0400
     2.2 +++ b/src/rpm.c	Thu Jun 26 18:15:59 2008 -0400
     2.3 @@ -473,20 +473,20 @@
     2.4  		option_all = 1;
     2.5  	} else {
     2.6  		set = razor_root_open_read_only(option_root);
     2.7 +
     2.8 +		/* FIXME: We need to figure out how to do this right. */
     2.9 +		details = "install/var/lib/razor/system-details.repo";
    2.10 +		if (option_info)
    2.11 +			if (razor_set_open_details(set, details))
    2.12 +				return;
    2.13 +		files = "install/var/lib/razor/system-files.repo";
    2.14 +		if (option_list)
    2.15 +			if (razor_set_open_files(set, files))
    2.16 +				return;
    2.17  	}
    2.18  
    2.19  	pi = get_query_packages(set, argc, argv);
    2.20  
    2.21 -	/* FIXME: We need to figure out how to do this right. */
    2.22 -	details = "install/var/lib/razor/system-details.repo";
    2.23 -	if (option_info)
    2.24 -		if (razor_set_open_details(set, details))
    2.25 -			return;
    2.26 -	files = "install/var/lib/razor/system-files.repo";
    2.27 -	if (option_list)
    2.28 -		if (razor_set_open_files(set, files))
    2.29 -			return;
    2.30 -
    2.31  	while (razor_package_iterator_next(pi, &package,
    2.32  					   &name, &version, &arch)) {
    2.33  		if (option_conflicts)