- When the "BEGIN PGP" marker is not found at all, we would silently
exit with success when trying to import utter garbage, such as
rpmkeys --import /bin/bash (not that I consider bash as gargabe ;)
- Prior to string pool existence, the static "caches" were kinda
necessary for sharing the relatively static content of user/group
names and file languages, but this is nothing but an unfreeable
block of memory at this point. Just use the same pool as everything
else - whether private or shared.
- If link or regular file sizes differ, they cannot possibly be
identical. Saves us from doing bunch of pointless string and
memory comparisons on what's a very busy path - not exactly a huge
with but measurable nevertheless.
Add compatibility support for both lua-5.1 and lua-5.2,
assuming that the LUA_COMPAT might have been disabled.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
- Calculating digest of %ghost config is useless as there's nothing
to compare the result to. Also we never take backups of %ghost
configuration anyway, so this is a total waste of time. One common
case of %ghost %config is the rpmdb (environment and all) which
can be rather large and calculating digests can take several seconds,
only for the results to be thrown away unused.
- There are some cases where it might be reasonable to back up %ghost
%config (eg if it gets replaced by non-config), but
rpmfiConfigConflictIndex() doesn't have sufficient context to figure
that out. For now, preserve the traditional simple rule: no backups
for ghosts, ever.
- Related to commit bee348b5d1,
use the newly added obsoletes hash to lookup already added
obsoleters. Eliminates the dumb linear lookup and is unsurprisingly
a whole lot faster on larger transactions.
- Similar lazily created hash as provides for fast obsoletes lookups.
This is so similar the provides that creation etc functions should
be unified, but leaving that exercise till later.
- Use indexed access to the dependencies so we're not mucking with
the rpmds iterator index behind anybodys back, this could affect
all sorts of things but miraculously nothing is hitting it atm...
- Add an internal header for rpmds too to allow adding interfaces we
dont necessarily want to export in the public API, make the indexed
accessors available internally.
- Various places in rpm need random access to the dependency sets,
save and restore on somebody elses "iterator index" just doesn't
cut it. This is merely preliminaries for further changes.
- Separate provides and files hash creation, delay both until the last
moment before first valid lookup. In practise, this means the provides
hash is created early due to lookups from rpmtsAddInstallElement(),
but the big bad file hash creation is delayed until the entire
transaction set has been more-or-less populated. Which means we have
a better idea about the necessary hash table size, meaning fewer
hash resizes, resulting in good deal faster execution with no
downsides - if something happened to trigger an early file lookup
it'll all still work, just slower.
- Replace the dumb linear search across all elements on each
addition with (filtered) rpmal lookups where possible. rpmal
doesn't (yet) have obsoletes information so for already added
obsoletions we have no choice but to walk the walk.
- As a result, findPos() is hugely faster for large transactions
but rpmal hashes are now generated on the fly for everything
instead of doing it all at once before the actual dependency
checks / ordering, which will cost us something in terms of
hash table resizes.
- rpmRelocateFileList() doesn't modify anything when no relocations
are to be done, but what it does is not exactly free, unnecessarily
calling it is dumb.
- The provides hash lookup can and does return hits that dont actually
satisfy the dependency. Dont bother callers with apparent hits
(ie non-NULL returns) when nothing actually matches the dependency.
- Avoids a little bit of extra work, we already have the relevant
bits of information in the rpmte and grabbing them from there is
cheaper than looking up stuff from headers. Also avoids creating
another copy of the new elements obsoletes dependency set unnecessarily.
- Now that the relevant places are accepting file index as argument,
we no longer need to save and restore fsm->ix in all the places
dealing with hard links.
- Normally this is just the current index, but when writing links
its something else and makes sense as an argument (so we dont
need to save and restore fsm->ix when doing something different)
- Normally this is just the current index, but when writing links
its something else and makes sense as an argument (so we dont
need to save and restore fsm->ix when doing something different)
- Normally this is just the current index, but when writing links
its something else and makes sense as an argument (so we dont
need to save and restore fsm->ix when doing something different)
- Return the hard link set from saveHardLink() when ready into a local
variable in the only place that cares: rpmPackageFilesInstall().
Another pointless and hard-to-follow fsm-global state variable
gone...
- saveHardLinks() is the only place where fsm->li value matters on
return: during installation its used for "returning" the current
link set when all the links in that set have been seen so they
are ready for creating.
- fsmMakeLinks() operates on the current link at hand, doesn't walk
the links or anything... pass the link as an argument from the sole
caller and operate on that.
- Using a "global" variable for local... more of the same:
fsmCommitLinks() gets called at the end of each round of the install
loop if there are links, it does the actual link discovery on its
own and fsm->li state will get rewritten by saveHardLink() at the
start of the next round.
- Legitimately skipped files (links) must not cause install-errors.
This has always been broken, but the errors were completely ignored
on install prior to rpm 4.10, and now that we're only creating the
first instance of a shared file, secondary arch multilib packages
with hardlinks were causing install failures because of the "missing"
hardlinks here.
- The relevant part here is obviously the XFA_SKIPPING() test, for
which we need the file states. To keep the lines short, grab the
index to a helper variable and replace other fsm->li->filex[i] uses
with that too.
- Use string offsets for basename start and end to track the progress,
avoiding +1/-1 adjustments in every damn calculation.
- Reduce the places where new basename is calculated to just one
at the start of the main loop, just adjust the basename start
and end accordingly beforehand.
- This shouldn't change any functionality, just simplify the code
a little bit.
- fpLookupSubdir() has been broken for a long, long time, probably
because some subtle extra/missing slash issue. It got totally
wrecked by the pool changes though: there are heading and trailing
slashes everywhere and the calculations were off-by-one to every
possible direction because of that. And the previous attempts
(eg commit 566a332c69) makes
even a bigger mess of it.
- This is far messier than it needs to be, but for now going for
minimal resurrection rather than rewrite it all at once. It's also
not quite right either, but it does now actually detect at the conflicts
it was always supposed to.
- This gives quite a speedup for dependency checking as within
transaction, all the dependency sets come from the same pool
and making this just an integer comparison.
- Take advantage of the length-aware pool string->id lookup to avoid
the need to copy and locally modify the canonized dirname. Makes
the code cleaner and a little bit faster too.
- There are further possibilities in this direction, canonDir()
could return an id instead of malloced memory but that doesn't
remove the need for temporary bugg^H^Hffer to clean up the dir.
- Suddenly it all seems so much clearer...
- Also try to better handle the theoretical realpath() errors: on
failure the buffer contents are undefined and we shouldn't look
at them, free the buf and return NULL.
- Fixes regression (yum updates barf with conflicts) from commit
3b492620fb which doesn't affect rpm
itself but breaks some API users like yum that first run a
test-transaction and if that succeeds, the same transaction is run
for real. In that case we need to redo the whole fingerprint dance
from scratch: throw away any former results and redo.
- Blaming Fedora 18 alpha preparations for not noticing this earlier:
there have been no updates to F16/F17 in almost a week, effectively
disabling a part of the regular rpm development QA :P
- Similar to commit ad99f4e84a but at the
other end of the name: not all subdirs will exist in the pool already
but none of them exists without the heading slash. Saves another handful
of megs on larger transactions.
- In the old days, stripping trailing slashes made sense as its useless
as it is and stripping it saved a bit of memory, but now with the
directories in the pool things are different: while not all paths
we'll see here necessarily exist in the pool already, NONE of them
exists without the trailing slash, so stripping it out wastes gobs
of memory. Simplifies the code a bit and saves several megs of memory
on larger transactions, what's not to like?
- Refer to dirName when we haven't yet cleaned it up to clarify uses,
only initialize the const cleaned dir name pointer after we've
successfully cleaned it up. Rename cleanDirName to cdn to keep it
sweet and short, and suggest the relation to cdnl and cdnbuf.
- Use dynamically allocated cdnbuf in the non-absolute path case (when
exactly that occurs is another question) too instead of the on-stack
dir[], making the two paths a bit more similar.