- There's no meaningful way to return a write-error here,
rpmdbNextIterator() caller wouldn't know whether NULL at termination
is early due to error or not. So just ignore the return from
miFreeHeader(), it can only fail on rewrite mode (ie markReplacedFiles())
so impact is rather limited anyway.
- Since we're not checking the return then dont bother storing it either.
The sync is fairly unlikely to fail if other operations succeed
as sync failures generally revolve around invalid file descriptors etc.
- Callers are currently required to pass all sorts of unnecessary
gunk to the cursor operations just for performance statistics
etc, and the interface doesn't match the uses inside rpmdb.c
very well. This adds a more "rpm-style" interface around the
BDB API.
- Cursor open + close can only fail on invalid arguments (which would
be programmer errors), and various conditions on replication which
we dont care about. So we essentially ignore the errors, except
for cursor open which will return NULL to indicate an error.
- As an intermediate step, these are just wrappers to the older
dbiFoo interfaces to permit converting things to the new interfaces
piece by piece.
- Previously these functions would silently fall back to non-cursor
access when (accidentally) called with NULL cursor. This can lead
to different results for cases where cursor is actually required,
without any indication of it being an error. Make them fail
with EINVAL for NULL cursors so it gets trapped in rpmdb.c uses.
- We can't do anything about miFreeHeader() or dbiClose() errors
here, no point storing them to temp variable either. Error on
miFreeHeader() will at least log something on header rewrite-failure.
- use _default_source_url macro to specify default URL when it is
missing from the spec Source/Patch line
- this feature can be disabled by defining _disable_source_fetch to 1
- rpmsqFork() behaves like regular fork() in this regard so this
just makes the code more obvious and eliminates an set-but-unused
warning while at it.
- If the write fails scripts are likely to fail anyway, but executing
partial scriptlets (unlikely as that might be) could have funny
side-effects besides just failing.
- Also cleans up runExtScript() a little bit by moving the
tmp file creation to a separate function.
- Move the fsm execution to separate helper function, returning
the most relevant exit code: if fsmSetup() failed then teardown
return doesn't matter, but fsmTeardown() can report errors
from missing hardlinks which we haven't checked until now.
- This also fixes enum vs int abuse on the exit code: fsm return
codes are cpio error codes whereas psm codes are simple ok/fails.
- dlsym() can return NULL without it being an error, and since we
use dlerror() for determining the error anyway, supportedHooks
is simply unneeded here.
- Nobody is going to care really but since we bother remembering
them we might as well restore them too, silencing another two
set-but-unused warnings (this time semi-meaningful even)
- There's no meaningful way to return error from rpmdbExtendIterator()
in rpmFindBaseNamesInDB() so dont bother collecting the result.
At least there'll be rpmlog spew on errors so it wouldn't be
silently failing.
- rpmfcClassify() or rpmfcApply() failing is pretty fatal to rpmdeps,
exit with error code
- OTOH argvAdd() and argvSort() can't really fail, ignore their return
codes, shutting up another set-but-not-used whine
- The single caller doesn't actually care about its exit code
as its not particularly important in that case but .. shrug,
at least it silences a warning.
- Its callers only care about success vs failure, so only ever return
0 or -1 and take waitpid() errors into account too. As a side effect
shuts up a set-but-unused compiler warning too
- Call rpmdbClose() instead of rpmdbUnlink() on iterator free to
actually close the db when refcount goes to zero. This
fixes the situation where a caller closes a database handle
while iterators are active: the iterators stay usable and close
the db when the last one exits.
- Signals are per-process global, as long as there are other
databases open (or references to the same db) we shouldn't mess
with them. Less important on open, but if somebody is changing
rpmsq-handling we shouldn't override that either.
- Elements referencing ts prevents rpmtsFree() from freeing anything
unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage
from commit 8f7c2d7063.