summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2012-10-05Use rpmal lookups for already added obsoletions tooPanu Matilainen1-19/+9
- Related to commit bee348b5d101a0ea6039b56c39e8ddc1cfc09a1a, 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.
2012-10-05Add a hash + lookup function on obsoletes to rpmalPanu Matilainen2-0/+100
- 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-05Guard against NULL ds in the rpmds indexed gettersPanu Matilainen1-6/+6
- NULL dependency sets are all over the place as NULL ds means "no dependencies of this kind", whereas for eg rpmfi NULL is an error.
2012-10-05Export the indexed rpmds accessors internallyPanu Matilainen3-9/+46
- 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.
2012-10-05Add indexed access variants for rpmdsColor() and rpmdsCompare()Panu Matilainen1-13/+20
- 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.
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-02Use rpmal lookups for finding redundancies in the added setPanu Matilainen1-60/+110
- 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.
2012-10-02Dont bother with rpmRelocateFileList() if relocations have been specifiedPanu Matilainen1-1/+1
- 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.
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 Matilainen2-1/+10
- For some uses, we need to be more selective about providers...
2012-10-02Pass the newly create ts element instead of header to findPos()Panu Matilainen1-15/+14
- 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.
2012-10-01Eliminate all the now unnecessary fsm->ix save-and-restoresPanu Matilainen1-14/+0
- 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.
2012-10-01Pass file index as argument to fsm fsmMapPath()Panu Matilainen1-10/+9
- 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)
2012-10-01Pass file index as argument to fsm fsmCommit()Panu Matilainen1-6/+6
- 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)
2012-10-01Pass file index as argument to fsm writeFile()Panu Matilainen1-5/+6
- 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)
2012-10-01Eliminate current hardlink set from fsm structPanu Matilainen1-8/+11
- 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...
2012-10-01Pinpoint the one place where fsm->li is modified on real purposePanu Matilainen1-26/+27
- 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.
2012-10-01Avoid using fsm->li directly when creating pending hard linksPanu Matilainen1-8/+9
- 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.
2012-10-01Avoid using/modifying fsm->li when committing hardlinksPanu Matilainen1-6/+7
- 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.
2012-10-01Avoid using/modifying fsm->li when writing links to payloadPanu Matilainen1-13/+14
- Using a "global" variable for local iteration is just... this gets called once at the end of package build, fsm->li carries no global state here.
2012-10-01Avoid using/modifying fsm->li when freeing hard link setsPanu Matilainen1-4/+6
- Using a "global" variable for local iteration is...
2012-10-01Avoid using/modifying fsm->li on hard link checkingPanu Matilainen1-4/+4
- Using a "global" variable for local iteration is just dumb...
2012-10-01Move hardlink saving out of fsmInit()Panu Matilainen1-5/+6
- Now that we have separate functions for install, erase and build, handle the hardlink saving locally where it matters.
2012-10-01Free hardlink sets centrally in fsmFree()Panu Matilainen1-11/+3
- Having three places doing the same thing doesn't make a whole lotta sense...
2012-10-01Filter out skipped files on hardlink checkingPanu Matilainen1-2/+4
- 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.
2012-09-28Simplify fpLookupSubdir() a bitPanu Matilainen1-33/+22
- 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.
2012-09-27Minimally resurrect fpLookupSubdir() functionalityPanu Matilainen1-27/+21
- 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 566a332c6907a0969ea8f79a4c7a62bca2d1f1b4) 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.
2012-09-27Fixup a copy-paste error in rpmdsPool() doxygen markupPanu Matilainen1-1/+1
2012-09-27Remove leftover, no longer valid commentPanu Matilainen1-1/+0
2012-09-24Switch back to early added packages rpmal populatingPanu Matilainen2-19/+1
- Basically reverts commit d10a9941326f7d397428c8ab0b4ba571cfc6c184 which was just a temporary transition-period thing. Moving pointers dont bother us anymore...
2012-09-21Take advantage of rpmstrPoolStreq() in rpmdsCompare()Panu Matilainen1-1/+1
- 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.
2012-09-19Eliminate strdup() in doLookupId()Panu Matilainen1-20/+14
- 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.
2012-09-19Lift directory name canonicalization into a helper functionPanu Matilainen1-17/+23
- 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.
2012-09-18Unbreak fingerprinting when called twice for the same transaction setPanu Matilainen1-1/+4
- Fixes regression (yum updates barf with conflicts) from commit 3b492620fb35a21d05b975e31130dc071f6fd8e2 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
2012-09-18Oops, refactoring error in commit 327701572ff912413ec9564d29d946b4ab21a9f3Panu Matilainen1-1/+1
- sizeof() doesn't work very well for malloced arrays... not that it matters a whole lot, this isn't a path that will ever be executed afaict.
2012-09-18Ensure fingerprint subdirs have heading slashesPanu Matilainen1-6/+2
- Similar to commit ad99f4e84a5fea05edca59257b6e00d91d6c8a08 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.
2012-09-18Ensure directories have trailing slashes in doLookupId()Panu Matilainen1-15/+6
- 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?
2012-09-18Further doLookupId() cleanupPanu Matilainen1-9/+9
- 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.
2012-09-18Elimiate one of the umphteen directory variables in doLookupId()Panu Matilainen1-9/+11
- 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.
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-17Permit key imports even if signature checking is disabled (RhBug:856225)Panu Matilainen1-1/+7
- Since commit 290fcbbe6b3ca2fb1d5e4a7269a32a94f8a1563a, key imports on transaction sets where signature checking is disabled would fail due to keyring not getting loaded at all. A regression of sorts, in other words. As a minimal fix, temporarily enable sigcheck vsflags during keyring loading.
2012-09-15Be more selective about legacy retrofits on package readPanu Matilainen1-4/+7
- Missing RPMTAG_DIRNAME can mean either a package with uncompressed filenames OR a new package with no files, in which case the retrofits should not be performed. Also a newer package can be built with --nodirtokens, requiring filelist compression but no other retrofits. - Test for immutable region presence for more accurate v3 package detection, if not present do a full retrofit. For others, explicitly test for OLDFILENAMES presence and only compress the filelist if needed.e
2012-09-14Switch rpmdb basename finding to use pool id's instead of stringsPanu Matilainen1-8/+19
- Ids are both faster to hash/compare and cheaper to store than string pointers. Not a huge win but a win anyway...
2012-09-14Cleanup + optimize doLookupId() a bitPanu Matilainen1-7/+3
- Eliminate redundant second strlen() on dirName on entry, and avoid the first one as well by grabbing the length from pool instead. - Reorganize the initializations and declarations a bit for clarity.