Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Make sure to always read the format file whenever we are about to access
the info database, so that we can verify that we understand the format,
and bail out otherwise.
This fixes a currently possible info database corruption and bogus
access, whenever the format is lower than 0 or higher than the last
understood one, and makes the info database code future-proof in case
new actual formats get introduced.
|
|
These functions have never belonged in the filesdb module, but were put
there temporarily for convenience.
|
|
The upgrade is scheduled by explicit calls to pkg_infodb_upgrade() if
the current database format version is less than the latest supported
format or if the previous upgrade was interrupted.
The upgrade goes as follows:
- link all old files to their new names.
- set <admindir>/info/format-new to 1.
- remove all old files.
- rename <admindir>/info/format-new to <admindir>/info/format.
In case of abrupt interruption, the presence of <admindir>/info/format-new
means the upgrade is not yet completed and it needs to be retried. In case
of clean interruption with rollback, that file is removed after the old
layout has been restored.
Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org>
Patch-sponsored-by: Linaro Limited
Designed-by: Guillem Jover <guillem@debian.org>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The usage of the new layout is conditional to a prior database
upgrade that should write a version number greater than 0 in
<admindir>/info/format.
The file is parsed when needed from pkg_infodb_get_format().
Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org>
Patch-sponsored-by: Linaro Limited
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The code does not do anything yet with this new argument, but it will
allow it to access the multiarch information, once the on-disk layout
is changed.
|
|
Move the common code into a new function which will call an action
pointer function on matched files to perform the specific logic.
|
|
|