From 779f6a7fe94cd9ca88276ce760e490d2592c2860 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 30 Mar 2015 00:07:31 +0200 Subject: [PATCH] distroquery: give download link for correct arch in search results --- src/distroquery.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/distroquery.c b/src/distroquery.c index 24f15b8..87f12a3 100644 --- a/src/distroquery.c +++ b/src/distroquery.c @@ -616,14 +616,26 @@ void printQueryResponse() { sqlite3_column_text(statement,1));*/ /* download */ - printf("
" - " %s 
", - 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("
" + " %s 
", + 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("
" + " %s 
", + 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(" 
"