src/import-yum.c
changeset 258 29d5002bd17f
parent 247 63444a10fb8e
child 259 5b0601d184ed
     1.1 --- a/src/import-yum.c	Fri Jun 20 14:18:52 2008 -0400
     1.2 +++ b/src/import-yum.c	Fri Jun 20 19:04:47 2008 -0400
     1.3 @@ -38,6 +38,10 @@
     1.4  	YUM_STATE_BEGIN,
     1.5  	YUM_STATE_PACKAGE_NAME,
     1.6  	YUM_STATE_PACKAGE_ARCH,
     1.7 +	YUM_STATE_SUMMARY,
     1.8 +	YUM_STATE_DESCRIPTION,
     1.9 +	YUM_STATE_URL,
    1.10 +	YUM_STATE_LICENSE,
    1.11  	YUM_STATE_CHECKSUM,
    1.12  	YUM_STATE_REQUIRES,
    1.13  	YUM_STATE_PROVIDES,
    1.14 @@ -53,7 +57,8 @@
    1.15  
    1.16  	struct razor_importer *importer;
    1.17  	struct import_property_context *current_property_context;
    1.18 -	char name[256], arch[64], buffer[512], *p;
    1.19 +	char name[256], arch[64], summary[512], description[4096];
    1.20 +	char url[256], license[64], buffer[512], *p;
    1.21  	char pkgid[128];
    1.22  	uint32_t property_type;
    1.23  	int state;
    1.24 @@ -112,9 +117,21 @@
    1.25  		razor_build_evr(buffer, sizeof buffer, epoch, version, release);
    1.26  		razor_importer_begin_package(ctx->importer,
    1.27  					     ctx->name, buffer, ctx->arch);
    1.28 +	} else if (strcmp(name, "summary") == 0) {
    1.29 +		ctx->p = ctx->summary;
    1.30 +		ctx->state = YUM_STATE_SUMMARY;
    1.31 +	} else if (strcmp(name, "description") == 0) {
    1.32 +		ctx->p = ctx->description;
    1.33 +		ctx->state = YUM_STATE_DESCRIPTION;
    1.34 +	} else if (strcmp(name, "url") == 0) {
    1.35 +		ctx->p = ctx->url;
    1.36 +		ctx->state = YUM_STATE_URL;
    1.37  	} else if (strcmp(name, "checksum") == 0) {
    1.38  		ctx->p = ctx->pkgid;
    1.39  		ctx->state = YUM_STATE_CHECKSUM;
    1.40 +	} else if (strcmp(name, "rpm:license") == 0) {
    1.41 +		ctx->p = ctx->license;
    1.42 +		ctx->state = YUM_STATE_LICENSE;
    1.43  	} else if (strcmp(name, "rpm:requires") == 0) {
    1.44  		ctx->state = YUM_STATE_REQUIRES;
    1.45  		ctx->property_type = RAZOR_PROPERTY_REQUIRES;
    1.46 @@ -174,6 +191,10 @@
    1.47  	switch (ctx->state) {
    1.48  	case YUM_STATE_PACKAGE_NAME:
    1.49  	case YUM_STATE_PACKAGE_ARCH:
    1.50 +	case YUM_STATE_SUMMARY:
    1.51 +	case YUM_STATE_DESCRIPTION:
    1.52 +	case YUM_STATE_URL:
    1.53 +	case YUM_STATE_LICENSE:
    1.54  	case YUM_STATE_CHECKSUM:
    1.55  	case YUM_STATE_FILE:
    1.56  		ctx->state = YUM_STATE_BEGIN;
    1.57 @@ -181,6 +202,10 @@
    1.58  	}
    1.59  
    1.60  	if (strcmp(name, "package") == 0) {
    1.61 +		razor_importer_add_details(ctx->importer, ctx->summary,
    1.62 +					   ctx->description, ctx->url,
    1.63 +					   ctx->license);
    1.64 +
    1.65  		XML_StopParser(ctx->current_parser, XML_TRUE);
    1.66  		ctx->current_parser = ctx->filelists_parser;
    1.67  	}
    1.68 @@ -194,6 +219,10 @@
    1.69  	switch (ctx->state) {
    1.70  	case YUM_STATE_PACKAGE_NAME:
    1.71  	case YUM_STATE_PACKAGE_ARCH:
    1.72 +	case YUM_STATE_SUMMARY:
    1.73 +	case YUM_STATE_DESCRIPTION:
    1.74 +	case YUM_STATE_URL:
    1.75 +	case YUM_STATE_LICENSE:
    1.76  	case YUM_STATE_CHECKSUM:
    1.77  	case YUM_STATE_FILE:
    1.78  		memcpy(ctx->p, s, len);