distroquery: show build required by package and version; also specify version in required by

This commit is contained in:
Silvan Calarco 2013-10-22 11:54:03 +02:00
parent 66862cc5f0
commit 7eb2118595
4 changed files with 144 additions and 79 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: distromatic 1.4.1\n" "Project-Id-Version: distromatic 1.4.1\n"
"Report-Msgid-Bugs-To: silvan.calarco@mambasoft.it\n" "Report-Msgid-Bugs-To: silvan.calarco@mambasoft.it\n"
"POT-Creation-Date: 2013-10-21 21:57+0200\n" "POT-Creation-Date: 2013-10-22 11:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -21,152 +21,160 @@ msgstr ""
msgid "Source" msgid "Source"
msgstr "" msgstr ""
#: src/distroquery.c:266 #: src/distroquery.c:271
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#: src/distroquery.c:300 #: src/distroquery.c:305
msgid "sources" msgid "sources"
msgstr "" msgstr ""
#: src/distroquery.c:304 #: src/distroquery.c:309
msgid "files" msgid "files"
msgstr "" msgstr ""
#: src/distroquery.c:315 #: src/distroquery.c:320
msgid "Search software packages" msgid "Search software packages"
msgstr "" msgstr ""
#: src/distroquery.c:364 #: src/distroquery.c:369
msgid "current path" msgid "current path"
msgstr "" msgstr ""
#: src/distroquery.c:406 #: src/distroquery.c:411
msgid "Provider(s)" msgid "Provider(s)"
msgstr "" msgstr ""
#: src/distroquery.c:542 src/distroquery.c:861 src/distroquery.c:1085 #: src/distroquery.c:547 src/distroquery.c:870 src/distroquery.c:1138
msgid "Download" msgid "Download"
msgstr "" msgstr ""
#: src/distroquery.c:551 #: src/distroquery.c:556
msgid "Details" msgid "Details"
msgstr "" msgstr ""
#: src/distroquery.c:570 src/distroquery.c:620 #: src/distroquery.c:575 src/distroquery.c:629
#, c-format #, c-format
msgid "Other results in " msgid "Other results in "
msgstr "" msgstr ""
#: src/distroquery.c:571 src/distroquery.c:621 #: src/distroquery.c:576 src/distroquery.c:630
#, c-format #, c-format
msgid "Results in" msgid "Results in"
msgstr "" msgstr ""
#: src/distroquery.c:574 src/distroquery.c:624 #: src/distroquery.c:579 src/distroquery.c:633
msgid "for arch " msgid "for arch "
msgstr "" msgstr ""
#: src/distroquery.c:587 src/distroquery.c:596 #: src/distroquery.c:594 src/distroquery.c:605
msgid "provides" msgid "provides"
msgstr "" msgstr ""
#: src/distroquery.c:637 #: src/distroquery.c:646
msgid "provides directory" msgid "provides directory"
msgstr "" msgstr ""
#: src/distroquery.c:639 #: src/distroquery.c:648
msgid "provides symbolic link" msgid "provides symbolic link"
msgstr "" msgstr ""
#: src/distroquery.c:641 #: src/distroquery.c:650
msgid "provides file" msgid "provides file"
msgstr "" msgstr ""
#: src/distroquery.c:729 #: src/distroquery.c:738
msgid "result(s) shown" msgid "result(s) shown"
msgstr "" msgstr ""
#: src/distroquery.c:731 #: src/distroquery.c:740
msgid "result(s) found" msgid "result(s) found"
msgstr "" msgstr ""
#: src/distroquery.c:753 #: src/distroquery.c:762
msgid "Search results for" msgid "Search results for"
msgstr "" msgstr ""
#: src/distroquery.c:826 src/distroquery.c:1047 #: src/distroquery.c:835 src/distroquery.c:1100
msgid "Version" msgid "Version"
msgstr "" msgstr ""
#: src/distroquery.c:831 #: src/distroquery.c:840
msgid "Size" msgid "Size"
msgstr "" msgstr ""
#: src/distroquery.c:834 #: src/distroquery.c:843
msgid "Related packages" msgid "Related packages"
msgstr "" msgstr ""
#: src/distroquery.c:863 src/distroquery.c:1087 #: src/distroquery.c:872 src/distroquery.c:1140
msgid "Developers details" msgid "Developers details"
msgstr "" msgstr ""
#: src/distroquery.c:865 #: src/distroquery.c:874
msgid "Source package" msgid "Source package"
msgstr "" msgstr ""
#: src/distroquery.c:875 src/distroquery.c:877 #: src/distroquery.c:884 src/distroquery.c:886
msgid "Specfile" msgid "Specfile"
msgstr "" msgstr ""
#: src/distroquery.c:880 src/distroquery.c:1089 #: src/distroquery.c:889 src/distroquery.c:1142
msgid "Maintainer" msgid "Maintainer"
msgstr "" msgstr ""
#: src/distroquery.c:881 src/distroquery.c:1090 #: src/distroquery.c:890 src/distroquery.c:1143
msgid "Build date" msgid "Build date"
msgstr "" msgstr ""
#: src/distroquery.c:891 #: src/distroquery.c:900
msgid "Obsoletes" msgid "Obsoletes"
msgstr "" msgstr ""
#: src/distroquery.c:909 #: src/distroquery.c:918
msgid "Provides" msgid "Provides"
msgstr "" msgstr ""
#: src/distroquery.c:927 #: src/distroquery.c:936
msgid "Requires" msgid "Requires"
msgstr "" msgstr ""
#: src/distroquery.c:955 #: src/distroquery.c:967
msgid "Required in" msgid "Required in"
msgstr "" msgstr ""
#: src/distroquery.c:955 #: src/distroquery.c:967 src/distroquery.c:1004
msgid "by" msgid "by"
msgstr "" msgstr ""
#: src/distroquery.c:970 #: src/distroquery.c:974 src/distroquery.c:1010
msgid "requires"
msgstr ""
#: src/distroquery.c:1004
msgid "Build required in"
msgstr ""
#: src/distroquery.c:1023
msgid "Files list" msgid "Files list"
msgstr "" msgstr ""
#: src/distroquery.c:1054 #: src/distroquery.c:1107
msgid "Built packages" msgid "Built packages"
msgstr "" msgstr ""
#: src/distroquery.c:1093 #: src/distroquery.c:1146
msgid "Source files" msgid "Source files"
msgstr "" msgstr ""
#: src/distroquery.c:1103 #: src/distroquery.c:1156
msgid "Patches" msgid "Patches"
msgstr "" msgstr ""
#: src/distroquery.c:1114 #: src/distroquery.c:1167
msgid "Build requirements" msgid "Build requirements"
msgstr "" msgstr ""
#: src/distroquery.c:1128 #: src/distroquery.c:1181
msgid "Changelog" msgid "Changelog"
msgstr "" msgstr ""

BIN
po/it.gmo

Binary file not shown.

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: distromatic 1.4.1\n" "Project-Id-Version: distromatic 1.4.1\n"
"Report-Msgid-Bugs-To: silvan.calarco@mambasoft.it\n" "Report-Msgid-Bugs-To: silvan.calarco@mambasoft.it\n"
"POT-Creation-Date: 2013-10-21 21:57+0200\n" "POT-Creation-Date: 2013-10-22 11:52+0200\n"
"PO-Revision-Date: 2013-10-14 01:19+0200\n" "PO-Revision-Date: 2013-10-14 01:19+0200\n"
"Last-Translator: Silvan Calarco <silvan.calarco@mambasoft.it>\n" "Last-Translator: Silvan Calarco <silvan.calarco@mambasoft.it>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
@ -21,152 +21,160 @@ msgstr ""
msgid "Source" msgid "Source"
msgstr "Sorgente" msgstr "Sorgente"
#: src/distroquery.c:266 #: src/distroquery.c:271
msgid "Search" msgid "Search"
msgstr "Cerca" msgstr "Cerca"
#: src/distroquery.c:300 #: src/distroquery.c:305
msgid "sources" msgid "sources"
msgstr "sorgenti" msgstr "sorgenti"
#: src/distroquery.c:304 #: src/distroquery.c:309
msgid "files" msgid "files"
msgstr "file" msgstr "file"
#: src/distroquery.c:315 #: src/distroquery.c:320
msgid "Search software packages" msgid "Search software packages"
msgstr "Cerca pacchetti software" msgstr "Cerca pacchetti software"
#: src/distroquery.c:364 #: src/distroquery.c:369
msgid "current path" msgid "current path"
msgstr "percorso corrente" msgstr "percorso corrente"
#: src/distroquery.c:406 #: src/distroquery.c:411
msgid "Provider(s)" msgid "Provider(s)"
msgstr "Fornito da" msgstr "Fornito da"
#: src/distroquery.c:542 src/distroquery.c:861 src/distroquery.c:1085 #: src/distroquery.c:547 src/distroquery.c:870 src/distroquery.c:1138
msgid "Download" msgid "Download"
msgstr "Scarica" msgstr "Scarica"
#: src/distroquery.c:551 #: src/distroquery.c:556
msgid "Details" msgid "Details"
msgstr "Dettagli" msgstr "Dettagli"
#: src/distroquery.c:570 src/distroquery.c:620 #: src/distroquery.c:575 src/distroquery.c:629
#, c-format #, c-format
msgid "Other results in " msgid "Other results in "
msgstr "Altri risultati in " msgstr "Altri risultati in "
#: src/distroquery.c:571 src/distroquery.c:621 #: src/distroquery.c:576 src/distroquery.c:630
#, c-format #, c-format
msgid "Results in" msgid "Results in"
msgstr "Risultati in" msgstr "Risultati in"
#: src/distroquery.c:574 src/distroquery.c:624 #: src/distroquery.c:579 src/distroquery.c:633
msgid "for arch " msgid "for arch "
msgstr "per l'architettura " msgstr "per l'architettura "
#: src/distroquery.c:587 src/distroquery.c:596 #: src/distroquery.c:594 src/distroquery.c:605
msgid "provides" msgid "provides"
msgstr "fornisce" msgstr "fornisce"
#: src/distroquery.c:637 #: src/distroquery.c:646
msgid "provides directory" msgid "provides directory"
msgstr "fornisce la cartella" msgstr "fornisce la cartella"
#: src/distroquery.c:639 #: src/distroquery.c:648
msgid "provides symbolic link" msgid "provides symbolic link"
msgstr "fornisce il link simbolico" msgstr "fornisce il link simbolico"
#: src/distroquery.c:641 #: src/distroquery.c:650
msgid "provides file" msgid "provides file"
msgstr "fornisce il file" msgstr "fornisce il file"
#: src/distroquery.c:729 #: src/distroquery.c:738
msgid "result(s) shown" msgid "result(s) shown"
msgstr "risultati mostrati" msgstr "risultati mostrati"
#: src/distroquery.c:731 #: src/distroquery.c:740
msgid "result(s) found" msgid "result(s) found"
msgstr "risultati trovati" msgstr "risultati trovati"
#: src/distroquery.c:753 #: src/distroquery.c:762
msgid "Search results for" msgid "Search results for"
msgstr "Risultati della ricerca per" msgstr "Risultati della ricerca per"
#: src/distroquery.c:826 src/distroquery.c:1047 #: src/distroquery.c:835 src/distroquery.c:1100
msgid "Version" msgid "Version"
msgstr "Versione" msgstr "Versione"
#: src/distroquery.c:831 #: src/distroquery.c:840
msgid "Size" msgid "Size"
msgstr "Dimensione" msgstr "Dimensione"
#: src/distroquery.c:834 #: src/distroquery.c:843
msgid "Related packages" msgid "Related packages"
msgstr "Pacchetti collegati" msgstr "Pacchetti collegati"
#: src/distroquery.c:863 src/distroquery.c:1087 #: src/distroquery.c:872 src/distroquery.c:1140
msgid "Developers details" msgid "Developers details"
msgstr "Dettagli per gli sviluppatori" msgstr "Dettagli per gli sviluppatori"
#: src/distroquery.c:865 #: src/distroquery.c:874
msgid "Source package" msgid "Source package"
msgstr "Pacchetto sorgente" msgstr "Pacchetto sorgente"
#: src/distroquery.c:875 src/distroquery.c:877 #: src/distroquery.c:884 src/distroquery.c:886
msgid "Specfile" msgid "Specfile"
msgstr "Specfile" msgstr "Specfile"
#: src/distroquery.c:880 src/distroquery.c:1089 #: src/distroquery.c:889 src/distroquery.c:1142
msgid "Maintainer" msgid "Maintainer"
msgstr "Manutentore" msgstr "Manutentore"
#: src/distroquery.c:881 src/distroquery.c:1090 #: src/distroquery.c:890 src/distroquery.c:1143
msgid "Build date" msgid "Build date"
msgstr "Data di compilazione" msgstr "Data di compilazione"
#: src/distroquery.c:891 #: src/distroquery.c:900
msgid "Obsoletes" msgid "Obsoletes"
msgstr "Rende obsoleti" msgstr "Rende obsoleti"
#: src/distroquery.c:909 #: src/distroquery.c:918
msgid "Provides" msgid "Provides"
msgstr "Fornisce" msgstr "Fornisce"
#: src/distroquery.c:927 #: src/distroquery.c:936
msgid "Requires" msgid "Requires"
msgstr "Richiede" msgstr "Richiede"
#: src/distroquery.c:955 #: src/distroquery.c:967
msgid "Required in" msgid "Required in"
msgstr "Richiesto in" msgstr "Richiesto in"
#: src/distroquery.c:955 #: src/distroquery.c:967 src/distroquery.c:1004
msgid "by" msgid "by"
msgstr "da" msgstr "da"
#: src/distroquery.c:970 #: src/distroquery.c:974 src/distroquery.c:1010
msgid "requires"
msgstr "richiede"
#: src/distroquery.c:1004
msgid "Build required in"
msgstr "Richiesto per la compilazione in"
#: src/distroquery.c:1023
msgid "Files list" msgid "Files list"
msgstr "Lista dei file" msgstr "Lista dei file"
#: src/distroquery.c:1054 #: src/distroquery.c:1107
msgid "Built packages" msgid "Built packages"
msgstr "Pacchetti compilati" msgstr "Pacchetti compilati"
#: src/distroquery.c:1093 #: src/distroquery.c:1146
msgid "Source files" msgid "Source files"
msgstr "File sorgenti" msgstr "File sorgenti"
#: src/distroquery.c:1103 #: src/distroquery.c:1156
msgid "Patches" msgid "Patches"
msgstr "Patch" msgstr "Patch"
#: src/distroquery.c:1114 #: src/distroquery.c:1167
msgid "Build requirements" msgid "Build requirements"
msgstr "Requisiti per la compilazione" msgstr "Requisiti per la compilazione"
#: src/distroquery.c:1128 #: src/distroquery.c:1181
msgid "Changelog" msgid "Changelog"
msgstr "Modifiche" msgstr "Modifiche"

View File

@ -241,6 +241,11 @@ void attachCtDatabases(struct configTag* ct, sqlite3 *db, char* arch) {
if (sqlite3_exec(db, sql, NULL, NULL, &errmsg)) { if (sqlite3_exec(db, sql, NULL, NULL, &errmsg)) {
fprintf(stderr, "ERROR: unable to exec statement for %s: %s\n", sql, errmsg); fprintf(stderr, "ERROR: unable to exec statement for %s: %s\n", sql, errmsg);
} }
snprintf(dbname, PATH_MAX, "%s%s-sources.db", ct->repository[i]->repository_dir, ct->repository[i]->tag);
snprintf(sql, PATH_MAX, "ATTACH DATABASE '%s' as '%s_sources'", dbname, ct->repository[i]->tag);
if (sqlite3_exec(db, sql, NULL, NULL, &errmsg)) {
fprintf(stderr, "ERROR: unable to exec statement for %s: %s\n", sql, errmsg);
}
i++; i++;
} }
} }
@ -942,7 +947,10 @@ void printPackageData() {
i=0; i=0;
while (ct->repository[i]) { while (ct->repository[i]) {
snprintf(sql, PATH_MAX, snprintf(sql, PATH_MAX,
"SELECT * FROM '%s'.packages AS packagesup,'%s'.requires AS requiresup," "SELECT packagesup.name AS requiredbyname, "
"requiresup.requireflags AS requiredflags, "
"requiresup.requireversion AS requiredversion "
"FROM '%s'.packages AS packagesup,'%s'.requires AS requiresup,"
"'%s'.provided AS providedup,provided,provides " "'%s'.provided AS providedup,provided,provides "
"WHERE provides.id_package=%d AND provided.id=provides.id_provided " "WHERE provides.id_package=%d AND provided.id=provides.id_provided "
"AND packagesup.id=requiresup.id_package " "AND packagesup.id=requiresup.id_package "
@ -959,9 +967,50 @@ void printPackageData() {
if (j++ == 0) printf("<br><br>%s %s %s:",_("Required in"),ct->repository[i]->tag,_("by")); if (j++ == 0) printf("<br><br>%s %s %s:",_("Required in"),ct->repository[i]->tag,_("by"));
printf(" <a href=#reply onclick='distroquery_request(\"repository=%s&package=%s&arch=%s\")'>%s</a>", printf(" <a href=#reply onclick='distroquery_request(\"repository=%s&package=%s&arch=%s\")'>%s</a>",
ct->repository[i]->tag, ct->repository[i]->tag,
sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "name")), sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "requiredbyname")),
query_arch, query_arch,
sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "name"))); sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "requiredbyname")));
if (sqlite3_column_int(stmt1,sqlite3_find_column_id(stmt1, NULL, "requiredversion"))) {
printf("(%s %s", _("requires"), query_package);
printRPMFlags(sqlite3_column_int(stmt1,sqlite3_find_column_id(stmt1, NULL, "requiredflags")));
printf("%s)", sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "requiredversion")));
}
}
sqlite3_finalize(stmt1);
}
i++;
}
/* build required by */
i=0;
while (ct->repository[i]) {
snprintf(sql, PATH_MAX,
"SELECT sourcesup.name as buildrequiredbyname, "
"buildrequiresup.buildrequireflags as buildrequireflags, "
"buildrequiresup.buildrequireversion as buildrequireversion "
"FROM '%s_sources'.sources AS sourcesup,'%s_sources'.buildrequires AS buildrequiresup,"
"provided,provides "
"WHERE provides.id_package=%d AND provided.id=provides.id_provided "
"AND sourcesup.id=buildrequiresup.id_source "
"AND buildrequiresup.buildrequirename=provided.name "
// "AND NOT packagesup.name='%s' "
// "GROUP BY packagesup.name "
"ORDER BY sourcesup.name",
ct->repository[i]->tag, ct->repository[i]->tag,
sqlite3_column_int(statement,sqlite3_find_column_id(statement, NULL, "id")));
if (sqlite3_prepare_v2(db, sql, strlen(sql), &stmt1, NULL) == SQLITE_OK) {
j=0;
while (sqlite3_step(stmt1) == SQLITE_ROW) {
if (j++ == 0) printf("<br><br>%s %s %s:",_("Build required in"),ct->repository[i]->tag,_("by"));
printf(" <a href=#reply onclick='distroquery_request(\"repository=%s&package=%s\")'>%s</a>",
ct->repository[i]->tag,
sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "buildrequiredbyname")),
sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "buildrequiredbyname")));
if (sqlite3_column_int(stmt1,sqlite3_find_column_id(stmt1, NULL, "buildrequireversion"))) {
printf("(%s %s", _("requires"), query_package);
printRPMFlags(sqlite3_column_int(stmt1,sqlite3_find_column_id(stmt1, NULL, "buildrequireflags")));
printf("%s)", sqlite3_column_text(stmt1,sqlite3_find_column_id(stmt1, NULL, "buildrequireversion")));
}
} }
sqlite3_finalize(stmt1); sqlite3_finalize(stmt1);
} }