db: always create directories during install

We dont care if a directory have references or not, we care if directory
is relly there.

Only the creator of the direcotry will set the permissions.

This fixes the situation where you install a package owning a dir then
you remove this dir manually and try install a second package also owning
the dir.

For example:

  apk add e2fsprogs-dev
  rm -rf /usr/lib/pkgconfig
  apk add zlib-dev
cute-signatures
Natanael Copa 2009-01-22 10:34:03 +00:00
parent dfc8d4ce4c
commit 75b339cae2
1 changed files with 1 additions and 3 deletions

View File

@ -253,10 +253,8 @@ static void apk_db_diri_set(struct apk_db_dir_instance *diri, mode_t mode,
static void apk_db_diri_mkdir(struct apk_db_dir_instance *diri)
{
if (diri->dir->refs == 1) {
mkdir(diri->dir->dirname, diri->mode);
if (mkdir(diri->dir->dirname, diri->mode) == 0)
chown(diri->dir->dirname, diri->uid, diri->gid);
}
}
static void apk_db_diri_rmdir(struct apk_db_dir_instance *diri)