YUM_STATE_PACKAGE_NAME,
YUM_STATE_REQUIRES,
YUM_STATE_PROVIDES,
+ YUM_STATE_OBSOLETES,
+ YUM_STATE_CONFLICTS,
YUM_STATE_FILE
};
ctx->state = YUM_STATE_REQUIRES;
} else if (strcmp(name, "rpm:provides") == 0) {
ctx->state = YUM_STATE_PROVIDES;
+ } else if (strcmp(name, "rpm:obsoletes") == 0) {
+ ctx->state = YUM_STATE_OBSOLETES;
+ } else if (strcmp(name, "rpm:conflicts") == 0) {
+ ctx->state = YUM_STATE_CONFLICTS;
} else if (strcmp(name, "rpm:entry") == 0 &&
ctx->state != YUM_STATE_BEGIN) {
n = NULL;
razor_importer_add_property(ctx->importer, n, buffer,
RAZOR_PROPERTY_PROVIDES);
break;
+ case YUM_STATE_OBSOLETES:
+ razor_importer_add_property(ctx->importer, n, buffer,
+ RAZOR_PROPERTY_OBSOLETES);
+ break;
+ case YUM_STATE_CONFLICTS:
+ razor_importer_add_property(ctx->importer, n, buffer,
+ RAZOR_PROPERTY_CONFLICTS);
+ break;
}
} else if (strcmp(name, "file") == 0) {
ctx->state = YUM_STATE_FILE;
&property_names.p, &count);
headerGetEntry(h, RPMTAG_PROVIDEVERSION, &type,
&property_versions.p, &count);
+ headerGetEntry(h, RPMTAG_PROVIDEFLAGS, &type,
+ &property_flags.p, &count);
for (i = 0; i < count; i++)
razor_importer_add_property(importer,
property_names.list[i],
property_versions.list[i],
RAZOR_PROPERTY_PROVIDES);
+ headerGetEntry(h, RPMTAG_OBSOLETENAME, &type,
+ &property_names.p, &count);
+ headerGetEntry(h, RPMTAG_OBSOLETEVERSION, &type,
+ &property_versions.p, &count);
+ headerGetEntry(h, RPMTAG_OBSOLETEFLAGS, &type,
+ &property_flags.p, &count);
+ for (i = 0; i < count; i++)
+ razor_importer_add_property(importer,
+ property_names.list[i],
+ property_versions.list[i],
+ RAZOR_PROPERTY_OBSOLETES);
+
+ headerGetEntry(h, RPMTAG_CONFLICTNAME, &type,
+ &property_names.p, &count);
+ headerGetEntry(h, RPMTAG_CONFLICTVERSION, &type,
+ &property_versions.p, &count);
+ headerGetEntry(h, RPMTAG_CONFLICTFLAGS, &type,
+ &property_flags.p, &count);
+ for (i = 0; i < count; i++)
+ razor_importer_add_property(importer,
+ property_names.list[i],
+ property_versions.list[i],
+ RAZOR_PROPERTY_CONFLICTS);
+
headerGetEntry(h, RPMTAG_BASENAMES, &type,
&basenames.p, &count);
headerGetEntry(h, RPMTAG_DIRNAMES, &type,
}
static int
+command_list_obsoletes(int argc, const char *argv[])
+{
+ struct razor_set *set;
+
+ set = razor_set_open(repo_filename);
+ razor_set_list_properties(set, argv[0], RAZOR_PROPERTY_OBSOLETES);
+ razor_set_destroy(set);
+
+ return 0;
+}
+
+static int
+command_list_conflicts(int argc, const char *argv[])
+{
+ struct razor_set *set;
+
+ set = razor_set_open(repo_filename);
+ razor_set_list_properties(set, argv[0], RAZOR_PROPERTY_CONFLICTS);
+ razor_set_destroy(set);
+
+ return 0;
+}
+
+static int
command_list_files(int argc, const char *argv[])
{
struct razor_set *set;
int (*func)(int argc, const char *argv[]);
} razor_commands[] = {
{ "list", "list all packages", command_list },
- { "list-requires", "list all requires or requires for the given package", command_list_requires },
- { "list-provides", "list all provides or provides for the give package", command_list_provides },
+ { "list-requires", "list all requires for the given package", command_list_requires },
+ { "list-provides", "list all provides for the give package", command_list_provides },
+ { "list-obsoletes", "list all obsoletes for the give package", command_list_obsoletes },
+ { "list-conflicts", "list all conflicts for the give package", command_list_conflicts },
{ "list-files", "list files for package set", command_list_files },
{ "list-file-packages", "list packages owning file", command_list_file_packages },
{ "list-package-files", "list files in package", command_list_package_files },