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));*/
/* download */
printf("<div style='display:inline;background-color:green'>"
"&nbsp;<a href=\"%s%s/SRPMS.base/%s-%s-%s.src.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")),
_("Download"));
if (!query_repositories[i]->arch[a]) {
printf("<div style='display:inline;background-color:green'>"
"&nbsp;<a href=\"%s%s/SRPMS.base/%s-%s-%s.src.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")),
_("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 */
printf("&nbsp;<div style='display:inline;background-color:lightblue;font-weight:strong'>"