From 7eb2118595efbc5c7b8ae871d04982b0a54490af Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 22 Oct 2013 11:54:03 +0200 Subject: [PATCH] distroquery: show build required by package and version; also specify version in required by --- po/distromatic.pot | 84 +++++++++++++++++++++++++-------------------- po/it.gmo | Bin 2297 -> 2422 bytes po/it.po | 84 +++++++++++++++++++++++++-------------------- src/distroquery.c | 55 +++++++++++++++++++++++++++-- 4 files changed, 144 insertions(+), 79 deletions(-) diff --git a/po/distromatic.pot b/po/distromatic.pot index 668bec3..c7d8e94 100644 --- a/po/distromatic.pot +++ b/po/distromatic.pot @@ -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 \n" "Language-Team: LANGUAGE \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 "" diff --git a/po/it.gmo b/po/it.gmo index 446d974cf5d2334bb46ea2c0a2c46c0d34084d61..737ef99c0a570107d28b35d34d3d77168ab08f38 100644 GIT binary patch delta 1000 zcmXxiPe>GD7{~Ev-JRJf%iPsX%dIy5W`xTMf>=?M^>zJSWad)NQbxrWN*XVky4fh5zuqc*UOT((Q4O#BPTzrJxB z$3BU@s247yCKyL8bkp@uBblr%LetJs1}Tl`r=iR!I_lIirXO1y?{R%vLzz9R@2?Z< zJ9bkPXDB+ocFxaRiZVZ2^*j&lnI40>uG0==yMIF zCPQhhOhnVMLMFVwayPmd@n;@|v&Fee;Ju3vXL7l*k>Qmk??NO9Z{G=va}OU>s(yP^ RZ*Tg4BfdHd#mYvI{SS0@Q#b$s delta 931 zcmXxjPe@cj9KiA4u5P=V_Q$m{Ypb==3MAM-0_l?7q>B{ZiUb!DHYCwght-QnL{t)m zmpleR1bYdJ4iyx1vWu7O)H$M1=v3eDG7kHj&%AkW=FR-(?N;e;SL1uB{c%uE5oO|P zCSnNhWvM7P+9G!11eUOlyRm^qypMT&n(nV+f$JtZ?rriD`utby!f(j9M*O7FLB|$4 zFxwun7dz1YGTMI{ov?~K@B+G^OL!2+kzY(xd4Co=@eaD+C3K!A=z>=<%lqRw4Ig}g zIed+-^c_0jGy0-6+=V~z0RF~3SY(j)q7$FN2V}8|`?!A3YL4JKcH<^Gf02g^yg#~W z_&^z*V3^7kkDwVCOV`)X3F^q)F^^_s5nbrRbbkfi(96{SCS89-$F1RET*ro~`$NNt zI+?|ZdZ^rK1>O1C)PFHKihdqf(6byzk`Xu21>Qn_u|Q=8?xIKf3=iQebljH$`S%4I zbnuH`RAerW5tie`0O7+f(Bg|MM~Pm-kJhnfte>#Bc#p(mIzjXhF2LdfE$o?M{we8W zZ>5LhY5f~oH>moy8%cLy);t=|k?%H65+0$utq`VnKjG#)iWr%js!vuXCuVD@Ia9km mH#JjherS7?S-zfI$yY1qs>4I)oBwiyndasEW@dS`IQSo^cuPY7 diff --git a/po/it.po b/po/it.po index 80bd80a..73aed6d 100644 --- a/po/it.po +++ b/po/it.po @@ -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 \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" diff --git a/src/distroquery.c b/src/distroquery.c index 98ace8d..bd45adc 100644 --- a/src/distroquery.c +++ b/src/distroquery.c @@ -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("

%s %s %s:",_("Required in"),ct->repository[i]->tag,_("by")); printf(" %s", 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("

%s %s %s:",_("Build required in"),ct->repository[i]->tag,_("by")); + printf(" %s", + 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); }