#include "system.h"#include <signal.h>#include <regex.h>#include <rpmbuild.h>#include <argv.h>#include <rpmfc.h>#include <rpmds.h>#include <rpmfi.h>#include <rpmts.h>#include <rpmdb.h>#include "debug.h"Go to the source code of this file.
Data Structures | |
| struct | rpmfcApplyTbl_s |
| struct | DepMsg_s |
Defines | |
| #define | _RPMDS_INTERNAL |
Typedefs | |
| typedef rpmfcApplyTbl_s * | rpmfcApplyTbl |
| typedef DepMsg_s * | DepMsg_t |
Functions | |
| static int | rpmfcExpandAppend (ARGV_t *argvp, const ARGV_t av) |
| static StringBuf | getOutputFrom (const char *dir, ARGV_t argv, const char *writePtr, int writeBytesLeft, int failNonZero) |
| Return output from helper script. | |
| int | rpmfcExec (ARGV_t av, StringBuf sb_stdin, StringBuf *sb_stdoutp, int failnonzero) |
| Return helper output. | |
| static int | rpmfcSaveArg (ARGV_t *argvp, const char *key) |
| static char * | rpmfcFileDep (char *buf, int ix, rpmds ds) |
| static regex_t * | rpmfcExpandRegexps (const char *str, int *count) |
| static int | rpmfcMatchRegexps (regex_t *regexps, int count, const char *str, char deptype) |
| static regex_t * | rpmfcFreeRegexps (regex_t *regexps, int count) |
| static int | rpmfcHelper (rpmfc fc, unsigned char deptype, const char *nsdep, regex_t *noauto, int noauto_c) |
| Run per-interpreter dependency helper. | |
| int | rpmfcColoring (const char *fmstr) |
| Return file color given file(1) string. | |
| void | rpmfcPrint (const char *msg, rpmfc fc, FILE *fp) |
| Print results of file classification. | |
| rpmfc | rpmfcFree (rpmfc fc) |
| Destroy a file classifier. | |
| rpmfc | rpmfcNew (void) |
| Create a file classifier. | |
| static int | rpmfcSCRIPT (rpmfc fc, int findprov, int findreq, regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c) |
| Extract script dependencies. | |
| static int | rpmfcMONO (rpmfc fc, int findprov, int findreq, regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c) |
| Extract .NET dependencies. | |
| static int | rpmfcELF (rpmfc fc, int findprov, int findreq, regex_t *noautoprov, int noautoprov_c, regex_t *noautoreq, int noautoreq_c) |
| Extract Elf dependencies. | |
| static int | rpmfcFindRequiredPackages (rpmfc fc) |
| int | rpmfcApply (rpmfc fc) |
| Build file/package dependency dictionary and mappings. | |
| int | rpmfcClassify (rpmfc fc, ARGV_t argv, int_16 *fmode) |
| static void | printDeps (Header h) |
| static int | rpmfcGenerateDependsHelper (const Spec spec, Package pkg, rpmfi fi) |
| int | rpmfcGenerateDepends (const Spec spec, Package pkg) |
| Generate package dependencies. | |
Variables | |
| static struct rpmfcTokens_s | rpmfcTokens [] |
| static struct rpmfcApplyTbl_s | rpmfcApplyTable [] |
| static struct DepMsg_s | depMsgs [] |
| static DepMsg_t | DepMsgs = depMsgs |
| typedef struct rpmfcApplyTbl_s * rpmfcApplyTbl |
| static void printDeps | ( | Header | h | ) | [static] |
Definition at line 1694 of file rpmfc.c.
References DepMsgs, flags, DepMsg_s::ftag, DepMsg_s::mask, DepMsg_s::msg, DepMsg_s::ntag, rpmdsDNEVR(), rpmdsFlags(), rpmdsFree(), rpmdsInit(), rpmdsNew(), rpmdsNext(), RPMMESS_NORMAL, rpmMessage, and DepMsg_s::xor.
Referenced by rpmfcGenerateDepends().
| int rpmfcApply | ( | rpmfc | fc | ) |
Build file/package dependency dictionary and mappings.
| fc | file classifier |
Definition at line 1338 of file rpmfc.c.
References _, rpmfcApplyTbl_s::colormask, rpmfc_s::fcolor, rpmfc_s::fn, rpmfcApplyTbl_s::func, rpmfc_s::ix, rpmExpand(), RPMFC_PYTHON, rpmfcApplyTable, rpmfcExpandRegexps(), RPMMESS_DEBUG, RPMMESS_NORMAL, rpmMessage, and ARGI_s::vals.
Referenced by main(), and rpmfcGenerateDepends().
Definition at line 1497 of file rpmfc.c.
References _, argiAdd(), argvAdd(), argvCount(), argvFree(), argvSearch(), rpmfc_s::brlen, rpmfc_s::cdict, errno, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fknown, rpmfc_s::fn, rpmfc_s::fwhite, rpmfc_s::ix, magicfile, rpmfc_s::nfiles, RPMERR_EXEC, rpmError, RPMFC_INCLUDE, RPMFC_WHITE, rpmfcColoring(), rpmfcSaveArg(), RPMMESS_DEBUG, rpmMessage, S_IFSOCK, and strerror.
Referenced by main(), and rpmfcGenerateDepends().
| int rpmfcColoring | ( | const char * | fmstr | ) |
Return file color given file(1) string.
| fmstr | file(1) string |
Definition at line 600 of file rpmfc.c.
References rpmfcTokens_s::colors, RPMFC_BLACK, RPMFC_INCLUDE, rpmfcTokens, and rpmfcTokens_s::token.
Referenced by rpmfcClassify().
| static int rpmfcELF | ( | rpmfc | fc, | |
| int | findprov, | |||
| int | findreq, | |||
| regex_t * | noautoprov, | |||
| int | noautoprov_c, | |||
| regex_t * | noautoreq, | |||
| int | noautoreq_c | |||
| ) | [static] |
Extract Elf dependencies.
| fc | file classifier | |
| findprov | 1 to enable provides | |
| findreq | 1 to enable requires | |
| noautoprov | _noautoprov regexps | |
| noautoprov_c | # of _noautoprov regexps | |
| noautoreq | _noautoreq regexps | |
| noautoreq_c | # of _noautoreq regexps |
Definition at line 888 of file rpmfc.c.
References _free(), data, rpmfc_s::ddict, rpmfc_s::fn, rpmfc_s::ix, rpmfc_s::provides, rpmfc_s::requires, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), rpmExpandNumeric(), rpmfcFileDep(), rpmfcMatchRegexps(), rpmfcSaveArg(), RPMSENSE_FIND_PROVIDES, RPMSENSE_FIND_REQUIRES, RPMTAG_PROVIDENAME, RPMTAG_PROVIDES, RPMTAG_REQUIRENAME, rpmfc_s::skipProv, rpmfc_s::skipReq, stpcpy(), and xstrdup().
Return helper output.
| av | helper argv (with possible macros) | |
| sb_stdin | helper input |
| *sb_stdoutp | helper output |
| failnonzero | IS non-zero helper exit status a failure? |
Definition at line 204 of file rpmfc.c.
References _free(), argvAppend(), argvFree(), freeStringBuf(), getOutputFrom(), getStringBuf(), rpmExpand(), and rpmfcExpandAppend().
Referenced by checkFiles(), rpmfcGenerateDependsHelper(), and rpmfcHelper().
Definition at line 26 of file rpmfc.c.
References argvCount(), rpmExpand(), and xrealloc().
Referenced by rpmfcExec().
| static regex_t* rpmfcExpandRegexps | ( | const char * | str, | |
| int * | count | |||
| ) | [static] |
Definition at line 307 of file rpmfc.c.
References _, _free(), rpmExpand(), RPMMESS_NORMAL, and rpmMessage.
Referenced by rpmfcApply(), and rpmfcFindRequiredPackages().
| static char* rpmfcFileDep | ( | char * | buf, | |
| int | ix, | |||
| rpmds | ds | |||
| ) | [static] |
Definition at line 281 of file rpmfc.c.
References rpmdsEVR(), rpmdsFlags(), rpmdsN(), rpmdsTagN(), RPMTAG_PROVIDENAME, and RPMTAG_REQUIRENAME.
Referenced by rpmfcELF(), rpmfcHelper(), and rpmfcSCRIPT().
| static int rpmfcFindRequiredPackages | ( | rpmfc | fc | ) | [static] |
Definition at line 1235 of file rpmfc.c.
References _, argvCount(), rpmfc_s::ddict, rpmfc_s::requires, rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbNextIterator(), rpmdsFree(), rpmdsMerge(), rpmdsSingle(), rpmfcExpandRegexps(), rpmfcFreeRegexps(), rpmHeaderGetEntry(), RPMMESS_DEBUG, RPMMESS_NORMAL, rpmMessage, RPMSENSE_FIND_REQUIRES, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmtsCreate(), rpmtsFree(), and rpmtsInitIterator().
Destroy a file classifier.
| fc | file classifier |
Definition at line 692 of file rpmfc.c.
References _free(), argiFree(), argvFree(), rpmfc_s::cdict, rpmfc_s::ddict, rpmfc_s::ddictx, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fn, freeStringBuf(), rpmfc_s::provides, rpmfc_s::requires, rpmdsFree(), rpmfc_s::sb_java, rpmfc_s::sb_perl, rpmfc_s::sb_php, and rpmfc_s::sb_python.
Referenced by main(), and rpmfcGenerateDepends().
| static regex_t* rpmfcFreeRegexps | ( | regex_t * | regexps, | |
| int | count | |||
| ) | [static] |
Definition at line 364 of file rpmfc.c.
References _free().
Referenced by rpmfcFindRequiredPackages().
Generate package dependencies.
| spec | spec file control | |
| pkg | package control |
Definition at line 1818 of file rpmfc.c.
References _free(), _rpmfc_debug, argiCount(), argiData(), argvCount(), argvData(), argvFree(), Package_s::autoProv, Package_s::autoReq, rpmfc_s::brlen, Spec_s::buildRootURL, rpmfc_s::cdict, Package_s::cpioList, rpmfc_s::ddictx, Package_s::ds, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fknown, flags, Package_s::header, headerAddEntry(), headerRemoveEntry(), DepMsg_s::msg, rpmfc_s::nfiles, printDeps(), rpmfc_s::provides, rpmfc_s::requires, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, rpmdsCount(), rpmdsEVR(), rpmdsFree(), rpmdsMerge(), rpmdsN(), rpmdsNew(), rpmdsSingle(), rpmExpandNumeric(), rpmfcApply(), rpmfcClassify(), rpmfcFree(), rpmfcGenerateDependsHelper(), rpmfcNew(), rpmfcPrint(), rpmfiFC(), rpmfiFFlags(), rpmfiFMode(), rpmfiFN(), rpmfiInit(), RPMFILE_CONFIG, rpmfiNext(), RPMSENSE_CONFIG, RPMSENSE_EQUAL, RPMTAG_CLASSDICT, RPMTAG_DEPENDSDICT, RPMTAG_FILECLASS, RPMTAG_FILECOLORS, RPMTAG_FILEDEPENDSN, RPMTAG_FILEDEPENDSX, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, rpmfc_s::skipProv, rpmfc_s::skipReq, rpmfc_s::tracked, xcalloc(), and xstrdup().
Referenced by processBinaryFiles().
Definition at line 1740 of file rpmfc.c.
References _, _free(), appendLineStringBuf, DepMsg_s::argv, Package_s::autoProv, Package_s::autoReq, DepMsgs, freeStringBuf(), DepMsg_s::ftag, getStringBuf(), DepMsg_s::msg, newStringBuf(), DepMsg_s::ntag, parseRCPOT(), RPMERR_EXEC, rpmError, rpmExpand(), rpmfcExec(), rpmfiFN(), rpmfiInit(), rpmfiNext(), RPMMESS_NORMAL, rpmMessage, RPMSENSE_FIND_PROVIDES, RPMSENSE_FIND_REQUIRES, RPMTAG_PROVIDEFLAGS, and RPMTAG_REQUIREFLAGS.
Referenced by rpmfcGenerateDepends().
| static int rpmfcHelper | ( | rpmfc | fc, | |
| unsigned char | deptype, | |||
| const char * | nsdep, | |||
| regex_t * | noauto, | |||
| int | noauto_c | |||
| ) | [static] |
Run per-interpreter dependency helper.
| fc | file classifier | |
| deptype | 'P' == Provides:, 'R' == Requires:, helper | |
| nsdep | class name for interpreter (e.g. "perl") | |
| noauto | _noauto* regexps | |
| noauto_c | # of _noauto* regexps |
Definition at line 382 of file rpmfc.c.
References appendLineStringBuf, argvCount(), argvFree(), argvSplit(), rpmfc_s::ddict, rpmfc_s::fn, freeStringBuf(), getStringBuf(), rpmfc_s::ix, newStringBuf(), rpmfc_s::provides, rpmfc_s::requires, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), rpmfcExec(), rpmfcFileDep(), rpmfcMatchRegexps(), rpmfcSaveArg(), RPMSENSE_EQUAL, RPMSENSE_FIND_PROVIDES, RPMSENSE_FIND_REQUIRES, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_RPMLIB, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmfc_s::skipProv, rpmfc_s::skipReq, snprintf(), and rpmfc_s::tracked.
Referenced by rpmfcMONO(), and rpmfcSCRIPT().
| static int rpmfcMatchRegexps | ( | regex_t * | regexps, | |
| int | count, | |||
| const char * | str, | |||
| char | deptype | |||
| ) | [static] |
Definition at line 349 of file rpmfc.c.
References _, RPMMESS_DEBUG, RPMMESS_NORMAL, and rpmMessage.
Referenced by rpmfcELF(), rpmfcHelper(), and rpmfcSCRIPT().
| static int rpmfcMONO | ( | rpmfc | fc, | |
| int | findprov, | |||
| int | findreq, | |||
| regex_t * | noautoprov, | |||
| int | noautoprov_c, | |||
| regex_t * | noautoreq, | |||
| int | noautoreq_c | |||
| ) | [static] |
Extract .NET dependencies.
| fc | file classifier | |
| findprov | 1 to enable provides | |
| findreq | 1 to enable requires | |
| noautoprov | _noautoprov regexps | |
| noautoprov_c | # of _noautoprov regexps | |
| noautoreq | _noautoreq regexps | |
| noautoreq_c | # of _noautoreq regexps |
Definition at line 852 of file rpmfc.c.
References rpmfc_s::fn, rpmfc_s::ix, and rpmfcHelper().
| rpmfc rpmfcNew | ( | void | ) |
Create a file classifier.
Definition at line 717 of file rpmfc.c.
References xcalloc().
Referenced by main(), and rpmfcGenerateDepends().
| void rpmfcPrint | ( | const char * | msg, | |
| rpmfc | fc, | |||
| FILE * | fp | |||
| ) |
Print results of file classification.
| msg | message prefix (NULL for none) | |
| fc | file classifier | |
| fp | output file handle (NULL for stderr) |
Definition at line 615 of file rpmfc.c.
References rpmfc_s::cdict, rpmfc_s::ddictx, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fn, rpmfc_s::nfiles, rpmfc_s::provides, rpmfc_s::requires, rpmdsCount(), rpmdsDNEVR(), rpmdsNext(), rpmdsSetIx(), RPMFC_BLACK, and ARGI_s::vals.
Referenced by main(), and rpmfcGenerateDepends().
| static int rpmfcSaveArg | ( | ARGV_t * | argvp, | |
| const char * | key | |||
| ) | [static] |
Definition at line 268 of file rpmfc.c.
References argvAdd(), argvSearch(), and argvSort().
Referenced by rpmfcClassify(), rpmfcELF(), rpmfcHelper(), and rpmfcSCRIPT().
| static int rpmfcSCRIPT | ( | rpmfc | fc, | |
| int | findprov, | |||
| int | findreq, | |||
| regex_t * | noautoprov, | |||
| int | noautoprov_c, | |||
| regex_t * | noautoreq, | |||
| int | noautoreq_c | |||
| ) | [static] |
Extract script dependencies.
| fc | file classifier | |
| findprov | 1 to enable provides | |
| findreq | 1 to enable requires | |
| noautoprov | _noautoprov regexps | |
| noautoprov_c | # of _noautoprov regexps | |
| noautoreq | _noautoreq regexps | |
| noautoreq_c | # of _noautoreq regexps |
Definition at line 734 of file rpmfc.c.
References rpmfc_s::ddict, rpmfc_s::fcolor, rpmfc_s::fn, rpmfc_s::ix, rpmfc_s::requires, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), RPMFC_JAVA, RPMFC_MODULE, RPMFC_PERL, RPMFC_PHP, RPMFC_PYTHON, rpmfcFileDep(), rpmfcHelper(), rpmfcMatchRegexps(), rpmfcSaveArg(), RPMSENSE_FIND_REQUIRES, RPMTAG_REQUIRENAME, and ARGI_s::vals.
Definition at line 1690 of file rpmfc.c.
Referenced by printDeps(), and rpmfcGenerateDependsHelper().
struct rpmfcApplyTbl_s rpmfcApplyTable[] [static] |
Initial value:
{
{ rpmfcELF, RPMFC_ELF },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PHP) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_JAVA) },
{ rpmfcMONO, RPMFC_MONO },
{ NULL, 0 }
}
Definition at line 1225 of file rpmfc.c.
Referenced by rpmfcApply().
struct rpmfcTokens_s rpmfcTokens[] [static] |
1.5.1