On Aug 18, 2008, at 8:26 AM, Ralf S. Engelschall wrote:
> Notice the "--db-rebuild" instead of "--rebuildb" here and the fact
> that with "--rebuilddb" I usually loose the "openpkg" entry while with
> "--db-rebuild" I do not.
> To explain: "--db-xxxx" are RPM aliases to OpenPKG's "rpmdb" addon
> script and its "--db-rebuild" actually does a full "dump" and
> with the Berkeley-DB tool (for details see the attached script) while
> "--rebuildb" is RPM-internal.
> Very interesting that the full dump/restore via external tools is
> able to resurrect the database without information loss while RPM's
> --rebuilddb seems to kick away data. Hmm...
OK, your scriptie now vetted.
I'd suggest adding a db_stat() function to identify stale locks.
/usr/lib/rpm/rpmdb_stat -Cl -h /var/lib/rpm
(aside) you might want to track other info, like no. of hash buckets,
likely a (modest) speedup in --rebuilddb if dynamic resizing is avoided
by initializing no. of hash buckets explicitly with DB_HASH. I
because --rebuilddb has almost nothing to do with "package management".
Also a db_verify() method to detect inconsistencies in Berkeley DB
would be useful. The header blobs in Packages are already sanity/
checked as you have seen. Your scriptie basically bulldozes all
existing state and
recreates, it would likely be useful to know if there was actually
any need to recreate
Note that --rebuilddb recreates all the indices, so there's little
perform db_dump ... | db_load ... on anything but Packages if --
is going to be run. There can/will be changes to the index "tables"
on macro configuration as well that perhaps could be handled, but
table is certainly gud enuf.
So --db-rebuilddb "works" but --rebuilddb doesn't because the
removes (possibly damaged) cache afaict.
73 de Jeff
Received on Mon Aug 18 16:43:32 2008