summaryrefslogtreecommitdiff
path: root/lib/rpmal.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-05Add a hash + lookup function on obsoletes to rpmalPanu Matilainen1-0/+91
- 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.
2012-10-05Rename rpmalProvidesHash to rpmalDepHashPanu Matilainen1-6/+6
- The same hash type is valid for any ds and we'll be adding more...
2012-10-05Avoid changing the file info sets when adding to rpmal file hashPanu Matilainen1-8/+8
- Use indexed access to the file info sets so we're not mucking around with somebody elses rpmfi iterator index (currently not an issue but still...)
2012-10-05Avoid changing the dependency sets when looking up from rpmalPanu Matilainen1-6/+4
- Use indexed access and comparison to avoid mucking around with eg transaction element dependency sets while the callers are walking over them.
2012-10-05Avoid changing the dependency sets when adding to rpmal hashPanu Matilainen1-7/+8
- 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...
2012-10-04Be as lazy as possible wrt rpmal hash creationPanu Matilainen1-19/+29
- 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.
2012-10-02Only return non-NULL from rpmalAllSatisfiesDepends() on real matchesPanu Matilainen1-1/+5
- 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.
2012-10-02Export rpmalAllSatisfiesDepend() internally (again)Panu Matilainen1-1/+1
- For some uses, we need to be more selective about providers...
2012-09-18Avoid redundant ds -> id -> string lookups in rpmalAllFileSatisfiesDepend()Panu Matilainen1-4/+2
- We need to grab the dependency string in rpmalAllSatisfiesDepend() already to see whether its a file dependency or not, just pass that to the file deps to avoid redundant work.
2012-09-18Dont bother with separate notifications on multiple file dep matchesPanu Matilainen1-3/+3
2012-09-18Avoid the string copy in rpmalAllFileSatisfiesDepend() now that we canPanu Matilainen1-5/+1
2012-09-12Switch rpmal file hash to use pool id's instead of stringsPanu Matilainen1-23/+15
2012-09-12Switch rpmal provide hash to use pool id's instead of stringsPanu Matilainen1-7/+19
2012-09-12Add a some transition-period asserts to ensure pool-usage sanityPanu Matilainen1-0/+19
2012-09-12Pass transaction pool to rpmal (but not used yet)Panu Matilainen1-1/+5
2012-09-05Shut up gcc whine about potentially uninitialized variablePanu Matilainen1-1/+1
- This is a false positive really, or at least a cant-happen case
2012-09-05Avoid rehashing directory name when it doesn't change in rpmal populationPanu Matilainen1-1/+10
- Another modest improvement in redundant rehashing elimination, but in the big picture, this is really just another fart in the Sahara desert...
2012-04-05Handle obsolete matches (more) correctly in rpmalPanu Matilainen1-1/+8
- Similar to commit 9fb81eac0bcd239e46459f72916099f1adfc5cb9 but on the to-be-installed set: obsoletes should only be matched against package names, not any provide or file names. Hasn't really mattered previously due to the way its called, but since commit 05487d9a3f763cfed5f5ca75b4fbadb62f38dfd6 I guess it started to matter. It's more correct this way anyhow, and should fix RhBug:810077. - Since rpmal only knows about provides, we need to handle obsoletes as a special case and filter out matches on provide names different than the matching package name.
2011-09-01Don't add config() provides if config install is disabledPanu Matilainen1-0/+5
- Similarly to commit 40ee8e7427ace319687dd36bd5f745d1ef2f2236, take --noconfigs into account for the virtual config() provides too
2011-09-01Don't add file provides for doc/config files if they wont be installedPanu Matilainen1-0/+8
- Files which dont get installed cannot very well satisfy dependencies, take this into account for docs and configs when --nodocs & --noconfigs flags are used.
2011-09-01Pass tsflags to rpmal and remember themPanu Matilainen1-1/+4
- No functional changes here, but we'll need to know some of these bits for accurately calculating various dependency bits later on.
2011-09-01Source formatting cosmetics: function blocks start on the next linePanu Matilainen1-4/+8
2011-03-10Move string hash function to librpmio and rename for namespacingPanu Matilainen1-2/+2
- There are places in rpmio and build that would benefit from hashing, but hashFunctionString() being internal to librpm has prevented that. Rename to rstrhash() to resemble the other foo in rpmstring.h for minimal namespacing as its now public function and update callers. - Also mark the function as "pure" - it only looks at its arguments. This is one of the busiest functions in entire rpm so any optimization no matter how minor is well worth it. - Hereby awarding hashFunctionString() with the grand prize for the Most Moved Around Function in rpm ;)
2010-09-22Eliminate separate fileIndexEntry from rpmalPanu Matilainen1-20/+5
- This is exactly the same structure as availableIndexEntry, no need for a different struct for it.
2010-06-22Add common Collection requirementsSteve Lawrence1-0/+26
This patch adds the install-time feature that if a package requires a package in a collection, then it also requires all other packages in that collection. This has the effect that collections will be roughly grouped together during a transaction. Although this is not absolutely necessary for the majority of collections, it is required for the SELinux collection. This is because all SELinux policies must be installed before the applications they secure to ensure correct labels. This means we must ensure packages in the selinux collection are ordered earlier in the transaction than all applications they protect. Adding this implicit runtime requirements achieves this in a general manner, without major modifications to dependency ordering. To accomplish this, this patch splits the addRelation function into two parts: one that determines which relations to add, and one that actually adds them. After the usual relation is added between two packages, it then determines if the required package contains any collections. If so, it finds all other packages that are in the same collections and creates additional relations.
2010-05-21Move the lone hashFunctionString() into misc.[ch], eliminate rpmhash.[ch]Panu Matilainen1-1/+1
- Besides there not being much point in having a separate source + header for a small single function, this fixes build on case-insensitive systems such as Mac OS X.
2010-03-29Dont bother translators with dependency lookup debug messagesPanu Matilainen1-2/+2
2010-03-22Lose the useless rpmds refcounting debug junk + switchesPanu Matilainen1-2/+1
- get the debug messages out of API, this is what should've been in commit dbdbe8010cd944f026a5a4e5d071eb31d29d81c4
2010-03-22Lose the useless rpmfi refcounting etc debug messages + debug switchesPanu Matilainen1-1/+1
- get the debug messages out of API, this is what should've been in commit dbdbe8010cd944f026a5a4e5d071eb31d29d81c4
2010-03-18Lose leftovers from former rpmal implementationPanu Matilainen1-7/+0
2010-03-18Lazy rpmal hash creation on first lookup, make rpmalMakeIndex() staticPanu Matilainen1-1/+4
- the "new" hash-based rpmal only uses rpmalMakeIndex() for initial creation of the hash tables as late as possible for better estimate of needed hash size, but doesn't require any index regeneration if something is added - first call to rpmalSatisfiedDepend() now initializes the hashes, if significant amount of entries are added after the first call hash table might get full ... so dont do that ;) (this was already true with rpmalMakeIndex(), now its just hidden out of sight)
2010-03-18Make rpmalAllFileSatisfiesDepend() and rpmalAllSatisfiesDepend() staticPanu Matilainen1-4/+2
- rpmtsCheck() only wants yes/no answers from rpmal, and ordering wants the best provider, rpmalSatisfiesDepend() works for both - update comments
2009-09-14Clean up rpmalAllFileSatisfiesDepend() a bitPanu Matilainen1-40/+34
- avoid multiple strrchr() calls - avoid _constfree(), the string size is known from strrchr() so we dont need to allocate on heap at all
2009-06-16Eliminate now unnecessary artifacts of rpmdsNext() side-effectsPanu Matilainen1-3/+2
2009-06-11Make rpmalSatisfiesDepend() smarterPanu Matilainen1-7/+24
- Instead of blindly picking the first match, try to pick the best provider for the dependency: for colored dependencies, try to find a provider of matching color. For non-colored dependencies, prefer providers of transaction preferred color. - This avoids creating bogus and loopy relations between 32- and 64-bit packages where they dont exist, and makes behavior with things like /sbin/ldconfig consistent by returning the preferred colored element.
2009-06-11Add preferred color to rpmalPanu Matilainen1-1/+3
2009-04-03Make rpmal header & all internalPanu Matilainen1-2/+3
- rpmal is hardly useful outside rpm itself, avoid exporting stuff unnecessarily
2009-03-26Fix: use the file's color to decide whether to add it to the rpmal not the ↵Florian Festi1-1/+1
color of the rpmfi
2009-03-26Reimplement rpmal by using hashes and cleaning up the color handlingFlorian Festi1-512/+154
2009-03-26Make rpmal store rpmtes and kill rpmte->pkgKeyFlorian Festi1-63/+43
2008-04-30Don't use alloca in rpmal.cJindrich Novy1-2/+4
2008-04-28Eliminate pointless alloca() of struct fileIndexEntry structPanu Matilainen1-6/+6
2008-04-28Eliminate pointless alloca() of availableIndexEntry struct.Panu Matilainen1-7/+7
2008-04-28Eliminate pointless alloca()'s of local dirInfo structPanu Matilainen1-25/+26
2008-02-05Add rpm_color_t type for rpm color bits, use where spottedPanu Matilainen1-8/+8
2008-02-05Rip the horrible (ia64) autorelocate kludgery. RIP.Panu Matilainen1-6/+0
- we don't support relocated x86 on ppc in qemu either...
2008-01-30rpmlib.h mass evictionPanu Matilainen1-1/+0
- explicitly include what's really needed instead - document remaining uses
2007-12-17Remove const from rpmal dirInfo dirnamePanu Matilainen1-2/+4
- add comments wrt needle dirName - those are actual const pointers to within rpmfi, must not free
2007-12-15And yet more bogus const removals...Panu Matilainen1-1/+1
2007-12-08Switch to <rpm/foo.h> style for public headersPanu Matilainen1-4/+4
- adjust include paths accordingly