#include "system.h"
#include <regex.h>
#include <signal.h>
#include "rpmio_internal.h"
#include "rpmbuild.h"
#include "buildio.h"
#include "myftw.h"
#include "md5.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
| struct | AttrRec_s |
| struct | DepMsg_t |
| struct | FileList_s |
| Package file tree walk data. More... | |
| struct | FileListRec_s |
| struct | VFA |
Defines | |
| #define | MYALLPERMS 07777 |
| #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) |
| 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 | parseForRegexMultiLib (const char *fileName) |
| 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, TFI_t *cpioList, Header h, int isSrc) |
| Add file entries to header. | |
| FileListRec | freeFileList (FileListRec fileList, int count) |
| int | addFile (FileList fl, const char *diskURL, struct stat *statp) |
| Add a file to the package manifest. | |
| 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) |
| StringBuf | getOutputFrom (char *dir, const char *argv[], char *envp[], const char *writePtr, int writeBytesLeft, int failNonZero) |
| int | generateDepends (Spec spec, Package pkg, TFI_t cpioList, int multiLib) |
| void | printDepMsg (DepMsg_t *dm, int count, const char **names, const char **versions, int *flags) |
| void | printDeps (Header h) |
| int | processBinaryFiles (Spec spec, int installSpecialDoc, int test) |
Variables | |
| int | _noDirTokens |
| int | multiLib = 0 |
| VFA_t | verifyAttrs [] |
| VFA_t | virtualFileAttributes [] |
| DepMsg_t | depMsgs [] |
Definition in file files.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 395 of file files.c. Referenced by parseForAttr(). |
|
|
Definition at line 31 of file files.c. Referenced by parseForSimple(). |
|
|
Definition at line 9 of file files.c. Referenced by parseForAttr(). |
|
|
Definition at line 29 of file files.c. Referenced by parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parseNoSource(), and parseRCPOT(). |
|
|
Definition at line 28 of file files.c. Referenced by parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parseNoSource(), and parseRCPOT(). |
|
|
|
|
|
Package file tree walk data.
|
|
|
|
|
|
Referenced by parseForAttr(), and parseForVerify(). |
|
|
|
|
|
|
|
||||||||||||||||
|
|
Verify that file attributes scope over hardlinks correctly. If partial hardlink sets are possible, then add tracking dependency.
Definition at line 1074 of file files.c. References FileList_s::fileList, FileList_s::fileListRecsUsed, and FileListRec_s::langs. Referenced by processPackageFiles(). |
|
||||||||||||
|
Definition at line 1042 of file files.c. Referenced by genCpioListAndHeader(). |
|
||||||||||||
|
Definition at line 162 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, freeAttrRec(), and xstrdup(). Referenced by parseForAttr(), and processPackageFiles(). |
|
|
Definition at line 148 of file files.c. References _free(), AttrRec_s::ar_dmodestr, AttrRec_s::ar_fmodestr, AttrRec_s::ar_group, and AttrRec_s::ar_user. Referenced by dupAttrRec(), and processPackageFiles(). |
|
||||||||||||
|
Definition at line 1469 of file files.c. References _free(), FileListRec_s::diskURL, FileListRec_s::fileURL, and FileListRec_s::langs. Referenced by processPackageFiles(), and processSourceFiles(). |
|
||||||||||||||||||||
|
Add file entries to header.
Definition at line 1120 of file files.c. References _, _free(), transactionFileInfo_s::actions, transactionFileInfo_s::apath, transactionFileInfo_s::astriplen, transactionFileInfo_s::bnl, FileList_s::buildRootURL, compareFileListRecs(), compressFilelist(), CPIO_FOLLOW_SYMLINKS, CPIO_MAP_GID, CPIO_MAP_MODE, CPIO_MAP_PATH, CPIO_MAP_TYPE, CPIO_MAP_UID, CPIO_MULTILIB, transactionFileInfo_s::dil, FileListRec_s::diskURL, transactionFileInfo_s::dnl, domd5(), expandFilelist(), FA_COPYOUT, FA_SKIP, transactionFileInfo_s::fc, transactionFileInfo_s::fgids, transactionFileInfo_s::fgroup, FileList_s::fileList, FileList_s::fileListRecsUsed, FileListRec_s::fileURL, FileListRec_s::flags, transactionFileInfo_s::fmapflags, transactionFileInfo_s::fuids, transactionFileInfo_s::fuser, getGidS(), getUidS(), FileListRec_s::gname, headerAddEntry(), headerAddOrAppendEntry(), isDoc(), FileListRec_s::langs, loadFi(), FileList_s::prefix, FileList_s::processingFailed, Readlink(), RPM_INT16_TYPE, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMERR_BADSPEC, rpmError, rpmExpandNumeric(), RPMFILE_CONFIG, RPMFILE_DOC, RPMFILE_EXCLUDE, RPMFILE_GHOST, RPMFILE_MULTILIB_MASK, RPMFILE_MULTILIB_SHIFT, rpmlibNeedsFeature(), RPMMESS_WARNING, rpmMessage, 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_MULTILIBS, RPMTAG_OLDFILENAMES, RPMTAG_SIZE, RPMVERIFY_FILESIZE, RPMVERIFY_LINKTO, RPMVERIFY_MD5, RPMVERIFY_MTIME, S_ISLNK, SPECD_DEFDIRMODE, SPECD_DEFFILEMODE, SPECD_DEFGID, SPECD_DEFUID, SPECD_DEFVERIFY, SPECD_DIRMODE, SPECD_FILEMODE, SPECD_GID, SPECD_UID, SPECD_VERIFY, FileListRec_s::specdFlags, stpcpy(), transactionFileInfo_s::striplen, FileList_s::totalFileSize, transactionFileInfo_s::type, uint_16, uint_32, FileListRec_s::uname, urlPath(), FileListRec_s::verifyFlags, xcalloc(), and xmalloc(). Referenced by processPackageFiles(), and processSourceFiles(). |
|
||||||||||||||||||||
|
Definition at line 2461 of file files.c. References _, _free(), addMacro(), appendLineStringBuf, appendStringBuf, DepMsg_t::argv, PackageStruct::autoProv, PackageStruct::autoReq, transactionFileInfo_s::bnl, CPIO_MULTILIB, delMacro(), transactionFileInfo_s::dil, transactionFileInfo_s::dnl, transactionFileInfo_s::fc, Fclose(), fdGetFp(), Fdopen(), Ferror(), Fileno(), transactionFileInfo_s::fmapflags, freeStringBuf(), DepMsg_t::ftag, getOutputFrom(), getStringBuf(), PackageStruct::header, headerNVR(), urlinfo_s::host, SpecStruct::macros, makeTempFile(), DepMsg_t::msg, multiLib, newStringBuf(), DepMsg_t::ntag, parseRCPOT(), RMIL_SPEC, SpecStruct::rootURL, RPMERR_EXEC, RPMERR_SCRIPT, rpmError, rpmExpand(), rpmGenPath(), RPMMESS_NORMAL, rpmMessage, RPMSENSE_FIND_PROVIDES, RPMSENSE_FIND_REQUIRES, RPMSENSE_MULTILIB, RPMTAG_PROVIDEFLAGS, RPMTAG_REQUIREFLAGS, Unlink(), URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), urlSplit(), urlinfo_s::urltype, and xstrdup(). Referenced by processBinaryFiles(). |
|
||||||||||||||||||||||||||||
|
Definition at line 2256 of file files.c. References _, appendStringBuf, errno, EXIT_FAILURE, newStringBuf(), RPMERR_EXEC, RPMERR_FORK, and rpmError. Referenced by generateDepends(). |
|
||||||||||||
|
Test if file is located in a docdir.
Definition at line 1056 of file files.c. References FileList_s::docDirCount, and FileList_s::docDirs. Referenced by genCpioListAndHeader(). |
|
||||||||||||
|
Definition at line 697 of file files.c. Referenced by parseForLang(). |
|
|
Definition at line 136 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, and AttrRec_s::ar_user. Referenced by parseForAttr(), and processPackageFiles(). |
|
||||||||||||
|
Parse attr and defattr from file manifest.
Definition at line 503 of file files.c. References _, alloca(), FileList_s::cur_ar, FileList_s::currentSpecdFlags, FileList_s::def_ar, FileList_s::defSpecdFlags, dupAttrRec(), isAttrDefault, MYALLPERMS, nullAttrRec(), FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, SKIPNONWHITE, SKIPSPACE, SKIPWHITE, SPECD_DIRMODE, SPECD_FILEMODE, SPECD_GID, SPECD_UID, and specdFlags. Referenced by processPackageFiles(). |
|
||||||||||||
|
Parse config from file manifest.
Definition at line 637 of file files.c. References _, alloca(), FileList_s::currentFlags, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, RPMFILE_CONFIG, RPMFILE_MISSINGOK, RPMFILE_NOREPLACE, SKIPNONWHITE, SKIPSPACE, and SKIPWHITE. Referenced by processPackageFiles(). |
|
||||||||||||
|
Parse dev from file manifest.
Definition at line 403 of file files.c. References _, alloca(), FileList_s::devmajor, FileList_s::devminor, FileList_s::devtype, 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 708 of file files.c. References _, alloca(), FileList_s::currentLangs, langCmp(), FileList_s::nLangs, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, SKIPNONWHITE, SKIPSPACE, SKIPWHITE, xmalloc(), and xrealloc(). Referenced by processPackageFiles(). |
|
||||||||||||
|
Definition at line 797 of file files.c. References _free(), and rpmExpand(). Referenced by addFile(). |
|
|
Definition at line 841 of file files.c. References _free(), and rpmExpand(). Referenced by addFile(). |
|
||||||||||||||||||||||||
|
Parse simple attributes (e.g. dir) from file manifest.
Definition at line 905 of file files.c. References _, _free(), appendLineStringBuf, appendStringBuf, VFA::attribute, FileList_s::currentFlags, FileList_s::docDirCount, FileList_s::docDirs, VFA::flag, PackageStruct::header, headerNVR(), FileList_s::isDir, FileList_s::isSpecialDoc, MAXDOCDIR, MKDIR_P, multiLib, newStringBuf(), FileList_s::passedSpecialDoc, FileList_s::processingFailed, RPMERR_BADSPEC, RPMERR_INTERNAL, rpmError, rpmExpand(), RPMFILE_DOC, rpmGetPath(), PackageStruct::specialDoc, strtokWithQuotes(), and xstrdup(). Referenced by processPackageFiles(). |
|
||||||||||||
|
Definition at line 307 of file files.c. References _, alloca(), VFA::attribute, FileList_s::currentSpecdFlags, FileList_s::currentVerifyFlags, FileList_s::defSpecdFlags, FileList_s::defVerifyFlags, VFA::flag, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, RPMVERIFY_NONE, SKIPNONWHITE, SKIPSPACE, SKIPWHITE, SPECD_VERIFY, and specdFlags. Referenced by processPackageFiles(). |
|
||||||||||||||||||||||||
|
Definition at line 2705 of file files.c. References isDependsMULTILIB, DepMsg_t::mask, DepMsg_t::msg, RPMMESS_NORMAL, rpmMessage, RPMSENSE_EQUAL, RPMSENSE_GREATER, RPMSENSE_LESS, RPMSENSE_SENSEMASK, and DepMsg_t::xor. Referenced by printDeps(). |
|
|
Definition at line 2747 of file files.c. References DepMsg_t::ftag, HFD_t, HGE_t, DepMsg_t::msg, DepMsg_t::ntag, printDepMsg(), rpmTagType, and DepMsg_t::vtag. Referenced by processBinaryFiles(). |
|
||||||||||||||||
|
Add a file to a binary package.
Definition at line 1711 of file files.c. References _, _free(), addFile(), FileList_s::buildRootURL, myGlobPatternP(), FileList_s::noGlob, FileList_s::processingFailed, RPMERR_BADSPEC, rpmError, rpmGenPath(), rpmGlob(), and urlPath(). Referenced by processPackageFiles(). |
|
||||||||||||||||||||
|
Definition at line 1786 of file files.c. References _, _free(), appendStringBuf, SpecStruct::buildRootURL, FileList_s::buildRootURL, SpecStruct::buildSubdir, checkHardLinks(), PackageStruct::cpioList, FileList_s::cur_ar, FileList_s::currentFlags, FileList_s::currentLangs, FileList_s::currentSpecdFlags, FileList_s::currentVerifyFlags, FileList_s::def_ar, FileList_s::defSpecdFlags, FileList_s::defVerifyFlags, FileList_s::devmajor, FileList_s::devminor, FileList_s::devtype, FileList_s::docDirCount, FileList_s::docDirs, doScript(), dupAttrRec(), expandMacros(), Fclose(), fdGetFp(), Ferror(), FileList_s::fileCount, PackageStruct::fileFile, FileList_s::fileList, PackageStruct::fileList, FileList_s::fileListRecsAlloced, FileList_s::fileListRecsUsed, Fopen(), freeAttrRec(), freeFileList(), freeSplitString(), Fstrerror(), genCpioListAndHeader(), getStringBuf(), handleComments(), PackageStruct::header, HGE_t, FileList_s::inFtw, FileList_s::isDir, FileList_s::isSpecialDoc, SpecStruct::macros, multiLib, FileList_s::nLangs, FileList_s::noGlob, nullAttrRec(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForSimple(), parseForVerify(), FileList_s::passedSpecialDoc, FileList_s::prefix, processBinaryFile(), FileList_s::processingFailed, SpecStruct::rootURL, RPMBUILD_STRINGBUF, RPMERR_BADFILENAME, RPMERR_BADSPEC, rpmError, rpmExpand(), rpmExpandNumeric(), RPMFILE_MULTILIB, rpmGenPath(), rpmGetPath(), rpmlibNeedsFeature(), RPMTAG_DEFAULTPREFIX, RPMVERIFY_ALL, SKIPSPACE, PackageStruct::specialDoc, splitString(), timeCheck(), SpecStruct::timeCheck, FileList_s::totalFileSize, and xstrdup(). Referenced by processBinaryFiles(). |
|
||||||||||||
|
Definition at line 214 of file files.c. Referenced by parseForSimple(). |
|
||||||||||||
|
Definition at line 257 of file files.c. References _, HFD_t, HGE_t, RPMMESS_WARNING, rpmMessage, RPMTAG_FILEMTIMES, RPMTAG_OLDFILENAMES, and rpmTagType. Referenced by processPackageFiles(). |
|
|
|
|
|
Definition at line 91 of file files.c. Referenced by addFile(), generateDepends(), parseForSimple(), and processPackageFiles(). |
|
|
Initial value: {
{ "md5", RPMVERIFY_MD5 },
{ "size", RPMVERIFY_FILESIZE },
{ "link", RPMVERIFY_LINKTO },
{ "user", RPMVERIFY_USER },
{ "group", RPMVERIFY_GROUP },
{ "mtime", RPMVERIFY_MTIME },
{ "mode", RPMVERIFY_MODE },
{ "rdev", RPMVERIFY_RDEV },
{ NULL, 0 }
} |
|
|
Initial value: {
{ "%dir", 0 },
{ "%doc", RPMFILE_DOC },
{ "%ghost", RPMFILE_GHOST },
{ "%exclude", RPMFILE_EXCLUDE },
{ "%readme", RPMFILE_README },
{ "%license", RPMFILE_LICENSE },
{ "%multilib", 0 },
{ NULL, 0 }
} |
1.2.18