[pacman-dev] pacman and same empty dirs in both pkgs, problem?
Hi devs, This mail is trigger by this problem [#1]. 1) PKG1 installs some directory without any files like "/some/common/dir" 2) PKG2 installs the same directory "/some/common/dir" with or without any files inside 3) Removing PKG2 also remove "/some/common/dir" that is installed by PKG1 This behaviour is expected? pacman only track files not directories true? Also tested with the latest pacman.git (at commit 30c4d53ce) packages like openssh that install an empty dir "/var/empty/" should also install a hidden file like "/var/empty/.keep.this.for.openssh" ? [#1] http://bugs.archlinux.org/task/15668 (openntpd 3.9p1-7 uninstall removes /var/empty) -- Gerardo Exequiel Pozzi ( djgera ) http://www.djgera.com.ar KeyID: 0x1B8C330D Key fingerprint = 0CAA D5D4 CD85 4434 A219 76ED 39AB 221B 1B8C 330D
On Fri, Jul 24, 2009 at 10:38 PM, Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
Hi devs,
This mail is trigger by this problem [#1].
1) PKG1 installs some directory without any files like "/some/common/dir" 2) PKG2 installs the same directory "/some/common/dir" with or without any files inside 3) Removing PKG2 also remove "/some/common/dir" that is installed by PKG1
This behaviour is expected? pacman only track files not directories true? Also tested with the latest pacman.git (at commit 30c4d53ce)
packages like openssh that install an empty dir "/var/empty/" should also install a hidden file like "/var/empty/.keep.this.for.openssh" ?
[#1] http://bugs.archlinux.org/task/15668 (openntpd 3.9p1-7 uninstall removes /var/empty)
pacman just does not take into account this case (package installing empty directories) when removing directories. It only does this : if(S_ISDIR(buf.st_mode)) { if(rmdir(file)) { /* this is okay, other packages are probably using it (like /usr) */ _alpm_log(PM_LOG_DEBUG, "keeping directory %s\n", file); } else { _alpm_log(PM_LOG_DEBUG, "removing directory %s\n", file); } Maybe instead of trying to remove the directory, it should check all existing packages to see if there is one owning this directory. But this will slow down the -R operation, for each directory inside a package. And do we already have a bug report for this issue? I think it has been mentioned before.
Xavier wrote:
On Fri, Jul 24, 2009 at 10:38 PM, Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
Hi devs,
This mail is trigger by this problem [#1].
1) PKG1 installs some directory without any files like "/some/common/dir" 2) PKG2 installs the same directory "/some/common/dir" with or without any files inside 3) Removing PKG2 also remove "/some/common/dir" that is installed by PKG1
This behaviour is expected? pacman only track files not directories true? Also tested with the latest pacman.git (at commit 30c4d53ce)
packages like openssh that install an empty dir "/var/empty/" should also install a hidden file like "/var/empty/.keep.this.for.openssh" ?
[#1] http://bugs.archlinux.org/task/15668 (openntpd 3.9p1-7 uninstall removes /var/empty)
pacman just does not take into account this case (package installing empty directories) when removing directories. It only does this : if(S_ISDIR(buf.st_mode)) { if(rmdir(file)) { /* this is okay, other packages are probably using it (like /usr) */ _alpm_log(PM_LOG_DEBUG, "keeping directory %s\n", file); } else { _alpm_log(PM_LOG_DEBUG, "removing directory %s\n", file); }
Maybe instead of trying to remove the directory, it should check all existing packages to see if there is one owning this directory. But this will slow down the -R operation, for each directory inside a package.
And do we already have a bug report for this issue? I think it has been mentioned before.
OK maybe you talking about this [#1]? Then, in the case that pacman is "Won't fix/Not a Bug" issue. Then (in this case) openssh should install a hidden file in /var/empty that is a common directory for some packages. Or... ? Thanks, [#1] http://bugs.archlinux.org/task/11263 (Removing qt3 removes /opt) -- Gerardo Exequiel Pozzi ( djgera ) http://www.djgera.com.ar KeyID: 0x1B8C330D Key fingerprint = 0CAA D5D4 CD85 4434 A219 76ED 39AB 221B 1B8C 330D
On Fri, Jul 24, 2009 at 11:05 PM, Gerardo Exequiel Pozzi<vmlinuz386@yahoo.com.ar> wrote:
OK maybe you talking about this [#1]? Then, in the case that pacman is "Won't fix/Not a Bug" issue. Then (in this case) openssh should install a hidden file in /var/empty that is a common directory for some packages. Or... ?
Thanks,
[#1] http://bugs.archlinux.org/task/11263 (Removing qt3 removes /opt)
Indeed, that's the one, thanks! It was even me who closed it :D But maybe it should be re-opened. I don't know why I didn't think about the fix I just suggested. Maybe I didn't fully understand that filesystem indeed owned an empty /opt/ directory. It should be very easy to implement, as I suggested in my previous mail. The only problem is to measure the perfomance drawbacks it causes.
Maybe instead of trying to remove the directory, it should check all existing packages to see if there is one owning this directory. But this will slow down the -R operation, for each directory inside a package.
-1. This would induce a memory usage boost for fixing a minor issue. Pacman would load _all_ local filelists (the "big" part of local database, in addition, loading is slow with empty disk-cache) in even many simple "-S one_package" operations. I have seen dont.remove.this.file many times so far (for example, in "empty" dirs of some archives), that is much easier in this case, too. Bye ------------------------------------------------------ SZTE Egyetemi Konyvtar - http://www.bibl.u-szeged.hu This message was sent using IMP: http://horde.org/imp/
On Sat, Jul 25, 2009 at 4:30 PM, Nagy Gabor<ngaba@bibl.u-szeged.hu> wrote:
Maybe instead of trying to remove the directory, it should check all existing packages to see if there is one owning this directory. But this will slow down the -R operation, for each directory inside a package.
-1. This would induce a memory usage boost for fixing a minor issue. Pacman would load _all_ local filelists (the "big" part of local database, in addition, loading is slow with empty disk-cache) in even many simple "-S one_package" operations. I have seen dont.remove.this.file many times so far (for example, in "empty" dirs of some archives), that is much easier in this case, too.
One catch here is the original bug dealt with /var/empty. Judging by the name of that directory, putting anything at all in it would defeat the point of it, even if it is a bogus/hidden file. The best thing to encourage here is correct packaging, and use of the !emptydirs option in the PKGBUILD to ensure removing your package doesn't remove some system directory that probably didn't need to be in your package in the first place. -Dan
Dan McGee wrote:
On Sat, Jul 25, 2009 at 4:30 PM, Nagy Gabor<ngaba@bibl.u-szeged.hu> wrote:
Maybe instead of trying to remove the directory, it should check all existing packages to see if there is one owning this directory. But this will slow down the -R operation, for each directory inside a package.
-1. This would induce a memory usage boost for fixing a minor issue. Pacman would load _all_ local filelists (the "big" part of local database, in addition, loading is slow with empty disk-cache) in even many simple "-S one_package" operations. I have seen dont.remove.this.file many times so far (for example, in "empty" dirs of some archives), that is much easier in this case, too.
One catch here is the original bug dealt with /var/empty. Judging by the name of that directory, putting anything at all in it would defeat the point of it, even if it is a bogus/hidden file.
Yes, anyway, /var/empty is not defined by FHS. And the manual of sshd says: /var/empty chroot(2) directory used by sshd during privilege separation in the pre-authentication phase. The directory should not contain any files and must be owned by root and not group or world-writable. So I think that this is a problem with other programs that uses /var/empty and doing the workaround putting a hidden file (there are only two packages in all repos that use this dir core/openssh and community/openntpd)
The best thing to encourage here is correct packaging, and use of the !emptydirs option in the PKGBUILD to ensure removing your package doesn't remove some system directory that probably didn't need to be in your package in the first place.
ok -- Gerardo Exequiel Pozzi ( djgera ) http://www.djgera.com.ar KeyID: 0x1B8C330D Key fingerprint = 0CAA D5D4 CD85 4434 A219 76ED 39AB 221B 1B8C 330D
participants (4)
-
Dan McGee
-
Gerardo Exequiel Pozzi
-
Nagy Gabor
-
Xavier