#include "system.h"
#include <signal.h>
#include <rpmbuild.h>
#include <argv.h>
#include <rpmfc.h>
#include <rpmds.h>
#include <rpmfi.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 struct rpmfcApplyTbl_s * | rpmfcApplyTbl |
typedef struct 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 int | rpmfcHelper (rpmfc fc, unsigned char deptype, const char *nsdep) |
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 | rpmfcSYMLINK (rpmfc fc) |
Ensure that symlinks for shared libs generate a dep on the shared lib. | |
static int | rpmfcSCRIPT (rpmfc fc) |
Extract script dependencies. | |
static int | rpmfcELF (rpmfc fc) |
Extract Elf dependencies. | |
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 |
int rpmfcApply | ( | rpmfc | fc | ) |
Build file/package dependency dictionary and mappings.
fc | file classifier |
Definition at line 1190 of file rpmfc.c.
References argiAdd(), argvCount(), rpmfcApplyTbl_s::colormask, rpmfc_s::ddict, rpmfc_s::ddictx, rpmfc_s::fcolor, rpmfc_s::fn, rpmfcApplyTbl_s::func, rpmfc_s::ix, rpmfc_s::provides, rpmfc_s::requires, rpmdsFind(), rpmdsFree(), rpmdsSingle(), RPMFC_ELF, RPMFC_MONO, RPMFC_PERL, RPMFC_PYTHON, RPMFC_SCRIPT, RPMFC_SYMLINK, rpmfcApply(), rpmfcELF(), rpmfcSCRIPT(), rpmfcSYMLINK(), RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, rpmfc_s::skipProv, rpmfc_s::skipReq, and ARGI_s::vals.
Referenced by main(), and rpmfcApply().
int rpmfcColoring | ( | const char * | fmstr | ) |
Return file color given file(1) string.
fmstr | file(1) string |
Definition at line 527 of file rpmfc.c.
References rpmfcTokens_s::colors, RPMFC_BLACK, RPMFC_INCLUDE, and rpmfcTokens_s::token.
static int rpmfcELF | ( | rpmfc | fc | ) | [static] |
Extract Elf dependencies.
fc | file classifier |
Definition at line 856 of file rpmfc.c.
References _free(), rpmfc_s::ddict, EI_CLASS, ELFCLASS64, ET_EXEC, rpmfc_s::fn, rpmfc_s::ix, rpmfc_s::provides, rpmfc_s::requires, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), rpmExpandNumeric(), rpmfcFileDep(), rpmfcSaveArg(), RPMSENSE_FIND_PROVIDES, RPMSENSE_FIND_REQUIRES, RPMTAG_PROVIDENAME, RPMTAG_PROVIDES, RPMTAG_REQUIRENAME, rpmfc_s::skipProv, rpmfc_s::skipReq, stpcpy(), and xstrdup().
Referenced by rpmfcApply().
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 206 of file rpmfc.c.
References _free(), argvAppend(), argvFree(), freeStringBuf(), getOutputFrom(), getStringBuf(), poptParseArgvString(), rpmExpand(), and rpmfcExpandAppend().
Referenced by rpmfcHelper().
Definition at line 28 of file rpmfc.c.
References argv, argvCount(), rpmExpand(), and xrealloc().
Referenced by rpmfcExec().
static char* rpmfcFileDep | ( | char * | buf, | |
int | ix, | |||
rpmds | ds | |||
) | [static] |
Definition at line 283 of file rpmfc.c.
References rpmdsEVR(), rpmdsFlags(), rpmdsN(), rpmdsTagN(), RPMTAG_PROVIDENAME, and RPMTAG_REQUIRENAME.
Referenced by rpmfcELF(), rpmfcHelper(), rpmfcSCRIPT(), and rpmfcSYMLINK().
Destroy a file classifier.
fc | file classifier |
Definition at line 619 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, and rpmfc_s::sb_python.
Referenced by main().
Generate package dependencies.
spec | spec file control | |
pkg | package control |
Definition at line 1614 of file rpmfc.c.
Referenced by processBinaryFiles().
static int rpmfcHelper | ( | rpmfc | fc, | |
unsigned char | deptype, | |||
const char * | nsdep | |||
) | [static] |
Run per-interpreter dependency helper.
fc | file classifier | |
deptype | 'P' == Provides:, 'R' == Requires:, helper | |
nsdep | class name for interpreter (e.g. "perl") |
Definition at line 316 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(), 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 rpmfcSCRIPT().
rpmfc rpmfcNew | ( | void | ) |
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 542 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().
static int rpmfcSaveArg | ( | ARGV_t * | argvp, | |
const char * | key | |||
) | [static] |
Definition at line 270 of file rpmfc.c.
References argvAdd(), argvSearch(), and argvSort().
Referenced by rpmfcELF(), rpmfcHelper(), rpmfcSCRIPT(), and rpmfcSYMLINK().
static int rpmfcSCRIPT | ( | rpmfc | fc | ) | [static] |
Extract script dependencies.
fc | file classifier |
Definition at line 753 of file rpmfc.c.
References rpmfc_s::ddict, rpmfc_s::fcolor, rpmfc_s::fn, rpmfc_s::ix, rpmfc_s::requires, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), RPMFC_MODULE, RPMFC_MONO, RPMFC_PERL, RPMFC_PYTHON, rpmfcFileDep(), rpmfcHelper(), rpmfcSaveArg(), RPMSENSE_FIND_REQUIRES, RPMTAG_REQUIRENAME, and ARGI_s::vals.
Referenced by rpmfcApply().
static int rpmfcSYMLINK | ( | rpmfc | fc | ) | [static] |
Ensure that symlinks for shared libs generate a dep on the shared lib.
fc | file classifier |
Definition at line 654 of file rpmfc.c.
References rpmfc_s::ddict, EI_CLASS, ELFCLASS64, rpmfc_s::fn, rpmfc_s::ix, PT_DYNAMIC, rpmfc_s::requires, rpmdsFree(), rpmdsMerge(), rpmdsSingle(), rpmfcFileDep(), rpmfcSaveArg(), RPMSENSE_FIND_REQUIRES, RPMTAG_REQUIRENAME, S_ISLNK, rpmfc_s::skipReq, and stpcpy().
Referenced by rpmfcApply().
struct rpmfcApplyTbl_s rpmfcApplyTable[] [static] |
Initial value:
{ { rpmfcELF, RPMFC_ELF }, { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) }, { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) }, { rpmfcSCRIPT, RPMFC_MONO }, { rpmfcSYMLINK, RPMFC_SYMLINK }, { NULL, 0 } }
struct rpmfcTokens_s rpmfcTokens[] [static] |