Commit c7f47f3adfa3a039c77a2fb855bb9d4640dd38ae

Authored by Silvan Calarco
1 parent 53ac68d8d0
Exists in master

distroquery: make prefix to search page configurable (URL_SEARCH_PREFIX)

Showing 3 changed files with 12 additions and 4 deletions Side-by-side Diff

... ... @@ -585,9 +585,10 @@
585 585 sqlite3_finalize(stmt1);
586 586 }
587 587 if (query_compact) {
588   - printf("<b><a href='/distribution/search.html?"
  588 + printf("<b><a href='%s?"
589 589 "repository=%s&package=%s&arch=%s&searchbox=true' style=\"color:black\" target='distroquery'>"
590 590 "%s</a></b> %s-%s - %s<br>",
  591 + query_repositories[i]->configdefaults->url_search_prefix,
591 592 query_repositories[i]->tag,
592 593 (const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
593 594 query_repositories[i]->arch[a],
594 595  
... ... @@ -660,9 +661,10 @@
660 661  
661 662  
662 663 if (query_compact) {
663   - printf("<a href='/distribution/search.html?"
  664 + printf("<a href='%s?"
664 665 "repository=%s&package=%s&arch=%s&searchbox=true' style=\"color:black\" target='distroquery'>"
665 666 "%s</a> (%s-%s) %s %s<br>",
  667 + query_repositories[i]->configdefaults->url_search_prefix,
666 668 query_repositories[i]->tag,
667 669 sqlite3_column_text(statement,sqlite3_find_column_id(statement, "packages", "name")),
668 670 query_repositories[i]->arch[a],
669 671  
... ... @@ -775,9 +777,10 @@
775 777  
776 778 printf("<br><img class=\"distroqueryimg16\" src=\"%s\" width=\"16\" height=\"16\">&nbsp;", buffer);
777 779 if (query_compact) {
778   - printf("<b><a href='/distribution/search.html?"
  780 + printf("<b><a href='%s?"
779 781 "repository=%s&package=%s&searchbox=true' style=\"color:black\" target='distroquery'>"
780 782 "%s</a></b> %s-%s - %s<br>",
  783 + query_repositories[i]->configdefaults->url_search_prefix,
781 784 query_repositories[i]->tag,
782 785 (const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
783 786 (const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
784 787  
... ... @@ -1015,9 +1018,10 @@
1015 1018 }
1016 1019  
1017 1020 printf("%s <img class=\"distroqueryimg12\" src=\"%s\" width=\"12\" height=\"12\">&nbsp;", strdate, buffer);
1018   - printf("<b><a href='/distribution/search.html?"
  1021 + printf("<b><a href='%s?"
1019 1022 "repository=%s&package=%s&searchbox=true' style=\"color:black\" target='distroquery' title=\"%s\">"
1020 1023 "%s</a></b> %s-%s",
  1024 + query_repositories[i]->configdefaults->url_search_prefix,
1021 1025 ct->tag,
1022 1026 (const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "name")),
1023 1027 htmlcleanNoBr((const char*)sqlite3_column_text(statement,sqlite3_find_column_id(statement, NULL, "summary")),buffer,PATH_MAX),
... ... @@ -249,6 +249,9 @@
249 249 } else if (!strcmp(vartok, "URL_PREFIX")) {
250 250 configdefaults.url_prefix =
251 251 (char *) strdup(valuetok);
  252 + } else if (!strcmp(vartok, "URL_SEARCH_PREFIX")) {
  253 + configdefaults.url_search_prefix =
  254 + (char *) strdup(valuetok);
252 255 } else if (!strcmp(vartok, "URL_DIR")) {
253 256 configdefaults.url_dir =
254 257 (char *) strdup(valuetok);
src/include/distromatic.h
... ... @@ -16,6 +16,7 @@
16 16 char *distribution_name;
17 17 char *url_address;
18 18 char *url_prefix;
  19 + char *url_search_prefix;
19 20 char *url_dir;
20 21 char *arch[ARCHS_MAX];
21 22 };