distroquery: added specfile link in source and binary packages pages

This commit is contained in:
Silvan Calarco 2013-10-15 14:36:10 +02:00
parent 07d3dbdf7d
commit 0566f3557c

View File

@ -575,6 +575,7 @@ void printPackageData() {
struct configTag* ct = findRepositoryByTag(query_repository); struct configTag* ct = findRepositoryByTag(query_repository);
humanDate strdate; humanDate strdate;
sizeString strsize; sizeString strsize;
FILE *file;
printf("<queryreply><![CDATA["); printf("<queryreply><![CDATA[");
@ -665,6 +666,15 @@ void printPackageData() {
sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "name")), sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "name")),
sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "name"))); sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "name")));
snprintf(buffer, PATH_MAX, "%s/specs/%s.spec", ct->repository_dir, query_package);
if (file = fopen(buffer, "r")) {
fclose(file);
snprintf(buffer, PATH_MAX, "%s%s/specs/%s.spec", ct->showfile_prefix, ct->download_dir, query_package);
printf("<br>%s: <a href=\"%s\" target=_blank>%s.spec</a>", _("Specfile"), buffer, query_package);
} else {
printf("<br>%s: %s.spec", _("Specfile"), query_package);
}
printf("<br>%s: %s", _("Maintainer"), sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, "packagers", "name"))); printf("<br>%s: %s", _("Maintainer"), sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, "packagers", "name")));
printf("<br>%s: %s", _("Build date"), printf("<br>%s: %s", _("Build date"),
simpleTimeToHuman(sqlite3_column_int(stmt1,sqlite3_find_column_id(stmt1, NULL, "buildtime")), (humanDate *) & strdate)); simpleTimeToHuman(sqlite3_column_int(stmt1,sqlite3_find_column_id(stmt1, NULL, "buildtime")), (humanDate *) & strdate));
@ -754,6 +764,7 @@ void printSourcePackageData() {
struct configTag* ct = findRepositoryByTag(query_repository); struct configTag* ct = findRepositoryByTag(query_repository);
humanDate strdate; humanDate strdate;
sizeString strsize; sizeString strsize;
FILE *file;
printf("<queryreply><![CDATA["); printf("<queryreply><![CDATA[");
@ -826,6 +837,7 @@ void printSourcePackageData() {
_("Download")); _("Download"));
printf("<hr><br><b>%s:</b>", _("Developers details")); printf("<hr><br><b>%s:</b>", _("Developers details"));
printf("<br>%s: %s", _("Maintainer"), sqlite3_column_text(statement,sqlite3_find_column_id(statement, "packagers", "name"))); printf("<br>%s: %s", _("Maintainer"), sqlite3_column_text(statement,sqlite3_find_column_id(statement, "packagers", "name")));
printf("<br>%s: %s", _("Build date"), printf("<br>%s: %s", _("Build date"),
simpleTimeToHuman(sqlite3_column_int(statement,sqlite3_find_column_id(statement, NULL, "buildtime")), (humanDate *) & strdate)); simpleTimeToHuman(sqlite3_column_int(statement,sqlite3_find_column_id(statement, NULL, "buildtime")), (humanDate *) & strdate));