rpmdeps.c File Reference
`#include "system.h"`
`#include <rpmio.h>`
`#include <rpmiotypes.h>`
`#include <rpmcb.h>`
`#include <argv.h>`
`#include <rpmtypes.h>`
`#include <rpmtag.h>`
`#include <rpmds.h>`
`#include <rpmfc.h>`
`#include <rpmcli.h>`
`#include "debug.h"`
Include dependency graph for rpmdeps.c:

Go to the source code of this file.

## Macros

#define | _RPMFC_INTERNAL /* XXX for debugging */
#define | RPMDEP_RPMFC 1
#define | RPMDEP_RPMDSCPUINFO 2
#define | RPMDEP_RPMDSRPMLIB 3
#define | RPMDEP_RPMDSSYSINFO 4
#define | RPMDEP_RPMDSGETCONF 5
#define | RPMDEP_RPMDSELF 6
#define | RPMDEP_RPMDSLDCONFIG 7
#define | RPMDEP_RPMDSUNAME 8
#define | RPMDEP_RPMDSPIPE 9
#define | RPMDEP_RPMDSPERL 10
#define | RPMDEP_RPMDSPYTHON 11
#define | RPMDEP_RPMDSLIBTOOL 12
#define | RPMDEP_RPMDSPKGCONFIG 13
#define | RPMDEP_RPMDSPUBKEY 14
#define | RPMDEP_RPMDSARCH 15
#define | RPMDEP_RPMDSFILE 16
#define | RPMDEP_RPMDSSONAME 17
#define | RPMDEP_RPMDSPACKAGE 18
#define | RPMDEP_RPMDSJAVA 20
#define | RPMDEP_RPMDSRUBY 21
#define | RPMDEP_RPMDSPHP 22
#define | RPMDEP_RPMDSDPKGRPM 32
#define | RPMDEP_RPMDSRPMDPKG 33
#define | _PERL_PROVIDES "/usr/bin/find /usr/lib/perl5 | /usr/lib/rpm/perl.prov"
#define | _PERL_REQUIRES "rpm -qa --fileclass | grep 'perl script' | sed -e 's/\t.*$//' | /usr/lib/rpm/perl.req"
#define | _JAVA_PROVIDES "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -P"
#define | _JAVA_REQUIRES "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -R"
#define | _LIBTOOL_PROVIDES "/usr/bin/find /usr/lib -name '*.la' | /usr/lib/rpm/libtooldeps.sh -P /"
#define | _LIBTOOL_REQUIRES "rpm -qal | grep '\\.la$' | /usr/lib/rpm/libtooldeps.sh -R /"
#define | _PKGCONFIG_PROVIDES "/usr/bin/find /usr/lib -name '*.pc' | /usr/lib/rpm/pkgconfigdeps.sh -P"
#define | _PKGCONFIG_REQUIRES "rpm -qal | grep '\\.pc$' | /usr/lib/rpm/pkgconfigdeps.sh -R"
#define | _DPKG_PROVIDES "egrep '^(Package|Status|Version|Provides):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ N\n\ s|^Package: \\([^\\n]*\\)\\n[^\\n]*\\nVersion: \\(.*\\)$|\\1 = \\2|\n\}\n\/^Provides: / {\n\ s|^Provides: ||\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sort -u | tee /tmp/dpkg"

#define

_DPKG_REQUIRES "egrep '^(Package|Status|Pre-Depends|Depends):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ s|^Package: [^\\n]*\\n.*$||\n\}\n\/^Depends: / {\n\ s|^Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}\n\/^Pre-Depends: / {\n\ s|^Pre-Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sed -e 's/ |.*$//' | sort -u | tee /tmp/dpkg"

#define | _RPMDB_PACKAGE_PROVIDES "rpm -qa --qf '%{name} = %|epoch?{%{epoch}:}|%{version}-%{release}\n' | sort -u"
#define | _RPMDB_PACKAGE_REQUIRES "rpm -qa --requires | sort -u | sed -e '/^\\//d' -e '/.*\\.so.*/d' -e '/^%/d' -e '/^.*(.*)/d'"
#define | _RPMDB_SONAME_REQUIRES "rpm -qa --requires | grep -v '^/' | grep '.*\\.so.*' | sort -u"
#define | _RPMDB_FILE_REQUIRES "rpm -qa --requires | grep '^/' | sort -u"

## Functions

static int | rpmdepPrint (const char *msg, rpmds ds, FILE *fp)
int | main (int argc, char *argv[])

## Variables

const char * | __progname
char * | progname
static int | rpmdeps_mode = 1
static int | print_provides = 1
static int | print_requires = 1
static int | print_closure = 0
static const char * | _perl_provides = "/usr/bin/find /usr/lib/perl5 | /usr/lib/rpm/perl.prov"
static const char * | _perl_requires = "rpm -qa --fileclass | grep 'perl script' | sed -e 's/\t.*$//' | /usr/lib/rpm/perl.req"
static const char * | _java_provides = "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -P"
static const char * | _java_requires = "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -R"
static const char * | _libtool_provides = "/usr/bin/find /usr/lib -name '*.la' | /usr/lib/rpm/libtooldeps.sh -P /"
static const char * | _libtool_requires = "rpm -qal | grep '\\.la$' | /usr/lib/rpm/libtooldeps.sh -R /"
static const char * | _pkgconfig_provides = "/usr/bin/find /usr/lib -name '*.pc' | /usr/lib/rpm/pkgconfigdeps.sh -P"
static const char * | _pkgconfig_requires = "rpm -qal | grep '\\.pc$' | /usr/lib/rpm/pkgconfigdeps.sh -R"
static const char * | _dpkg_provides = "egrep '^(Package|Status|Version|Provides):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ N\n\ s|^Package: \\([^\\n]*\\)\\n[^\\n]*\\nVersion: \\(.*\\)$|\\1 = \\2|\n\}\n\/^Provides: / {\n\ s|^Provides: ||\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sort -u | tee /tmp/dpkg"

static const char *

_dpkg_requires = "egrep '^(Package|Status|Pre-Depends|Depends):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ s|^Package: [^\\n]*\\n.*$||\n\}\n\/^Depends: / {\n\ s|^Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}\n\/^Pre-Depends: / {\n\ s|^Pre-Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sed -e 's/ |.*$//' | sort -u | tee /tmp/dpkg"

static const char * | _rpmdb_package_provides = "rpm -qa --qf '%{name} = %|epoch?{%{epoch}:}|%{version}-%{release}\n' | sort -u"
static const char * | _rpmdb_package_requires = "rpm -qa --requires | sort -u | sed -e '/^\\//d' -e '/.*\\.so.*/d' -e '/^%/d' -e '/^.*(.*)/d'"
static const char * | _rpmdb_soname_requires = "rpm -qa --requires | grep -v '^/' | grep '.*\\.so.*' | sort -u"
static const char * | _rpmdb_file_requires = "rpm -qa --requires | grep '^/' | sort -u"
static struct poptOption | optionsTable []

## Macro Definition Documentation

#define _DPKG_PROVIDES "egrep '^(Package|Status|Version|Provides):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ N\n\ s|^Package: \\([^\\n]*\\)\\n[^\\n]*\\nVersion: \\(.*\\)$|\\1 = \\2|\n\}\n\/^Provides: / {\n\ s|^Provides: ||\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sort -u | tee /tmp/dpkg"

Definition at line 92 of file rpmdeps.c.

#define _DPKG_REQUIRES "egrep '^(Package|Status|Pre-Depends|Depends):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ s|^Package: [^\\n]*\\n.*$||\n\}\n\/^Depends: / {\n\ s|^Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}\n\/^Pre-Depends: / {\n\ s|^Pre-Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sed -e 's/ |.*$//' | sort -u | tee /tmp/dpkg"

Definition at line 105 of file rpmdeps.c.

#define _JAVA_PROVIDES "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -P"

Definition at line 70 of file rpmdeps.c.

#define _JAVA_REQUIRES "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -R"

Definition at line 74 of file rpmdeps.c.

#define _LIBTOOL_PROVIDES "/usr/bin/find /usr/lib -name '*.la' | /usr/lib/rpm/libtooldeps.sh -P /"

Definition at line 78 of file rpmdeps.c.

#define _LIBTOOL_REQUIRES "rpm -qal | grep '\\.la$' | /usr/lib/rpm/libtooldeps.sh -R /"

Definition at line 82 of file rpmdeps.c.

#define _PERL_PROVIDES "/usr/bin/find /usr/lib/perl5 | /usr/lib/rpm/perl.prov"

Definition at line 62 of file rpmdeps.c.

#define _PERL_REQUIRES "rpm -qa --fileclass | grep 'perl script' | sed -e 's/\t.*$//' | /usr/lib/rpm/perl.req"

Definition at line 66 of file rpmdeps.c.

#define _PKGCONFIG_PROVIDES "/usr/bin/find /usr/lib -name '*.pc' | /usr/lib/rpm/pkgconfigdeps.sh -P"

Definition at line 86 of file rpmdeps.c.

#define _PKGCONFIG_REQUIRES "rpm -qal | grep '\\.pc$' | /usr/lib/rpm/pkgconfigdeps.sh -R"

Definition at line 89 of file rpmdeps.c.

#define _RPMDB_FILE_REQUIRES "rpm -qa --requires | grep '^/' | sort -u"

Definition at line 136 of file rpmdeps.c.

#define _RPMDB_PACKAGE_PROVIDES "rpm -qa --qf '%{name} = %|epoch?{%{epoch}:}|%{version}-%{release}\n' | sort -u"

Definition at line 127 of file rpmdeps.c.

#define _RPMDB_PACKAGE_REQUIRES "rpm -qa --requires | sort -u | sed -e '/^\\//d' -e '/.*\\.so.*/d' -e '/^%/d' -e '/^.*(.*)/d'"

Definition at line 130 of file rpmdeps.c.

#define _RPMDB_SONAME_REQUIRES "rpm -qa --requires | grep -v '^/' | grep '.*\\.so.*' | sort -u"

Definition at line 133 of file rpmdeps.c.

#define _RPMFC_INTERNAL /* XXX for debugging */

Definition at line 12 of file rpmdeps.c.

#define RPMDEP_RPMDSARCH 15

Definition at line 38 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSCPUINFO 2

Definition at line 23 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSDPKGRPM 32

Definition at line 47 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSELF 6

Definition at line 27 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSFILE 16

Definition at line 39 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSGETCONF 5

Definition at line 26 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSJAVA 20

Definition at line 43 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSLDCONFIG 7

Definition at line 28 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSLIBTOOL 12

Definition at line 34 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSPACKAGE 18

Definition at line 41 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSPERL 10

Definition at line 32 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSPHP 22

Definition at line 45 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSPIPE 9

Definition at line 30 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSPKGCONFIG 13

Definition at line 35 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSPUBKEY 14

Definition at line 37 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSPYTHON 11

Definition at line 33 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSRPMDPKG 33

Definition at line 48 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSRPMLIB 3

Definition at line 24 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSRUBY 21

Definition at line 44 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSSONAME 17

Definition at line 40 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSSYSINFO 4

Definition at line 25 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMDSUNAME 8

Definition at line 29 of file rpmdeps.c.

Referenced by main().

#define RPMDEP_RPMFC 1

Definition at line 22 of file rpmdeps.c.

Referenced by main().

## Function Documentation

int main | ( | int | argc,
|  | char * | argv[]
| ) |  |

Definition at line 225 of file rpmdeps.c.

References _dpkg_provides, _dpkg_requires, _java_provides, _java_requires, _libtool_provides, _libtool_requires, _perl_provides, _perl_requires, _pkgconfig_provides, _pkgconfig_requires, _rpmdb_file_requires, _rpmdb_package_provides, _rpmdb_package_requires, _rpmdb_soname_requires, _rpmfc_debug, argiCount(), argvCount(), argvFgets(), argvSort(), optionsTable, print_closure, print_provides, print_requires, progname, rpmcliFini(), rpmcliInit(), RPMDEP_RPMDSARCH, RPMDEP_RPMDSCPUINFO, RPMDEP_RPMDSDPKGRPM, RPMDEP_RPMDSELF, RPMDEP_RPMDSFILE, RPMDEP_RPMDSGETCONF, RPMDEP_RPMDSJAVA, RPMDEP_RPMDSLDCONFIG, RPMDEP_RPMDSLIBTOOL, RPMDEP_RPMDSPACKAGE, RPMDEP_RPMDSPERL, RPMDEP_RPMDSPHP, RPMDEP_RPMDSPIPE, RPMDEP_RPMDSPKGCONFIG, RPMDEP_RPMDSPUBKEY, RPMDEP_RPMDSPYTHON, RPMDEP_RPMDSRPMDPKG, RPMDEP_RPMDSRPMLIB, RPMDEP_RPMDSRUBY, RPMDEP_RPMDSSONAME, RPMDEP_RPMDSSYSINFO, RPMDEP_RPMDSUNAME, RPMDEP_RPMFC, rpmdepPrint(), rpmdeps_mode, rpmdsCount(), rpmdsCpuinfo(), rpmdsELF(), rpmdsFree(), rpmdsFreePRCO(), rpmdsFromPRCO(), rpmdsGetconf(), rpmdsLdconfig(), rpmdsLink(), rpmdsMergePRCO(), rpmdsNewPRCO(), rpmdsPipe(), rpmdsPrintClosure(), rpmdsRpmlib(), rpmdsSysinfo(), rpmdsUname(), rpmfcApply(), rpmfcClassify(), rpmfcFree(), rpmfcNew(), rpmfcPrint(), rpmIsVerbose, RPMTAG_PROVIDENAME, and RPMTAG_REQUIRENAME.

static int rpmdepPrint | ( | const char * | msg,
|  | rpmds | ds,
|  | FILE * | fp
| ) |  |

static

Definition at line 139 of file rpmdeps.c.

References _rpmfc_debug, rpmdsDNEVR(), rpmdsInit(), rpmdsIx(), rpmdsNext(), rpmdsType(), rpmIsDebug, and rpmIsVerbose.

Referenced by main().

## Variable Documentation

const char* __progname

Definition at line 2 of file rpmdeps.c.

const char* _dpkg_provides = "egrep '^(Package|Status|Version|Provides):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ N\n\ s|^Package: \\([^\\n]*\\)\\n[^\\n]*\\nVersion: \\(.*\\)$|\\1 = \\2|\n\}\n\/^Provides: / {\n\ s|^Provides: ||\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sort -u | tee /tmp/dpkg"

static

Definition at line 103 of file rpmdeps.c.

Referenced by main().

const char* _dpkg_requires = "egrep '^(Package|Status|Pre-Depends|Depends):' /var/lib/dpkg/status | sed -e '\n\/^Package: / {\n\ N\n\ /not-installed/d\n\ s|^Package: [^\\n]*\\n.*$||\n\}\n\/^Depends: / {\n\ s|^Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}\n\/^Pre-Depends: / {\n\ s|^Pre-Depends: ||\n\ s|(\\([^)]*\\))|\\1|g\n\ s|>>|>|\n\ s|<<|<|\n\ s|, |\\n|g\n\}' | sed -f /usr/lib/rpm/dpkg2fc.sed | sed -e 's/ |.*$//' | sort -u | tee /tmp/dpkg"

static

Definition at line 125 of file rpmdeps.c.

Referenced by main().

const char* _java_provides = "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -P"

static

Definition at line 72 of file rpmdeps.c.

Referenced by main().

const char* _java_requires = "rpm -qal | egrep '\\.(jar|class)$' | /usr/lib/rpm/javadeps.sh -R"

static

Definition at line 76 of file rpmdeps.c.

Referenced by main().

const char* _libtool_provides = "/usr/bin/find /usr/lib -name '*.la' | /usr/lib/rpm/libtooldeps.sh -P /"

static

Definition at line 80 of file rpmdeps.c.

Referenced by main().

const char* _libtool_requires = "rpm -qal | grep '\\.la$' | /usr/lib/rpm/libtooldeps.sh -R /"

static

Definition at line 84 of file rpmdeps.c.

Referenced by main().

const char* _perl_provides = "/usr/bin/find /usr/lib/perl5 | /usr/lib/rpm/perl.prov"

static

Definition at line 64 of file rpmdeps.c.

Referenced by main().

const char* _perl_requires = "rpm -qa --fileclass | grep 'perl script' | sed -e 's/\t.*$//' | /usr/lib/rpm/perl.req"

static

Definition at line 68 of file rpmdeps.c.

Referenced by main().

const char* _pkgconfig_provides = "/usr/bin/find /usr/lib -name '*.pc' | /usr/lib/rpm/pkgconfigdeps.sh -P"

static

Definition at line 87 of file rpmdeps.c.

Referenced by main().

const char* _pkgconfig_requires = "rpm -qal | grep '\\.pc$' | /usr/lib/rpm/pkgconfigdeps.sh -R"

static

Definition at line 90 of file rpmdeps.c.

Referenced by main().

const char* _rpmdb_file_requires = "rpm -qa --requires | grep '^/' | sort -u"

static

Definition at line 137 of file rpmdeps.c.

Referenced by main().

const char* _rpmdb_package_provides = "rpm -qa --qf '%{name} = %|epoch?{%{epoch}:}|%{version}-%{release}\n' | sort -u"

static

Definition at line 128 of file rpmdeps.c.

Referenced by main().

const char* _rpmdb_package_requires = "rpm -qa --requires | sort -u | sed -e '/^\\//d' -e '/.*\\.so.*/d' -e '/^%/d' -e '/^.*(.*)/d'"

static

Definition at line 131 of file rpmdeps.c.

Referenced by main().

const char* _rpmdb_soname_requires = "rpm -qa --requires | grep -v '^/' | grep '.*\\.so.*' | sort -u"

static

Definition at line 134 of file rpmdeps.c.

Referenced by main().

struct poptOption optionsTable[]

static

Definition at line 157 of file rpmdeps.c.

Referenced by main().

int print_closure = 0

static

Definition at line 60 of file rpmdeps.c.

Referenced by main().

int print_provides = 1

static

Definition at line 54 of file rpmdeps.c.

Referenced by main().

int print_requires = 1

static

Definition at line 57 of file rpmdeps.c.

Referenced by main().

char* progname

Definition at line 20 of file rpmdeps.c.

Referenced by main().

int rpmdeps_mode = 1

static

Definition at line 51 of file rpmdeps.c.

Referenced by main().