summaryrefslogtreecommitdiff
path: root/lib/order.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-16Upgrade version to 4.14tizen/4.14.1.1.tizen20230628wangbiao1-57/+96
Change-Id: I21bf1a3a7c25cbec43022202cf2e5865b603a309 Signed-off-by: wangbiao <biao716.wang@samsung.com>
2012-09-24Switch back to early added packages rpmal populatingPanu Matilainen1-4/+0
- Basically reverts commit d10a9941326f7d397428c8ab0b4ba571cfc6c184 which was just a temporary transition-period thing. Moving pointers dont bother us anymore...
2012-09-12Delay transaction added packages rpmal creation until requiredPanu Matilainen1-0/+4
- We're not using the added rpmal for anything before rpmtsCheck() and/or rpmtsOrder(), so this shouldn't break anything either. This is probably a more or less temporary setup to make string pointer -> pool id transition a bit easier.
2012-09-12Add an nternal rpmal create+populate helper function, use for erased packagesPanu Matilainen1-7/+2
- We'll need this shortly for added packages too...
2011-09-01Pass tsflags to rpmal and remember themPanu Matilainen1-1/+2
- 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-1/+2
2011-06-01Lift Dijkstra algorithm out of collectSCC() to separate functionPanu Matilainen1-21/+24
- This splits outs nicely, moving queue allocation into separate scope and making collectSCC() less of an heavy-weight. No functional changes.
2011-06-01Eliminate struct copy in collectSCC(), use a pointer insteadPanu Matilainen1-8/+8
- collectSCC() doesn't actually modify the SCC struct it looks at so operating on a copy is harmless, but using a (const) pointer to the original makes the idea more clear (we're not modifying the scc struct here, only its members)
2011-05-31Remove reamining dead assignments from rpmtsiFree() in transaction codePanu Matilainen1-2/+2
- Not all of these are at the end of local scope and in many cases the iterator pointer is reused, but the logic in all these is straightforward enough (no jumps etc) that there's no much chance of mistakenly using already freed iterator.
2011-05-29Eliminate dead NULL-assignments at scope-end in librpm, part VPanu Matilainen1-2/+2
- Remove NULL-assignments of local variables at the end of scope in transaction and database code
2011-03-08Improve the dependency loop debug message a bitPanu Matilainen1-2/+3
- Fix one-off in the SCC numbering - Fix wording to talk about number of external dependencies, not packages - Show number of members in the SCC
2011-03-08Preferred color pkgs should be erased lastPanu Matilainen1-3/+10
- On install we need to queue preferred colored pkgs before others to account for the way colored files get laid on disk. On erase, we need to revert this for the same reason. Most of the time dependencies take care of this, but the queue placement matters in cases such as RhBug:680261 where the order is not dependency-driven.
2011-01-25Teach rpm about post-transaction dependenciesPanu Matilainen1-1/+1
- %posttrans dependencies have their own peculiar semantics, they're install-only dependencies which have no implications on ordering.
2010-12-15Eliminate ancient dependency loop whiteout mechanismPanu Matilainen1-87/+1
- Nobody has been relying on this for ages, and with the new ordering code since rpm 4.8.x loops are handled much more gracefully than before. RIP.
2010-12-13Implement transaction ordering hintingPanu Matilainen1-0/+6
- Add support for new "OrderWithRequires: foo" spec syntax which has "if and only if foo is present in transaction, order the transaction as if this package required foo" semantics. While it looks, and in some ways is, a soft dependency, this is not the same as recommends/suggests etc: those have unknown depsolver policy dependent semantics attached to them, whereas ordering hints have a clear definition and is only relevant for rpm itself, depsolvers should not even look at the data. - This allows packages to express correct ordering for optional functionality, such as %post if [ -x %{_bindir}/register-component ]; then %{_bindir}/register-component %{name} fi If the package containing %{_bindir}/register-component is included in the same transaction, it makes sense to have it installed before the package(s) that use it. But as it is fully optional, Requires would not be appropriate. Using OrderWithRequires allows this to be expressed without dragging in extraneous dependencies for optional functionality.
2010-10-25Create less draconian loops for grouped collectionsPanu Matilainen1-5/+28
- Instead of creating a completely unresolvable tangle of pre-requisites between all collection members and their requirements, just add a single relation loop of all the packages in a (grouped) collection, effectively turning it into a strongly connected component. The loop-cutting algorithm has slightly better chances of surviving this while still enforcing the collection members to be installed in one lump. Also only process each collection just once.
2010-10-25Only specific cases of collections need extra orderingPanu Matilainen1-7/+11
- Add a crude flags system to allow selectively enabling the extra grouping during ordering: currently only sepolicy collection needs this, and its very harmful when applied to more regular collections as it creates truly gigantic dependency loops that rpm has no chance of sorting out sanely.
2010-09-17Expel Tarjan from his nestPanu Matilainen1-81/+88
- Nested functions are a gcc-extension and very non-portable. Refactor to eliminate the nesting by passing the "global" variables via a struct from detectSCCs().
2010-06-22Add common Collection requirementsSteve Lawrence1-30/+57
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-03-29Teach rpm about pre-transaction dependenciesPanu Matilainen1-2/+2
- A pre-transaction dependency is generally anything that must be available at the start of the transaction, and cannot be resolved by packages *in* the transaction. This lets %pretrans scriptlet dependencies be expressed correctly, and could be also used for other kinds of pre-conditions. - rpmlib() dependencies are a special case of pre-trans dependencies but leaving them handled separately as they cannot be provided by anything in rpmdb either, whereas pretrans dependencies can.
2010-03-18Lazy rpmal hash creation on first lookup, make rpmalMakeIndex() staticPanu Matilainen1-7/+0
- 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-12Split transaction member information out of rpmts to separate structPanu Matilainen1-10/+11
- add internal rpmtsMembers() function to get the member structures - the main rpmts struct is now opaque within order.c, and much closer to being so for depends.c and transaction.c too - no functional changes
2009-12-21Work on tsortinfo instead of ts elements when ordering everywherePanu Matilainen1-59/+51
- ...except addRelation() which still needs rpmteTSI() for grabbing tsort info from elements in rpmal
2009-12-21Work on tsortInfo nodes directly when detecting SCC'sPanu Matilainen1-52/+38
- pass the local order info struct to detectSCC() and work on that instead of ping-ponging to the TSI's through transaction elements
2009-12-21Record relations to tsortInfos instead of transaction elementsPanu Matilainen1-17/+16
2009-12-21Save pointer to ts element in the tsort info structPanu Matilainen1-0/+2
2009-12-21Avoid a bunch of redundant rpmteTSI() callsPanu Matilainen1-8/+10
2009-12-21Eliminate unnecessary depth member from tsortinfoPanu Matilainen1-22/+9
- its only used for debug log formatting and we can calculate it from the number of parents in the debug case
2009-12-21Eliminate unnecessary npreds member from tsort infoPanu Matilainen1-5/+1
- this is the same as tsi_count
2009-12-21Eliminate unused tree index and degree from ordering calculationsPanu Matilainen1-22/+3
2009-12-21Avoid a few unnecessary rpmteTSI() calls in addRelation()Panu Matilainen1-6/+6
2009-12-21Remove unused ordering related members from rpmts structPanu Matilainen1-3/+0
2009-12-21Bury ordering structures and their alloc+free inside order.cPanu Matilainen1-8/+51
- nothing outside order.c needs this stuff, TSI alloc+free routines have no business being exported - for now we need to store a pointer to tsortInfo in the elements, its just an opaque pointer for ping-ponging the data through ts elements - all allocation + freeing is local to ordering code
2009-12-21Convert rpmtsOrder() to manipulate the tsort data from tsortInfo directlyPanu Matilainen1-6/+7
2009-12-21Convert addRelation() to manipulate the tsort data from tsortInfo directlyPanu Matilainen1-4/+4
2009-12-21Convert collectTE() to manipulate the tsort data from tsortInfo directlyPanu Matilainen1-10/+10
2009-12-21Avoid some unnecessary rpmteTSI() calls in collectTE()Panu Matilainen1-8/+8
- we have q's TSI in local variable already, use it - also rename tsi -> q_tsi so it's obvious which one we're manipulating
2009-09-07Eliminate unused variable and pointless null-checkPanu Matilainen1-4/+0
2009-08-31Replace equal/not equal uses of str[n]cmp() with rstreq[n] in main ts codePanu Matilainen1-1/+1
2009-08-17Eliminate unused code (leftover from ordering rewrite)Panu Matilainen1-18/+0
2009-06-11Add preferred color to rpmalPanu Matilainen1-1/+1
2009-06-10Split ordering code to separate source filePanu Matilainen1-0/+708