rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

tools/rpmdeps.c
Go to the documentation of this file.

    00001 #include "system.h"
    00002 const char *__progname;
    00003
    00004 #include <rpmio.h>
    00005 #include <rpmiotypes.h>
    00006 #include <rpmcb.h>
    00007 #include <argv.h>
    00008 #include <rpmtypes.h>
    00009 #include <rpmtag.h>
    00010
    00011 #include <rpmds.h>
    00012 #define _RPMFC_INTERNAL         /* XXX for debugging */
    00013 #include <rpmfc.h>
    00014
    00015 #include <rpmcli.h>
    00016
    00017 #include "debug.h"
    00018
    00019 /*@unchecked@*/
    00020 char *progname;
    00021
    00022 #define RPMDEP_RPMFC            1
    00023 #define RPMDEP_RPMDSCPUINFO     2
    00024 #define RPMDEP_RPMDSRPMLIB      3
    00025 #define RPMDEP_RPMDSSYSINFO     4
    00026 #define RPMDEP_RPMDSGETCONF     5
    00027 #define RPMDEP_RPMDSELF         6
    00028 #define RPMDEP_RPMDSLDCONFIG    7
    00029 #define RPMDEP_RPMDSUNAME       8
    00030 #define RPMDEP_RPMDSPIPE        9
    00031
    00032 #define RPMDEP_RPMDSPERL        10
    00033 #define RPMDEP_RPMDSPYTHON      11
    00034 #define RPMDEP_RPMDSLIBTOOL     12
    00035 #define RPMDEP_RPMDSPKGCONFIG   13
    00036
    00037 #define RPMDEP_RPMDSPUBKEY      14
    00038 #define RPMDEP_RPMDSARCH        15
    00039 #define RPMDEP_RPMDSFILE        16
    00040 #define RPMDEP_RPMDSSONAME      17
    00041 #define RPMDEP_RPMDSPACKAGE     18
    00042
    00043 #define RPMDEP_RPMDSJAVA        20
    00044 #define RPMDEP_RPMDSRUBY        21
    00045 #define RPMDEP_RPMDSPHP         22
    00046
    00047 #define RPMDEP_RPMDSDPKGRPM     32
    00048 #define RPMDEP_RPMDSRPMDPKG     33
    00049
    00050 /*@unchecked@*/
    00051 static int rpmdeps_mode = RPMDEP_RPMFC;
    00052
    00053 /*@unchecked@*/
    00054 static int print_provides = 1;
    00055
    00056 /*@unchecked@*/
    00057 static int print_requires = 1;
    00058
    00059 /*@unchecked@*/
    00060 static int print_closure = 0;
    00061
    00062 #define _PERL_PROVIDES  "/usr/bin/find /usr/lib/perl5 | /usr/lib/rpm/perl.prov"
    00063 /*@unchecked@*/ /*@observer@*/
    00064 static const char * _perl_provides = _PERL_PROVIDES;
    00065
    00066 #define _PERL_REQUIRES  "rpm -qa --fileclass | grep 'perl script' | sed -e 's/\t.*$//' | /usr/lib/rpm/perl.req"
    00067 /*@unchecked@*/ /*@observer@*/
    00068 static const char * _perl_requires = _PERL_REQUIRES;
    00069
    00070 #define _JAVA_PROVIDES  "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -P"
    00071 /*@unchecked@*/ /*@observer@*/
    00072 static const char * _java_provides = _JAVA_PROVIDES;
    00073
    00074 #define _JAVA_REQUIRES  "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -R"
    00075 /*@unchecked@*/ /*@observer@*/
    00076 static const char * _java_requires = _JAVA_REQUIRES;
    00077
    00078 #define _LIBTOOL_PROVIDES  "/usr/bin/find /usr/lib -name '*.la' | /usr/lib/rpm/libtooldeps.sh -P /"
    00079 /*@unchecked@*/ /*@observer@*/
    00080 static const char * _libtool_provides = _LIBTOOL_PROVIDES;
    00081
    00082 #define _LIBTOOL_REQUIRES  "rpm -qal | grep '\\.la$' | /usr/lib/rpm/libtooldeps.sh -R /"
    00083 /*@unchecked@*/ /*@observer@*/
    00084 static const char * _libtool_requires = _LIBTOOL_REQUIRES;
    00085
    00086 #define _PKGCONFIG_PROVIDES  "/usr/bin/find /usr/lib -name '*.pc' | /usr/lib/rpm/pkgconfigdeps.sh -P"
    00087 static const char * _pkgconfig_provides = _PKGCONFIG_PROVIDES;
    00088
    00089 #define _PKGCONFIG_REQUIRES  "rpm -qal | grep '\\.pc$' | /usr/lib/rpm/pkgconfigdeps.sh -R"
    00090 static const char * _pkgconfig_requires = _PKGCONFIG_REQUIRES;
    00091
    00092 #define _DPKG_PROVIDES  "egrep '^(Package|Status|Version|Provides):' /var/lib/dpkg/status | sed -e '\n\
    00093 /^Package: / {\n\
    00094         N\n\
    00095         /not-installed/d\n\
    00096         N\n\
    00097         s|^Package: \\([^\\n]*\\)\\n[^\\n]*\\nVersion: \\(.*\\)$|\\1 = \\2|\n\
    00098 }\n\
    00099 /^Provides: / {\n\
    00100         s|^Provides: ||\n\
    00101         s|, |\\n|g\n\
    00102 }' | sed -f /usr/lib/rpm/dpkg2fc.sed | sort -u | tee /tmp/dpkg"
    00103 static const char * _dpkg_provides = _DPKG_PROVIDES;
    00104
    00105 #define _DPKG_REQUIRES "egrep '^(Package|Status|Pre-Depends|Depends):' /var/lib/dpkg/status | sed -e '\n\
    00106 /^Package: / {\n\
    00107         N\n\
    00108         /not-installed/d\n\
    00109         s|^Package: [^\\n]*\\n.*$||\n\
    00110 }\n\
    00111 /^Depends: / {\n\
    00112         s|^Depends: ||\n\
    00113         s|(\\([^)]*\\))|\\1|g\n\
    00114         s|>>|>|\n\
    00115         s|<<|<|\n\
    00116         s|, |\\n|g\n\
    00117 }\n\
    00118 /^Pre-Depends: / {\n\
    00119         s|^Pre-Depends: ||\n\
    00120         s|(\\([^)]*\\))|\\1|g\n\
    00121         s|>>|>|\n\
    00122         s|<<|<|\n\
    00123         s|, |\\n|g\n\
    00124 }' | sed -f /usr/lib/rpm/dpkg2fc.sed | sed -e 's/ |.*$//' | sort -u | tee /tmp/dpkg"
    00125 static const char * _dpkg_requires = _DPKG_REQUIRES;
    00126
    00127 #define _RPMDB_PACKAGE_PROVIDES  "rpm -qa --qf '%{name} = %|epoch?{%{epoch}:}|%{version}-%{release}\n' | sort -u"
    00128 static const char * _rpmdb_package_provides = _RPMDB_PACKAGE_PROVIDES;
    00129
    00130 #define _RPMDB_PACKAGE_REQUIRES  "rpm -qa --requires | sort -u | sed -e '/^\\//d' -e '/.*\\.so.*/d' -e '/^%/d' -e '/^.*(.*)/d'"
    00131 static const char * _rpmdb_package_requires = _RPMDB_PACKAGE_REQUIRES;
    00132
    00133 #define _RPMDB_SONAME_REQUIRES  "rpm -qa --requires | grep -v '^/' | grep '.*\\.so.*' | sort -u"
    00134 static const char * _rpmdb_soname_requires = _RPMDB_SONAME_REQUIRES;
    00135
    00136 #define _RPMDB_FILE_REQUIRES  "rpm -qa --requires | grep '^/' | sort -u"
    00137 static const char * _rpmdb_file_requires = _RPMDB_FILE_REQUIRES;
    00138
    00139 static int rpmdepPrint(const char * msg, rpmds ds, FILE * fp)
    00140 {
    00141     if (fp == NULL) fp = stderr;
    00142
    00143     if (msg)
    00144         fprintf(fp, "===================================== %s\n", msg);
    00145
    00146     ds = rpmdsInit(ds);
    00147     while (rpmdsNext(ds) >= 0) {
    00148         if (_rpmfc_debug || rpmIsDebug())
    00149             fprintf(fp, "%6d\t", rpmdsIx(ds));
    00150         if (_rpmfc_debug || rpmIsVerbose())
    00151             fprintf(fp, "%s: ", rpmdsType(ds));
    00152         fprintf(fp, "%s\n", rpmdsDNEVR(ds)+2);
    00153     }
    00154     return 0;
    00155 }
    00156
    00157 static struct poptOption optionsTable[] = {
    00158
    00159  { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
    00160         N_("Common options:"),
    00161         NULL },
    00162
    00163  { "cpuinfo",   0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSCPUINFO,
    00164         N_("print cpuinfo(...) dependency set"), NULL },
    00165  { "rpmlib",    0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSRPMLIB,
    00166         N_("print rpmlib(...) dependency set"), NULL },
    00167  { "sysinfo",   0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSSYSINFO,
    00168         N_("print /etc/rpm/sysinfo dependency set"), NULL },
    00169  { "getconf",   0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSGETCONF,
    00170         N_("print getconf(...) dependency set"), NULL },
    00171  { "elf",       0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSELF,
    00172         N_("print soname(...) dependencies for elf files"), NULL },
    00173  { "ldconfig",  0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSLDCONFIG,
    00174         N_("print soname(...) dependencies from /etc/ld.so.cache"), NULL },
    00175  { "uname",     0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSUNAME,
    00176         N_("print uname(...) dependency set"), NULL },
    00177  { "pipe",      0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSPIPE,
    00178         N_("print dependency set from a command pipe"), NULL },
    00179
    00180  { "perl",      0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSPERL,
    00181         N_("print perl(...) dependency set"), NULL },
    00182  { "python",    0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSPYTHON,
    00183         N_("print python(...) dependency set"), NULL },
    00184  { "libtool",   0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSLIBTOOL,
    00185         N_("print libtool(...) dependency set"), NULL },
    00186  { "pkgconfig", 0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSPKGCONFIG,
    00187         N_("print pkgconfig(...) dependency set"), NULL },
    00188
    00189  { "pubkey",    0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSPUBKEY,
    00190         N_("print pubkey(...) dependency set"), NULL },
    00191  { "arch",      0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSARCH,
    00192         N_("print arch(...) dependency set"), NULL },
    00193  { "file",      0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSFILE,
    00194         N_("print file(...) dependency set"), NULL },
    00195  { "soname",    0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSSONAME,
    00196         N_("print soname(...) dependency set"), NULL },
    00197  { "package",   0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSPACKAGE,
    00198         N_("print package(...) dependency set"), NULL },
    00199
    00200  { "java",      0, POPT_ARG_VAL, &rpmdeps_mode, RPMDEP_RPMDSJAVA,
    00201         N_("print java(...) dependency set"), NULL },
    00202  { "php",       0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSPHP,
    00203         N_("print php(...) dependency set"), NULL },
    00204  { "ruby",      0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSRUBY,
    00205         N_("print ruby(...) dependency set"), NULL },
    00206  { "dpkgrpm",   0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSDPKGRPM,
    00207         N_("print /var/lib/dpkg Provides: dependency set"), NULL },
    00208  { "rpmdpkg",   0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &rpmdeps_mode, RPMDEP_RPMDSRPMDPKG,
    00209         N_("print /var/lib/dpkg Requires: dependency set"), NULL },
    00210
    00211  { "provides", 'P', POPT_ARG_VAL, &print_provides, -1,
    00212         N_("print Provides: dependency set"), NULL },
    00213  { "requires", 'R', POPT_ARG_VAL, &print_requires, -1,
    00214         N_("print Requires: dependency set"), NULL },
    00215  { "closure", 0, POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &print_closure, -1,
    00216         N_("check Requires: against Provides: for dependency closure"), NULL },
    00217
    00218    POPT_AUTOALIAS
    00219    POPT_AUTOHELP
    00220    POPT_TABLEEND
    00221 };
    00222
    00223
    00224 int
    00225 main(int argc, char *argv[])
    00226 {
    00227 static const char rpmdeps_string[] = "rpmdeps";
    00228     poptContext optCon;
    00229     ARGV_t av = NULL;
    00230     rpmfc fc = NULL;
    00231     rpmds P = NULL;
    00232     rpmds R = NULL;
    00233     rpmPRCO PRCO = rpmdsNewPRCO(NULL);
    00234 const char * closure_name = "for";
    00235     FILE * fp = NULL;
    00236     int flags = 0;
    00237     int ac = 0;
    00238     int ec = 1;
    00239     int xx;
    00240     int i;
    00241 char buf[BUFSIZ];
    00242
    00243 /*@-modobserver@*/
    00244     if ((progname = strrchr(argv[0], '/')) != NULL)
    00245         progname++;
    00246     else
    00247         progname = argv[0];
    00248 /*@=modobserver@*/
    00249
    00250     optCon = rpmcliInit(argc, argv, optionsTable);
    00251     if (optCon == NULL)
    00252         goto exit;
    00253
    00254     av = poptGetArgs(optCon);
    00255     ac = argvCount(av);
    00256
    00257     if (rpmdeps_mode == RPMDEP_RPMFC && ac == 0) {
    00258         av = NULL;
    00259         xx = argvFgets(&av, NULL);
    00260         ac = argvCount(av);
    00261     }
    00262
    00263     /* Make sure file names are sorted. */
    00264     xx = argvSort(av, NULL);
    00265
    00266     switch (rpmdeps_mode) {
    00267     case RPMDEP_RPMFC:
    00268         if (ac <= 0)            /* XXX avoid rpmfcApply() segfault */
    00269             break;
    00270
    00271         /* Build file class dictionary. */
    00272         fc = rpmfcNew();
    00273         xx = rpmfcClassify(fc, av, NULL);
    00274
    00275         /* Build file/package dependency dictionary. */
    00276         xx = rpmfcApply(fc);
    00277
    00278 if (_rpmfc_debug) {
    00279 sprintf(buf, "final: files %d cdict[%d] %d%% ddictx[%d]", (int)fc->nfiles, argvCount(fc->cdict), (int)((100 * fc->fknown)/fc->nfiles), argiCount(fc->ddictx));
    00280 rpmfcPrint(buf, fc, NULL);
    00281 }
    00282         if (print_provides > 0) print_provides = 0;
    00283         if (print_requires > 0) print_requires = 0;
    00284         P = fc->provides;       fc->provides = NULL;
    00285         R = fc->requires;       fc->requires = NULL;
    00286         fp = stdout;
    00287         break;
    00288     case RPMDEP_RPMDSCPUINFO:
    00289         closure_name = "cpuinfo(...)";
    00290         xx = rpmdsCpuinfo(&P, NULL);
    00291         break;
    00292     case RPMDEP_RPMDSRPMLIB:
    00293         closure_name = "rpmlib(...)";
    00294         xx = rpmdsRpmlib(&P, NULL);
    00295         break;
    00296     case RPMDEP_RPMDSSYSINFO:
    00297         xx = rpmdsSysinfo(PRCO, NULL);
    00298         P = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_PROVIDENAME), rpmdeps_string);
    00299         R = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_REQUIRENAME), rpmdeps_string);
    00300         break;
    00301     case RPMDEP_RPMDSGETCONF:
    00302         closure_name = "getconf(...)";
    00303         xx = rpmdsGetconf(&P, NULL);
    00304         break;
    00305     case RPMDEP_RPMDSELF:
    00306         closure_name = "soname(...)";
    00307         for (i = 0; i < ac; i++)
    00308             xx = rpmdsELF(av[i], flags, rpmdsMergePRCO, PRCO);
    00309         P = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_PROVIDENAME), rpmdeps_string);
    00310         R = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_REQUIRENAME), rpmdeps_string);
    00311         break;
    00312     case RPMDEP_RPMDSLDCONFIG:
    00313         closure_name = "soname(...)";
    00314         xx = rpmdsLdconfig(PRCO, NULL);
    00315         P = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_PROVIDENAME), rpmdeps_string);
    00316         R = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_REQUIRENAME), rpmdeps_string);
    00317         break;
    00318     case RPMDEP_RPMDSUNAME:
    00319         closure_name = "uname(...)";
    00320         xx = rpmdsUname(&P, NULL);
    00321         break;
    00322
    00323     case RPMDEP_RPMDSPIPE:
    00324         break;
    00325     case RPMDEP_RPMDSPERL:
    00326         closure_name = "perl(...)";
    00327 if (rpmIsVerbose())
    00328 fprintf(stderr, "\n*** Gathering %s Provides: using\n\t%s\n", closure_name, _perl_provides);
    00329         xx = rpmdsPipe(&P, RPMTAG_PROVIDENAME, _perl_provides);
    00330 if (print_closure || rpmIsVerbose()) {
    00331 fprintf(stderr, "\n*** Gathering %s Requires: using\n\t%s\n", closure_name, _perl_requires);
    00332         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _perl_requires);
    00333         print_closure = 1;
    00334 }
    00335         break;
    00336     case RPMDEP_RPMDSPYTHON:
    00337         break;
    00338     case RPMDEP_RPMDSLIBTOOL:
    00339         closure_name = "libtool(...)";
    00340 if (rpmIsVerbose())
    00341 fprintf(stderr, "\n*** Gathering %s Provides: using\n\t%s\n", closure_name, _libtool_provides);
    00342         xx = rpmdsPipe(&P, RPMTAG_PROVIDENAME, _libtool_provides);
    00343 if (print_closure || rpmIsVerbose()) {
    00344 fprintf(stderr, "\n*** Gathering %s Requires: using\n\t%s\n", closure_name, _libtool_requires);
    00345         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _libtool_requires);
    00346         print_closure = 1;
    00347 }
    00348         break;
    00349     case RPMDEP_RPMDSPKGCONFIG:
    00350         closure_name = "pkgconfig(...)";
    00351 if (rpmIsVerbose())
    00352 fprintf(stderr, "\n*** Gathering %s Provides: using\n\t%s\n", closure_name, _pkgconfig_provides);
    00353         xx = rpmdsPipe(&P, RPMTAG_PROVIDENAME, _pkgconfig_provides);
    00354 if (print_closure || rpmIsVerbose()) {
    00355 fprintf(stderr, "\n*** Gathering %s Requires: using\n\t%s\n", closure_name, _pkgconfig_requires);
    00356         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _pkgconfig_requires);
    00357         print_closure = 1;
    00358 }
    00359         break;
    00360
    00361     case RPMDEP_RPMDSPUBKEY:
    00362         break;
    00363     case RPMDEP_RPMDSARCH:
    00364         break;
    00365     case RPMDEP_RPMDSFILE:
    00366 if (rpmIsVerbose())
    00367 fprintf(stderr, "\n*** Gathering rpmdb file Requires: using\n\t%s\n", _rpmdb_file_requires);
    00368         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _rpmdb_file_requires);
    00369         break;
    00370     case RPMDEP_RPMDSSONAME:
    00371         closure_name = "soname(...)";
    00372         xx = rpmdsLdconfig(PRCO, NULL);
    00373         P = rpmdsLink(rpmdsFromPRCO(PRCO, RPMTAG_PROVIDENAME), rpmdeps_string);
    00374 if (print_closure || rpmIsVerbose()) {
    00375 fprintf(stderr, "\n*** Gathering rpmdb soname Requires: using\n\t%s\n", _rpmdb_soname_requires);
    00376         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _rpmdb_soname_requires);
    00377         print_closure = 1;
    00378 }
    00379         break;
    00380     case RPMDEP_RPMDSPACKAGE:
    00381         closure_name = "package(...)";
    00382 if (rpmIsVerbose())
    00383 fprintf(stderr, "\n*** Gathering rpmdb package Provides: using\n\t%s\n", _rpmdb_package_provides);
    00384         xx = rpmdsPipe(&P, RPMTAG_PROVIDENAME, _rpmdb_package_provides);
    00385 if (print_closure || rpmIsVerbose()) {
    00386 fprintf(stderr, "\n*** Gathering rpmdb package Requires: using\n\t%s\n", _rpmdb_package_requires);
    00387         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _rpmdb_package_requires);
    00388         print_closure = 1;
    00389 }
    00390         break;
    00391
    00392     case RPMDEP_RPMDSJAVA:
    00393         closure_name = "java(...)";
    00394 if (rpmIsVerbose())
    00395 fprintf(stderr, "\n*** Gathering %s Provides: using\n\t%s\n", closure_name, _java_provides);
    00396         xx = rpmdsPipe(&P, RPMTAG_PROVIDENAME, _java_provides);
    00397 if (print_closure || rpmIsVerbose()) {
    00398 fprintf(stderr, "\n*** Gathering %s Requires: using\n\t%s\n", closure_name, _java_requires);
    00399         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _java_requires);
    00400         print_closure = 1;
    00401 }
    00402         break;
    00403     case RPMDEP_RPMDSRUBY:
    00404         break;
    00405     case RPMDEP_RPMDSPHP:
    00406         break;
    00407     case RPMDEP_RPMDSDPKGRPM:
    00408         closure_name = "dpkgrpm(...)";
    00409 if (rpmIsVerbose())
    00410 fprintf(stderr, "\n*** Gathering dpkg Provides: using\n\t%s\n", _dpkg_provides);
    00411         xx = rpmdsPipe(&P, RPMTAG_PROVIDENAME, _dpkg_provides);
    00412 if (print_closure || rpmIsVerbose()) {
    00413 fprintf(stderr, "\n*** Gathering rpmdb package Requires: using\n\t%s\n", _rpmdb_package_requires);
    00414         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _rpmdb_package_requires);
    00415         print_closure = 1;
    00416 }
    00417         break;
    00418     case RPMDEP_RPMDSRPMDPKG:
    00419         closure_name = "rpmdpkg(...)";
    00420 if (print_closure || rpmIsVerbose()) {
    00421 fprintf(stderr, "\n*** Gathering rpmdb package Provides: using\n\t%s\n", _rpmdb_package_provides);
    00422         xx = rpmdsPipe(&P, RPMTAG_PROVIDENAME, _rpmdb_package_provides);
    00423         print_closure = 1;
    00424 }
    00425 if (rpmIsVerbose())
    00426 fprintf(stderr, "\n*** Gathering dpkg Requires: using\n\t%s\n", _dpkg_requires);
    00427         xx = rpmdsPipe(&R, RPMTAG_REQUIRENAME, _dpkg_requires);
    00428         break;
    00429     }
    00430
    00431     if (print_provides && P != NULL)
    00432         xx = rpmdepPrint(NULL, P, fp);
    00433     if (print_requires && R != NULL)
    00434         xx = rpmdepPrint(NULL, R, fp);
    00435     if (print_closure) {
    00436 if (rpmIsVerbose())
    00437 fprintf(stderr, "\n*** Checking %s Requires(%d): against Provides(%d): closure:\n", closure_name, rpmdsCount(R), rpmdsCount(P));
    00438         xx = rpmdsPrintClosure(P, R, fp);
    00439     }
    00440
    00441     fc = rpmfcFree(fc);
    00442     (void)rpmdsFree(P);
    00443     P = NULL;
    00444     (void)rpmdsFree(R);
    00445     R = NULL;
    00446     PRCO = rpmdsFreePRCO(PRCO);
    00447
    00448     ec = 0;
    00449
    00450 exit:
    00451     optCon = rpmcliFini(optCon);
    00452     return ec;
    00453 }