#include "system.h"
#include <regex.h>
#include <rpmio_internal.h>
#include <fts.h>
#include <rpmbuild.h>
#include "cpio.h"
#include "argv.h"
#include "rpmfc.h"
#include "rpmfi.h"
#include "rpmsx.h"
#include "rpmte.h"
#include "buildio.h"
#include "legacy.h"
#include "misc.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | FileListRec_s |
struct | AttrRec_s |
struct | FileList_s |
Package file tree walk data. More... | |
struct | VFA |
Defines | |
#define | MYALLPERMS 07777 |
#define | _RPMFI_INTERNAL |
#define | _RPMTE_INTERNAL |
#define | SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;} |
#define | SKIPNONWHITE(_x) {while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;} |
#define | MAXDOCDIR 1024 |
#define | fl_dev fl_st.st_dev |
#define | fl_ino fl_st.st_ino |
#define | fl_mode fl_st.st_mode |
#define | fl_nlink fl_st.st_nlink |
#define | fl_uid fl_st.st_uid |
#define | fl_gid fl_st.st_gid |
#define | fl_rdev fl_st.st_rdev |
#define | fl_size fl_st.st_size |
#define | fl_mtime fl_st.st_mtime |
#define | isAttrDefault(_ars) ((_ars)[0] == '-' && (_ars)[1] == '\0') |
Typedefs | |
typedef enum specdFlags_e | specdFlags |
typedef FileListRec_s * | FileListRec |
typedef AttrRec_s * | AttrRec |
typedef FileList_s * | FileList |
Package file tree walk data. | |
typedef VFA | VFA_t |
Enumerations | |
enum | specdFlags_e { SPECD_DEFFILEMODE = (1 << 0), SPECD_DEFDIRMODE = (1 << 1), SPECD_DEFUID = (1 << 2), SPECD_DEFGID = (1 << 3), SPECD_DEFVERIFY = (1 << 4), SPECD_FILEMODE = (1 << 8), SPECD_DIRMODE = (1 << 9), SPECD_UID = (1 << 10), SPECD_GID = (1 << 11), SPECD_VERIFY = (1 << 12) } |
Functions | |
void | nullAttrRec (AttrRec ar) |
void | freeAttrRec (AttrRec ar) |
void | dupAttrRec (const AttrRec oar, AttrRec nar) |
char * | strtokWithQuotes (char *s, char *delim) |
void | timeCheck (int tc, Header h) |
int | parseForVerify (char *buf, FileList fl) |
Parse verify and defverify from file manifest. | |
int | parseForDev (char *buf, FileList fl) |
Parse dev from file manifest. | |
int | parseForAttr (char *buf, FileList fl) |
Parse attr and defattr from file manifest. | |
int | parseForConfig (char *buf, FileList fl) |
Parse config from file manifest. | |
int | langCmp (const void *ap, const void *bp) |
int | parseForLang (char *buf, FileList fl) |
Parse lang from file manifest. | |
int | parseForRegexLang (const char *fileName, char **lang) |
int | parseForSimple (Spec spec, Package pkg, char *buf, FileList fl, const char **fileName) |
Parse simple attributes (e.g. | |
int | compareFileListRecs (const void *ap, const void *bp) |
int | isDoc (FileList fl, const char *fileName) |
Test if file is located in a docdir. | |
int | checkHardLinks (FileList fl) |
Verify that file attributes scope over hardlinks correctly. | |
void | genCpioListAndHeader (FileList fl, rpmfi *fip, Header h, int isSrc) |
Add file entries to header. | |
FileListRec | freeFileList (FileListRec fileList, int count) |
int | recurseDir (FileList fl, const char *diskURL) |
Add directory (and all of its files) to the package manifest. | |
int | addFile (FileList fl, const char *diskURL, struct stat *statp) |
Add a file to the package manifest. | |
int | processMetadataFile (Package pkg, FileList fl, const char *fileURL, rpmTag tag) |
Add a pubkey/policy/icon to a binary package. | |
int | processBinaryFile (Package pkg, FileList fl, const char *fileURL) |
Add a file to a binary package. | |
int | processPackageFiles (Spec spec, Package pkg, int installSpecialDoc, int test) |
void | initSourceHeader (Spec spec) |
int | processSourceFiles (Spec spec) |
int | checkFiles (StringBuf fileList) |
Check packaged file list against what's in the build root. | |
int | processBinaryFiles (Spec spec, int installSpecialDoc, int test) |
Variables | |
StringBuf | check_fileList = NULL |
VFA_t | verifyAttrs [] |
VFA_t | virtualFileAttributes [] |
Definition in file files.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 407 of file files.c. Referenced by parseForAttr(). |
|
|
|
|
|
Definition at line 44 of file files.c. Referenced by parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parseNoSource(), and parseRCPOT(). |
|
Definition at line 43 of file files.c. Referenced by parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parseNoSource(), and parseRCPOT(). |
|
Referenced by dupAttrRec(), freeAttrRec(), nullAttrRec(), parseForAttr(), and processPackageFiles(). |
|
Package file tree walk data.
Referenced by addFile(), checkHardLinks(), genCpioListAndHeader(), isDoc(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForSimple(), parseForVerify(), processBinaryFile(), processMetadataFile(), and recurseDir(). |
|
Referenced by addFile(), checkHardLinks(), compareFileListRecs(), freeFileList(), genCpioListAndHeader(), and processSourceFiles(). |
|
Referenced by parseForAttr(), and parseForVerify(). |
|
Referenced by parseForSimple(), and parseForVerify(). |
|
|
|
|
Check packaged file list against what's in the build root.
Definition at line 2393 of file files.c. References _, _free(), freeStringBuf(), getStringBuf(), rpmExpand(), rpmExpandNumeric(), rpmfcExec(), RPMMESS_ERROR, RPMMESS_NORMAL, RPMMESS_WARNING, rpmMessage, and StringBuf. Referenced by processBinaryFiles(). |
|
Verify that file attributes scope over hardlinks correctly. If partial hardlink sets are possible, then add tracking dependency.
Definition at line 1069 of file files.c. References FileList_s::fileList, FileList, FileListRec, and FileList_s::fileListRecsUsed. Referenced by processPackageFiles(). |
|
Definition at line 1038 of file files.c. References FileListRec. Referenced by genCpioListAndHeader(). |
|
Definition at line 181 of file files.c. References AttrRec_s::ar_dmode, AttrRec_s::ar_dmodestr, AttrRec_s::ar_fmode, AttrRec_s::ar_fmodestr, AttrRec_s::ar_group, AttrRec_s::ar_user, AttrRec, freeAttrRec(), and xstrdup(). Referenced by parseForAttr(), and processPackageFiles(). |
|
Definition at line 167 of file files.c. References _free(), AttrRec_s::ar_dmodestr, AttrRec_s::ar_fmodestr, AttrRec_s::ar_group, AttrRec_s::ar_user, and AttrRec. Referenced by dupAttrRec(), and processPackageFiles(). |
|
Definition at line 1453 of file files.c. References _free(), FileListRec_s::diskURL, FileListRec, FileListRec_s::fileURL, and FileListRec_s::langs. Referenced by processPackageFiles(), and processSourceFiles(). |
|
Add file entries to header.
Definition at line 1106 of file files.c. References _, _free(), FileList_s::buildRootURL, compareFileListRecs(), compressFilelist(), CPIO_MAP_MODE, CPIO_MAP_PATH, CPIO_MAP_TYPE, CPIO_MAP_UID, FileListRec_s::diskURL, domd5(), expandFilelist(), FileList_s::fileList, FileList, FileListRec, FileList_s::fileListRecsUsed, FileListRec_s::fileURL, FileListRec_s::flags, FileListRec_s::gname, Header, headerAddEntry(), headerAddOrAppendEntry(), isDoc(), FileListRec_s::langs, FileList_s::prefix, FileList_s::processingFailed, Readlink(), RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMERR_BADSPEC, rpmError, rpmExpandNumeric(), rpmfi, rpmfiFree(), RPMFILE_CONFIG, rpmfiNew(), rpmGetPath(), rpmlibNeedsFeature(), RPMMESS_WARNING, rpmMessage, rpmsx, rpmsxFContext(), rpmsxFree(), rpmsxNew(), RPMTAG_BASENAMES, RPMTAG_FILECONTEXTS, RPMTAG_FILEDEVICES, RPMTAG_FILEFLAGS, RPMTAG_FILEGROUPNAME, RPMTAG_FILEINODES, RPMTAG_FILELANGS, RPMTAG_FILELINKTOS, RPMTAG_FILEMD5S, RPMTAG_FILEMODES, RPMTAG_FILEMTIMES, RPMTAG_FILERDEVS, RPMTAG_FILESIZES, RPMTAG_FILEUSERNAME, RPMTAG_FILEVERIFYFLAGS, RPMTAG_OLDFILENAMES, RPMTAG_SIZE, rpmts, RPMVERIFY_FILESIZE, RPMVERIFY_LINKTO, RPMVERIFY_MD5, S_ISLNK, SPECD_DIRMODE, SPECD_FILEMODE, SPECD_GID, SPECD_UID, SPECD_VERIFY, FileListRec_s::specdFlags, stpcpy(), FileList_s::totalFileSize, uint_16, uint_32, FileListRec_s::uname, urlPath(), FileListRec_s::verifyFlags, xcalloc(), and xmalloc(). Referenced by processPackageFiles(), and processSourceFiles(). |
|
Test if file is located in a docdir.
Definition at line 1052 of file files.c. References FileList_s::docDirCount, FileList_s::docDirs, and FileList. Referenced by genCpioListAndHeader(). |
|
Definition at line 712 of file files.c. Referenced by parseForLang(). |
|
Definition at line 155 of file files.c. References AttrRec_s::ar_dmode, AttrRec_s::ar_dmodestr, AttrRec_s::ar_fmode, AttrRec_s::ar_fmodestr, AttrRec_s::ar_group, AttrRec_s::ar_user, and AttrRec. Referenced by parseForAttr(), and processPackageFiles(). |
|
Parse attr and defattr from file manifest.
Definition at line 518 of file files.c. References _, alloca(), AttrRec, FileList_s::cur_ar, FileList_s::currentSpecdFlags, FileList_s::def_ar, FileList_s::defSpecdFlags, dupAttrRec(), FileList, isAttrDefault, nullAttrRec(), FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, SKIPNONWHITE, SKIPSPACE, SKIPWHITE, SPECD_FILEMODE, SPECD_GID, SPECD_UID, and specdFlags. Referenced by processPackageFiles(). |
|
Parse config from file manifest.
Definition at line 651 of file files.c. References _, alloca(), FileList_s::currentFlags, FileList, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, SKIPNONWHITE, SKIPSPACE, and SKIPWHITE. Referenced by processPackageFiles(). |
|
Parse dev from file manifest.
Definition at line 416 of file files.c. References _, alloca(), FileList_s::devmajor, FileList_s::devminor, FileList_s::devtype, FileList, FileList_s::noGlob, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, SKIPNONWHITE, SKIPSPACE, SKIPWHITE, and xisdigit(). Referenced by processPackageFiles(). |
|
Parse lang from file manifest.
Definition at line 727 of file files.c. References _, alloca(), FileList_s::currentLangs, FileList, langCmp(), FileList_s::nLangs, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, SKIPNONWHITE, SKIPSPACE, SKIPWHITE, xmalloc(), and xrealloc(). Referenced by processPackageFiles(). |
|
Definition at line 818 of file files.c. References _free(), and rpmExpand(). Referenced by addFile(). |
|
Parse simple attributes (e.g. dir) from file manifest.
Definition at line 897 of file files.c. References _, _free(), appendLineStringBuf, appendStringBuf, VFA::attribute, FileList_s::currentFlags, FileList_s::docDirCount, FileList_s::docDirs, FileList, VFA::flag, Package_s::header, headerNVR(), FileList_s::isDir, FileList_s::isSpecialDoc, MKDIR_P, newStringBuf(), VFA::not, Package, FileList_s::passedSpecialDoc, FileList_s::processingFailed, RPMERR_BADSPEC, RPMERR_INTERNAL, rpmError, RPMFILE_POLICY, RPMFILE_PUBKEY, rpmGetPath(), Spec, Package_s::specialDoc, strtokWithQuotes(), VFA_t, and xstrdup(). Referenced by processPackageFiles(). |
|
Parse verify and defverify from file manifest.
Definition at line 318 of file files.c. References _, alloca(), VFA::attribute, FileList_s::currentSpecdFlags, FileList_s::currentVerifyFlags, FileList_s::defSpecdFlags, FileList_s::defVerifyFlags, FileList, VFA::flag, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, SKIPNONWHITE, SKIPSPACE, SKIPWHITE, specdFlags, and VFA_t. Referenced by processPackageFiles(). |
|
Add a file to a binary package.
Definition at line 1828 of file files.c. References _, _free(), addFile(), argv, FileList_s::buildRootURL, FileList, Glob_pattern_p(), FileList_s::noGlob, Package, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, rpmGenPath(), rpmGlob(), and urlPath(). Referenced by processPackageFiles(). |
|
Add a pubkey/policy/icon to a binary package.
Definition at line 1750 of file files.c. References _, _free(), addFile(), FileList_s::buildRootURL, FileList, Package_s::header, headerAddOrAppendEntry(), Package, PGPARMOR_PUBKEY, pgpArmorWrap(), pgpReadPkts(), FileList_s::processingFailed, RPM_STRING_ARRAY_TYPE, RPMERR_BADSPEC, rpmError, rpmGenPath(), rpmioSlurp(), RPMTAG_POLICIES, RPMTAG_PUBKEYS, and urlPath(). Referenced by processPackageFiles(). |
|
Definition at line 1910 of file files.c. References _, _free(), appendStringBuf, AttrRec, Spec_s::buildRootURL, Spec_s::buildSubdir, checkHardLinks(), Package_s::cpioList, doScript(), dupAttrRec(), expandMacros(), Fclose(), FD_t, fdGetFp(), Ferror(), Package_s::fileFile, Package_s::fileList, Fopen(), freeAttrRec(), freeFileList(), freeSplitString(), Fstrerror(), genCpioListAndHeader(), getStringBuf(), handleComments(), Package_s::header, HGE_t, Spec_s::macros, nullAttrRec(), Package, parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForSimple(), parseForVerify(), processBinaryFile(), processMetadataFile(), Spec_s::rootURL, RPMBUILD_STRINGBUF, RPMERR_BADFILENAME, RPMERR_BADSPEC, rpmError, rpmExpandNumeric(), rpmGenPath(), rpmGetPath(), rpmlibNeedsFeature(), RPMTAG_DEFAULTPREFIX, RPMTAG_POLICIES, RPMTAG_PUBKEYS, SKIPSPACE, Spec, Package_s::specialDoc, splitString(), timeCheck(), Spec_s::timeCheck, and xstrdup(). Referenced by processBinaryFiles(). |
|
Add directory (and all of its files) to the package manifest.
Definition at line 1694 of file files.c. References addFile(), FileList, _ftsent::fts_accpath, Fts_close(), FTS_COMFOLLOW, FTS_D, FTS_DC, FTS_DEFAULT, FTS_DNR, FTS_DOT, FTS_DP, FTS_ERR, FTS_F, _ftsent::fts_info, FTS_INIT, FTS_NOCHDIR, FTS_NS, FTS_NSOK, Fts_open(), Fts_read(), FTS_SL, FTS_SLNONE, _ftsent::fts_statp, FTS_W, FTSENT, FileList_s::inFtw, and FileList_s::isDir. Referenced by addFile(). |
|
Definition at line 218 of file files.c. Referenced by parseForSimple(). |
|
Definition at line 262 of file files.c. References _, Header, HFD_t, HGE_t, RPMMESS_WARNING, rpmMessage, RPMTAG_FILEMTIMES, RPMTAG_OLDFILENAMES, and rpmTagType. Referenced by processPackageFiles(). |
|
Definition at line 106 of file files.c. Referenced by addFile(), and processBinaryFiles(). |
|
Initial value: { { "md5", 0, RPMVERIFY_MD5 }, { "size", 0, RPMVERIFY_FILESIZE }, { "link", 0, RPMVERIFY_LINKTO }, { "user", 0, RPMVERIFY_USER }, { "group", 0, RPMVERIFY_GROUP }, { "mtime", 0, RPMVERIFY_MTIME }, { "mode", 0, RPMVERIFY_MODE }, { "rdev", 0, RPMVERIFY_RDEV }, { NULL, 0, 0 } } |
|
Initial value: { { "%dir", 0, 0 }, { "%doc", 0, RPMFILE_DOC }, { "%ghost", 0, RPMFILE_GHOST }, { "%exclude", 0, RPMFILE_EXCLUDE }, { "%readme", 0, RPMFILE_README }, { "%license", 0, RPMFILE_LICENSE }, { "%pubkey", 0, RPMFILE_PUBKEY }, { "%policy", 0, RPMFILE_POLICY }, { NULL, 0, 0 } } |