summaryrefslogtreecommitdiff
path: root/lib/rpmfi_internal.h
AgeCommit message (Collapse)AuthorFilesLines
2023-11-16Upgrade version to 4.14tizen/4.14.1.1.tizen20230628wangbiao1-137/+43
Change-Id: I21bf1a3a7c25cbec43022202cf2e5865b603a309 Signed-off-by: wangbiao <biao716.wang@samsung.com>
2012-11-01Hide the strpool-related rpmts/rpmfi/rpmds interfaces out of sight for nowPanu Matilainen1-0/+35
- In the package/transaction related things the strpool is more of an internal implementation detail than an end-goal in itself, move string pool related interfaces of rpmts, rpmfi and rpmds to internal-only APIs for now. The kind interfaces we'll want to eventually export a) dont exist yet and b) are likely to be something very different. - The string pool itself remains exported however, its a handy data structure for all sorts of things and both librpm and librpmbuild heavily use it already.
2012-09-14Make fingerprint struct opaque outside fprint.cPanu Matilainen1-1/+1
- rpmfi cannot know anything about the storage, so rpmfiFpxIndex() cannot be... change it to rpmfiFps() which only returns the pointer we got from fpLookupList() - Change fpCacheGetByFp() to assume it gets passed an array of fps, and take an additional index argument. Return the fingerprint pointer on success, NULL on not found to allow further operations on the fp without knowing its internals.
2012-09-12Add getters for rpmfi base- and directory name pool id'sPanu Matilainen1-0/+6
2012-09-08Switch file info set base- and dirnames storage to string poolPanu Matilainen1-2/+2
- Always push base and dir names into file info sets string pool, whether private or shared. For basenames, this can save significant space even in a private pool, for dirnames private pool is moot as the names are already unique, shared pool is quite another story. - Adjust fpLookupList() to take a pool and id's as arguments. - This introduces a fair amount of overhead, so things will be somewhat slower until the transition to pool id's is (more) complete. Sometimes things have to get worse before they get better... Other than that, this should be entirely invisible to callers.
2012-09-07Axe the no longer needed rpmfi string "cache" stuffPanu Matilainen1-7/+0
2012-09-07Use string pool for file set symlinksPanu Matilainen1-2/+2
- Removes the last use of our former simple, stupid and slow caches - For now, use a per-fi pool for this just like the previous caching did. Memory use is slightly increased but its faster than before, to reap the full benefits (memory and otherwise) we'll want a per-transaction pool for these, to be added later.
2012-09-07Replace user- and groupname + file lang caches with a global stringpoolPanu Matilainen1-3/+4
- With the string pool we dont have to worry about overflowing the indexes so we can lump all this relatively static data into one pool. Because rpmsid's are larger than the previous cache indexes, we'll loose some of the memory savings, but then the pool is faster on insertion, and we'll only need one of them so... - The misc. pool is never freed, flushed or frozen so it'll "waste" memory throughout the lifetime of a process (similarly to the previous caches) but its not huge so .. ignoring that for now.
2012-09-07Dont bother with file capability "cache"Panu Matilainen1-2/+1
- Very few packages have RPMTAG_FILECAPS at all, and the memory saving for those that do is so marginal it hardly matters at all. At least for now, dont bother.
2012-04-12Change rpmfi replaced size functions to take indexPanu Matilainen1-2/+2
- Further preliminaries to handle file conflicts within a package. - These are internal-only interfaces so we can just change without bothering with compat wrappers.
2012-04-12Add rpmfiFooIndex() variants for the conflict handling methodsPanu Matilainen1-0/+10
- Preliminaries for handling file conflicts within a package: Using rpmfi's self-iterator limits access to the file info to one caller at a time, in order to self-file conflicts we'll need to be able to access the same rpmfi at different indexes simultaneously. - As these are public API's, add compat wrappers for the self-iterator use (although AFAIK nothing except rpm itself uses these)
2012-04-12Make rpmfiFNIndex() safe for callers on different indexesPanu Matilainen1-1/+1
- Previously this would return a pointer to an internal per-rpmfi buffer whose contents get silently overwritten on each call to rpmfiFNIndex(), making it unsafe for unsafe for random access for more than one active caller (such code does not currently exist in rpm though) - Make rpmfiFNIndex() always return freshly allocated memory, and adjust the rpmfiFN() iteration wrapper to free and realloc the internal "buffer" on each call. It's a wee bit slower than before but it's not called *that* much, and if needed there are ways to optimize it.
2012-04-04Remove unused scareFlags member from rpmfi structPanu Matilainen1-1/+0
- This is just a leftover from rpm < 4.7.x days
2012-01-11Turn FSM into a blackbox, much like PSM isPanu Matilainen1-5/+0
- Similar in spirit to PSM blackbox treatment in commit df9cdb1321ada8e3b120771f91a2eefab4ac2ad5, except that technically fsm guts are still wide-open in fsm.h due to cpio "needing" them (yuck). - Allows getting rid of dumb a**-backwards things like rpmfiFSM() which is just not needed, fsm is a relatively short-lived entity inside psm and build, nobody else needs to bother with it except for the returned results. - Figure out the cpio map flags in fsmSetup() where it logically belongs, we have all the necessary info available there. - Get rid of newFSM() and freeFSM(), we can just as well place the fsm on stack, merge the necessary cleanup bits from freeFSM() into fsmTeardown() - Supposedly no functional changes, knock wood.
2012-01-11Eliminate archiveSize member from rpmfiPanu Matilainen1-1/+0
- rpmfi itself doesn't need it for anything, its only really used for progress reporting during install. Grab the size into psm total directly, this is already passed down to fsm. - Removes one of the last remaining rpmfi opacity violations, just fi->apath to go...
2010-10-22Eliminate pgpHashAlgo uses in librpm sidePanu Matilainen1-2/+2
- In all these cases the value comes from a non-enum source so just use an int instead
2010-09-21Add "c++ protection" to (hopefully) all of our internal headersPanu Matilainen1-0/+9
2010-03-01Rip out more rpm 2.x era relocation leftoversPanu Matilainen1-1/+0
- we can't even read packages from that timeframe, much less relocate them
2009-12-22Kill off last remaining uses of _constfree()Panu Matilainen1-12/+12
- practially all the data in rpmfi needs to be treated as const, these are just a funky special case which point to header memory for the couple of cases where KEEPHEADER is still used
2009-03-27Tidy up rpmfi struct definition a bitPanu Matilainen1-18/+6
2009-03-27Lose unused/useless Type and tagN fields from rpmfi structPanu Matilainen1-3/+0
2009-02-27Add md5->filedigest aliases (rhbz#487597)Jindrich Novy1-2/+2
- add %verify(nofiledigest) as %verify(nomd5) file attribute alias - reference digests as digests not checksums - make old md5 related symbols obsolete and use newer reference - update man page accordingly
2009-02-05Use per-rpmfi string cache for file capability stringsPanu Matilainen1-1/+2
- most packages wont have file capabilities attached at all, and even where present, the files with capabilities are likely to be few and far in between, avoid wasting memory
2008-12-19Add internal rpmfi apis to deal with fingerprints, use themPanu Matilainen1-1/+7
2008-12-11Add (internal) rpmfi accessor for dir indexesPanu Matilainen1-0/+3
- except for dnli->active setting in dnlInitIterator(), "give me directory matching this basename index" would be sufficient
2008-12-11Add indexed accessors for rpmfi data, internal only for nowPanu Matilainen1-0/+63
- fsm in particular wants random access to rpmfi data and there's little reason to deny it, file info data is not going to move to linked lists or anything like that anytime soon, permitting indexed access allows eliminating direct accesses to rpmfi struct
2008-12-10Kill rpmfiUpdateState and free all the rpmfis as soon as file conflict check ↵Florian Festi1-3/+0
is done
2008-12-10Move ->actions from rpmfi to rpmfsFlorian Festi1-1/+0
and adjust all code using it also "revert" a4e345455d817ce6c56940600d652ee3ae0aa5d5 "Move file action calculations to rpmfiNew() where possible"
2008-12-10Move the run time part of fstates from rpmfi to rpmfs. Keep fstates in rpmfi ↵Florian Festi1-3/+0
as long as it is a real tag read from the rpmdb.
2008-12-10Create a new datastructure rpmfs aka File States that contains the ↵Florian Festi1-23/+0
information what to do with the files of an transaction element. This patch moves rpmfi->replaced over to rpmfs. Move struct members to follow.
2008-11-27Eliminate the now unused ts element field of file info setsPanu Matilainen1-2/+0
2008-11-24Move transscripts stuff from rpmfi to rpmtePanu Matilainen1-4/+0
- transaction scripts have zero to do with files...
2008-11-24API for accessing and creating fi->replacedFlorian Festi1-2/+12
- new API is not compatible with accessing fi->replaced directly!
2008-11-20Use per-rpmfi string cache for symlink targetsPanu Matilainen1-1/+2
- few files are actually symlinks so this is very sparse data - per-rpmfi instead of global as link target names are not that likely to be shared across packages - another few megs saved...
2008-11-20Add functions to create and free string cache(s)Panu Matilainen1-0/+1
2008-11-20Use global cache for file languages tooPanu Matilainen1-1/+1
- there's only a very limited number of language names ever present, and most files don't have languages attached at all - another few megs saved on memory
2008-11-20Generalize the user+group string cache + helpersPanu Matilainen1-5/+5
2008-11-19Be more intelligent about storing file user and group namesPanu Matilainen1-2/+8
- User and group names contain an enormous amount of redundancy: typically most files and directories are owned by root:root. Store the each unique name just once into global cache and store indexes to the cache into rpmfi user + group arrays. This saves several megabytes of memory on a transaction of non-trivial size... - The cache implementation is dumb, but it's not noticeably slower than uncached version, copying megs of strings around is not cheap either. Easy enough to replace with a hash-table or such if performace becomes and issue...
2008-11-19Add + use internal helper function for getting+setting rpmfi replaced sizesPanu Matilainen1-0/+6
- lazy allocation on set, otherwise there's no replaced size - the getter deals with this transparently - saves a fair bit of memory, by no means everything has replaced files...
2008-11-19Eliminate unnecessary fi->record fieldPanu Matilainen1-1/+0
- transaction elements carry the db instance already and is available where needed
2008-11-18Remove useless default flags and action fields from rpmfiPanu Matilainen1-2/+0
- fi->actions is always allocated so fi->action is never used for anything - fi->flags is just as unused and unnecessary
2008-11-18Nuke useless rpmfiFContext()Panu Matilainen1-3/+0
- it only ever returns NULLs because there are no security contexts in headers (and having them in headers make no sense as the context varies based on whatever selinux policy happens to be active on the target system)
2008-11-18Lazy allocation of FSM for file info setsPanu Matilainen1-0/+2
- new more or less internal rpmfiFSM() to create FSM on demand, move mapflags calculation there
2008-11-18Remove now unnecessary fi->keep_headerPanu Matilainen1-1/+0
2008-11-18Remember rpmfi creation flagsPanu Matilainen1-0/+1
2008-11-17Add + use internal helper function for setting rpmfi file statesPanu Matilainen1-0/+3
- instead of directly accessing the array from fsm, use a helper function which lazily allocates the state array as needed and sets state - also fixes the silly case of non-installed packages showing their files as "normal", ie installed (now it shows "no state" as it's not relevant)
2008-11-15Eliminate bogus const from fi->apathPanu Matilainen1-1/+1
2008-11-15Lose useless fsm/rpmfi astriplen fieldPanu Matilainen1-1/+0
- only "used" for debugging output, duh...
2008-11-14Yank rpmfi state update out of rpmtsRun()Panu Matilainen1-0/+3
- stuff it into internal rpmfiUpdateState() function to get it out of sight for now, the mechanism needs some...
2008-11-11Cpio flags are only relevant for fsm, get them out of rpmfiPanu Matilainen1-1/+0