On Mon, Sep 22, 2014 at 7:44 AM, Allan McRae <allan@archlinux.org> wrote:
This is v2 of a patchset submitted long ago. It has been rebased and had its memory leaks fixed.
With this patchset, pacman will create a local database directory if it is missing (but not the root of the database - i.e. /var/lib/pacman/ still needs to be present). When creating the database or finding an empty local database it will add the .alpm_db_version file and add the version. For existing pacman databases this file is created by the pacman-db-upgrade script. Finally the version of the local database is checked during db validation.
I'm fine with the idea, but on a more meta level, is there any reason this should be a hidden file? Why not just call it something like DB-VERSION so it is big and obvious? I find the idea of hidden files in non-user home directories less than ideal as it makes investigation that much harder until you remember to do a full `ls -la`. (For example: svn stores its version in the root of the repository in a `format` file, http://serverfault.com/questions/277441/difference-between-the-format-and-db... )
Allan McRae (4): Create local database directory if it is missing Add version file when creating local database directory Add version file to empty local database Check the version of the local database during validation
lib/libalpm/be_local.c | 119 +++++++++++++++++++++++++++++++++---------------- test/pacman/pmdb.py | 2 + test/pacman/pmtest.py | 3 ++ 3 files changed, 85 insertions(+), 39 deletions(-)
-- 2.1.0