diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-22 10:34:03 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-22 10:34:03 +0000 |
commit | 75b339cae217a14d51f674a25522e91aadf63a65 (patch) | |
tree | f47cdeb98553af3d8e12b1ac37af1ee308da53bc /src | |
parent | dfc8d4ce4c6e8fdc30491d52e2014bd33d961dee (diff) | |
download | apk-tools-75b339cae217a14d51f674a25522e91aadf63a65.tar.gz apk-tools-75b339cae217a14d51f674a25522e91aadf63a65.tar.bz2 apk-tools-75b339cae217a14d51f674a25522e91aadf63a65.tar.xz apk-tools-75b339cae217a14d51f674a25522e91aadf63a65.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/database.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c index acc3acb..7a6ac8a 100644 --- a/src/database.c +++ b/src/database.c @@ -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) |