[pacman-dev] pacman and same empty dirs in both pkgs, problem?

Xavier shiningxc at gmail.com
Fri Jul 24 16:52:24 EDT 2009


On Fri, Jul 24, 2009 at 10:38 PM, Gerardo Exequiel
Pozzi<vmlinuz386 at 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.


More information about the pacman-dev mailing list