import.c
changeset 67 cfe57117efee
parent 66 bb4ca4a47f66
child 68 0587f1759f09
     1.1 --- a/import.c	Wed Oct 31 22:41:27 2007 -0400
     1.2 +++ b/import.c	Sat Nov 03 17:15:29 2007 -0400
     1.3 @@ -159,6 +159,8 @@
     1.4  	YUM_STATE_PACKAGE_NAME,
     1.5  	YUM_STATE_REQUIRES,
     1.6  	YUM_STATE_PROVIDES,
     1.7 +	YUM_STATE_OBSOLETES,
     1.8 +	YUM_STATE_CONFLICTS,
     1.9  	YUM_STATE_FILE
    1.10  };
    1.11  
    1.12 @@ -201,6 +203,10 @@
    1.13  		ctx->state = YUM_STATE_REQUIRES;
    1.14  	} else if (strcmp(name, "rpm:provides") == 0) {
    1.15  		ctx->state = YUM_STATE_PROVIDES;
    1.16 +	} else if (strcmp(name, "rpm:obsoletes") == 0) {
    1.17 +		ctx->state = YUM_STATE_OBSOLETES;
    1.18 +	} else if (strcmp(name, "rpm:conflicts") == 0) {
    1.19 +		ctx->state = YUM_STATE_CONFLICTS;
    1.20  	} else if (strcmp(name, "rpm:entry") == 0 &&
    1.21  		   ctx->state != YUM_STATE_BEGIN) {
    1.22  		n = NULL;
    1.23 @@ -238,6 +244,14 @@
    1.24  			razor_importer_add_property(ctx->importer, n, buffer,
    1.25  						    RAZOR_PROPERTY_PROVIDES);
    1.26  			break;
    1.27 +		case YUM_STATE_OBSOLETES:
    1.28 +			razor_importer_add_property(ctx->importer, n, buffer,
    1.29 +						    RAZOR_PROPERTY_OBSOLETES);
    1.30 +			break;
    1.31 +		case YUM_STATE_CONFLICTS:
    1.32 +			razor_importer_add_property(ctx->importer, n, buffer,
    1.33 +						    RAZOR_PROPERTY_CONFLICTS);
    1.34 +			break;
    1.35  		}
    1.36  	} else if (strcmp(name, "file") == 0) {
    1.37  		ctx->state = YUM_STATE_FILE;
    1.38 @@ -365,12 +379,38 @@
    1.39  			       &property_names.p, &count);
    1.40  		headerGetEntry(h, RPMTAG_PROVIDEVERSION, &type,
    1.41  			       &property_versions.p, &count);
    1.42 +		headerGetEntry(h, RPMTAG_PROVIDEFLAGS, &type,
    1.43 +			       &property_flags.p, &count);
    1.44  		for (i = 0; i < count; i++)
    1.45  			razor_importer_add_property(importer,
    1.46  						    property_names.list[i],
    1.47  						    property_versions.list[i],
    1.48  						    RAZOR_PROPERTY_PROVIDES);
    1.49  
    1.50 +		headerGetEntry(h, RPMTAG_OBSOLETENAME, &type,
    1.51 +			       &property_names.p, &count);
    1.52 +		headerGetEntry(h, RPMTAG_OBSOLETEVERSION, &type,
    1.53 +			       &property_versions.p, &count);
    1.54 +		headerGetEntry(h, RPMTAG_OBSOLETEFLAGS, &type,
    1.55 +			       &property_flags.p, &count);
    1.56 +		for (i = 0; i < count; i++)
    1.57 +			razor_importer_add_property(importer,
    1.58 +						    property_names.list[i],
    1.59 +						    property_versions.list[i],
    1.60 +						    RAZOR_PROPERTY_OBSOLETES);
    1.61 +
    1.62 +		headerGetEntry(h, RPMTAG_CONFLICTNAME, &type,
    1.63 +			       &property_names.p, &count);
    1.64 +		headerGetEntry(h, RPMTAG_CONFLICTVERSION, &type,
    1.65 +			       &property_versions.p, &count);
    1.66 +		headerGetEntry(h, RPMTAG_CONFLICTFLAGS, &type,
    1.67 +			       &property_flags.p, &count);
    1.68 +		for (i = 0; i < count; i++)
    1.69 +			razor_importer_add_property(importer,
    1.70 +						    property_names.list[i],
    1.71 +						    property_versions.list[i],
    1.72 +						    RAZOR_PROPERTY_CONFLICTS);
    1.73 +
    1.74  		headerGetEntry(h, RPMTAG_BASENAMES, &type,
    1.75  			       &basenames.p, &count);
    1.76  		headerGetEntry(h, RPMTAG_DIRNAMES, &type,