Commit 779f6a7fe94cd9ca88276ce760e490d2592c2860
1 parent
c7f47f3adf
Exists in
master
distroquery: give download link for correct arch in search results
Showing 1 changed file with 20 additions and 8 deletions Side-by-side Diff
src/distroquery.c
... | ... | @@ -616,14 +616,26 @@ |
616 | 616 | sqlite3_column_text(statement,1));*/ |
617 | 617 | |
618 | 618 | /* download */ |
619 | - printf("<div style='display:inline;background-color:green'>" | |
620 | - " <a href=\"%s%s/SRPMS.base/%s-%s-%s.src.rpm\" style=\"color:white\">%s</a> </div>", | |
621 | - query_repositories[i]->download_prefix, | |
622 | - query_repositories[i]->download_dir, | |
623 | - sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")), | |
624 | - sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "version")), | |
625 | - sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "release")), | |
626 | - _("Download")); | |
619 | + if (!query_repositories[i]->arch[a]) { | |
620 | + printf("<div style='display:inline;background-color:green'>" | |
621 | + " <a href=\"%s%s/SRPMS.base/%s-%s-%s.src.rpm\" style=\"color:white\">%s</a> </div>", | |
622 | + query_repositories[i]->download_prefix, | |
623 | + query_repositories[i]->download_dir, | |
624 | + sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")), | |
625 | + sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "version")), | |
626 | + sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "release")), | |
627 | + _("Download")); | |
628 | + } else { | |
629 | + printf("<div style='display:inline;background-color:green'>" | |
630 | + " <a href=\"%s%s/SRPMS.base/%s-%s-%s.%s.rpm\" style=\"color:white\">%s</a> </div>", | |
631 | + query_repositories[i]->download_prefix, | |
632 | + query_repositories[i]->download_dir, | |
633 | + sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")), | |
634 | + sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "version")), | |
635 | + sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "release")), | |
636 | + query_repositories[i]->arch[a], | |
637 | + _("Download")); | |
638 | + } | |
627 | 639 | |
628 | 640 | /* details */ |
629 | 641 | printf(" <div style='display:inline;background-color:lightblue;font-weight:strong'>" |