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 ""
"Project-Id-Version: distromatic 1.4.1\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -21,152 +21,160 @@ msgstr ""
msgid "Source"
msgstr ""
#: src/distroquery.c:266
#: src/distroquery.c:271
msgid "Search"
msgstr ""
#: src/distroquery.c:300
#: src/distroquery.c:305
msgid "sources"
msgstr ""
#: src/distroquery.c:304
#: src/distroquery.c:309
msgid "files"
msgstr ""
#: src/distroquery.c:315
#: src/distroquery.c:320
msgid "Search software packages"
msgstr ""
#: src/distroquery.c:364
#: src/distroquery.c:369
msgid "current path"
msgstr ""
#: src/distroquery.c:406
#: src/distroquery.c:411
msgid "Provider(s)"
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"
msgstr ""
#: src/distroquery.c:551
#: src/distroquery.c:556
msgid "Details"
msgstr ""
#: src/distroquery.c:570 src/distroquery.c:620
#: src/distroquery.c:575 src/distroquery.c:629
#, c-format
msgid "Other results in "
msgstr ""
#: src/distroquery.c:571 src/distroquery.c:621
#: src/distroquery.c:576 src/distroquery.c:630
#, c-format
msgid "Results in"
msgstr ""
#: src/distroquery.c:574 src/distroquery.c:624
#: src/distroquery.c:579 src/distroquery.c:633
msgid "for arch "
msgstr ""
#: src/distroquery.c:587 src/distroquery.c:596
#: src/distroquery.c:594 src/distroquery.c:605
msgid "provides"
msgstr ""
#: src/distroquery.c:637
#: src/distroquery.c:646
msgid "provides directory"
msgstr ""
#: src/distroquery.c:639
#: src/distroquery.c:648
msgid "provides symbolic link"
msgstr ""
#: src/distroquery.c:641
#: src/distroquery.c:650
msgid "provides file"
msgstr ""
#: src/distroquery.c:729
#: src/distroquery.c:738
msgid "result(s) shown"
msgstr ""
#: src/distroquery.c:731
#: src/distroquery.c:740
msgid "result(s) found"
msgstr ""
#: src/distroquery.c:753
#: src/distroquery.c:762
msgid "Search results for"
msgstr ""
#: src/distroquery.c:826 src/distroquery.c:1047
#: src/distroquery.c:835 src/distroquery.c:1100
msgid "Version"
msgstr ""
#: src/distroquery.c:831
#: src/distroquery.c:840
msgid "Size"
msgstr ""
#: src/distroquery.c:834
#: src/distroquery.c:843
msgid "Related packages"
msgstr ""
#: src/distroquery.c:863 src/distroquery.c:1087
#: src/distroquery.c:872 src/distroquery.c:1140
msgid "Developers details"
msgstr ""
#: src/distroquery.c:865
#: src/distroquery.c:874
msgid "Source package"
msgstr ""
#: src/distroquery.c:875 src/distroquery.c:877
#: src/distroquery.c:884 src/distroquery.c:886
msgid "Specfile"
msgstr ""
#: src/distroquery.c:880 src/distroquery.c:1089
#: src/distroquery.c:889 src/distroquery.c:1142
msgid "Maintainer"
msgstr ""
#: src/distroquery.c:881 src/distroquery.c:1090
#: src/distroquery.c:890 src/distroquery.c:1143
msgid "Build date"
msgstr ""
#: src/distroquery.c:891
#: src/distroquery.c:900
msgid "Obsoletes"
msgstr ""
#: src/distroquery.c:909
#: src/distroquery.c:918
msgid "Provides"
msgstr ""
#: src/distroquery.c:927
#: src/distroquery.c:936
msgid "Requires"
msgstr ""
#: src/distroquery.c:955
#: src/distroquery.c:967
msgid "Required in"
msgstr ""
#: src/distroquery.c:955
#: src/distroquery.c:967 src/distroquery.c:1004
msgid "by"
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"
msgstr ""
#: src/distroquery.c:1054
#: src/distroquery.c:1107
msgid "Built packages"
msgstr ""
#: src/distroquery.c:1093
#: src/distroquery.c:1146
msgid "Source files"
msgstr ""
#: src/distroquery.c:1103
#: src/distroquery.c:1156
msgid "Patches"
msgstr ""
#: src/distroquery.c:1114
#: src/distroquery.c:1167
msgid "Build requirements"
msgstr ""
#: src/distroquery.c:1128
#: src/distroquery.c:1181
msgid "Changelog"
msgstr ""

BIN
po/it.gmo

Binary file not shown.

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: distromatic 1.4.1\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"
"Last-Translator: Silvan Calarco <silvan.calarco@mambasoft.it>\n"
"Language-Team: Italian\n"
@ -21,152 +21,160 @@ msgstr ""
msgid "Source"
msgstr "Sorgente"
#: src/distroquery.c:266
#: src/distroquery.c:271
msgid "Search"
msgstr "Cerca"
#: src/distroquery.c:300
#: src/distroquery.c:305
msgid "sources"
msgstr "sorgenti"
#: src/distroquery.c:304
#: src/distroquery.c:309
msgid "files"
msgstr "file"
#: src/distroquery.c:315
#: src/distroquery.c:320
msgid "Search software packages"
msgstr "Cerca pacchetti software"
#: src/distroquery.c:364
#: src/distroquery.c:369
msgid "current path"
msgstr "percorso corrente"
#: src/distroquery.c:406
#: src/distroquery.c:411
msgid "Provider(s)"
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"
msgstr "Scarica"
#: src/distroquery.c:551
#: src/distroquery.c:556
msgid "Details"
msgstr "Dettagli"
#: src/distroquery.c:570 src/distroquery.c:620
#: src/distroquery.c:575 src/distroquery.c:629
#, c-format
msgid "Other results in "
msgstr "Altri risultati in "
#: src/distroquery.c:571 src/distroquery.c:621
#: src/distroquery.c:576 src/distroquery.c:630
#, c-format
msgid "Results in"
msgstr "Risultati in"
#: src/distroquery.c:574 src/distroquery.c:624
#: src/distroquery.c:579 src/distroquery.c:633
msgid "for arch "
msgstr "per l'architettura "
#: src/distroquery.c:587 src/distroquery.c:596
#: src/distroquery.c:594 src/distroquery.c:605
msgid "provides"
msgstr "fornisce"
#: src/distroquery.c:637
#: src/distroquery.c:646
msgid "provides directory"
msgstr "fornisce la cartella"
#: src/distroquery.c:639
#: src/distroquery.c:648
msgid "provides symbolic link"
msgstr "fornisce il link simbolico"
#: src/distroquery.c:641
#: src/distroquery.c:650
msgid "provides file"
msgstr "fornisce il file"
#: src/distroquery.c:729
#: src/distroquery.c:738
msgid "result(s) shown"
msgstr "risultati mostrati"
#: src/distroquery.c:731
#: src/distroquery.c:740
msgid "result(s) found"
msgstr "risultati trovati"
#: src/distroquery.c:753
#: src/distroquery.c:762
msgid "Search results for"
msgstr "Risultati della ricerca per"
#: src/distroquery.c:826 src/distroquery.c:1047
#: src/distroquery.c:835 src/distroquery.c:1100
msgid "Version"
msgstr "Versione"
#: src/distroquery.c:831
#: src/distroquery.c:840
msgid "Size"
msgstr "Dimensione"
#: src/distroquery.c:834
#: src/distroquery.c:843
msgid "Related packages"
msgstr "Pacchetti collegati"
#: src/distroquery.c:863 src/distroquery.c:1087
#: src/distroquery.c:872 src/distroquery.c:1140
msgid "Developers details"
msgstr "Dettagli per gli sviluppatori"
#: src/distroquery.c:865
#: src/distroquery.c:874
msgid "Source package"
msgstr "Pacchetto sorgente"
#: src/distroquery.c:875 src/distroquery.c:877
#: src/distroquery.c:884 src/distroquery.c:886
msgid "Specfile"
msgstr "Specfile"
#: src/distroquery.c:880 src/distroquery.c:1089
#: src/distroquery.c:889 src/distroquery.c:1142
msgid "Maintainer"
msgstr "Manutentore"
#: src/distroquery.c:881 src/distroquery.c:1090
#: src/distroquery.c:890 src/distroquery.c:1143
msgid "Build date"
msgstr "Data di compilazione"
#: src/distroquery.c:891
#: src/distroquery.c:900
msgid "Obsoletes"
msgstr "Rende obsoleti"
#: src/distroquery.c:909
#: src/distroquery.c:918
msgid "Provides"
msgstr "Fornisce"
#: src/distroquery.c:927
#: src/distroquery.c:936
msgid "Requires"
msgstr "Richiede"
#: src/distroquery.c:955
#: src/distroquery.c:967
msgid "Required in"
msgstr "Richiesto in"
#: src/distroquery.c:955
#: src/distroquery.c:967 src/distroquery.c:1004
msgid "by"
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"
msgstr "Lista dei file"
#: src/distroquery.c:1054
#: src/distroquery.c:1107
msgid "Built packages"
msgstr "Pacchetti compilati"
#: src/distroquery.c:1093
#: src/distroquery.c:1146
msgid "Source files"
msgstr "File sorgenti"
#: src/distroquery.c:1103
#: src/distroquery.c:1156
msgid "Patches"
msgstr "Patch"
#: src/distroquery.c:1114
#: src/distroquery.c:1167
msgid "Build requirements"
msgstr "Requisiti per la compilazione"
#: src/distroquery.c:1128
#: src/distroquery.c:1181
msgid "Changelog"
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)) {
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++;
}
}
@ -942,7 +947,10 @@ void printPackageData() {
i=0;
while (ct->repository[i]) {
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 "
"WHERE provides.id_package=%d AND provided.id=provides.id_provided "
"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"));
printf(" <a href=#reply onclick='distroquery_request(\"repository=%s&package=%s&arch=%s\")'>%s</a>",
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,
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);
}