Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I21bf1a3a7c25cbec43022202cf2e5865b603a309
Signed-off-by: wangbiao <biao716.wang@samsung.com>
|
|
- 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.
|
|
- 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.
|
|
|
|
- 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.
|
|
|
|
- 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.
|
|
- 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.
|
|
- 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.
|
|
- Further preliminaries to handle file conflicts within a package.
- These are internal-only interfaces so we can just change without
bothering with compat wrappers.
|
|
- 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)
|
|
- 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.
|
|
- This is just a leftover from rpm < 4.7.x days
|
|
- 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.
|
|
- 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...
|
|
- In all these cases the value comes from a non-enum source so
just use an int instead
|
|
|
|
- we can't even read packages from that timeframe, much less relocate them
|
|
- 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
|
|
|
|
|
|
- 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
|
|
- 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
|
|
|
|
- except for dnli->active setting in dnlInitIterator(), "give me
directory matching this basename index" would be sufficient
|
|
- 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
|
|
is done
|
|
and adjust all code using it
also "revert" a4e345455d817ce6c56940600d652ee3ae0aa5d5
"Move file action calculations to rpmfiNew() where possible"
|
|
as long as it is a real tag read from the rpmdb.
|
|
information what to do with the files of an transaction element.
This patch moves rpmfi->replaced over to rpmfs. Move struct members to follow.
|
|
|
|
- transaction scripts have zero to do with files...
|
|
- new API is not compatible with accessing fi->replaced directly!
|
|
- 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...
|
|
|
|
- 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
|
|
|
|
- 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...
|
|
- 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...
|
|
- transaction elements carry the db instance already and is available
where needed
|
|
- fi->actions is always allocated so fi->action is never used for anything
- fi->flags is just as unused and unnecessary
|
|
- 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)
|
|
- new more or less internal rpmfiFSM() to create FSM on demand, move
mapflags calculation there
|
|
|
|
|
|
- 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)
|
|
|
|
- only "used" for debugging output, duh...
|
|
- stuff it into internal rpmfiUpdateState() function to get it out of
sight for now, the mechanism needs some...
|
|
|