distroquery: give download link for correct arch in search results

This commit is contained in:
Silvan Calarco 2015-03-30 00:07:31 +02:00
parent c7f47f3adf
commit 779f6a7fe9

View File

@ -616,14 +616,26 @@ void printQueryResponse() {
sqlite3_column_text(statement,1));*/ sqlite3_column_text(statement,1));*/
/* download */ /* download */
printf("<div style='display:inline;background-color:green'>" if (!query_repositories[i]->arch[a]) {
"&nbsp;<a href=\"%s%s/SRPMS.base/%s-%s-%s.src.rpm\" style=\"color:white\">%s</a>&nbsp;</div>", printf("<div style='display:inline;background-color:green'>"
query_repositories[i]->download_prefix, "&nbsp;<a href=\"%s%s/SRPMS.base/%s-%s-%s.src.rpm\" style=\"color:white\">%s</a>&nbsp;</div>",
query_repositories[i]->download_dir, query_repositories[i]->download_prefix,
sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")), query_repositories[i]->download_dir,
sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "version")), sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "release")), sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "version")),
_("Download")); sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "release")),
_("Download"));
} else {
printf("<div style='display:inline;background-color:green'>"
"&nbsp;<a href=\"%s%s/SRPMS.base/%s-%s-%s.%s.rpm\" style=\"color:white\">%s</a>&nbsp;</div>",
query_repositories[i]->download_prefix,
query_repositories[i]->download_dir,
sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "version")),
sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "release")),
query_repositories[i]->arch[a],
_("Download"));
}
/* details */ /* details */
printf("&nbsp;<div style='display:inline;background-color:lightblue;font-weight:strong'>" printf("&nbsp;<div style='display:inline;background-color:lightblue;font-weight:strong'>"