Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315425 - Symlinks conflicting with existing dirs silently ignored
Summary: Symlinks conflicting with existing dirs silently ignored
Status: RESOLVED DUPLICATE of bug 326685
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-15 08:53 UTC by Martin von Gagern
Modified: 2012-04-23 21:21 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2010-04-15 08:53:16 UTC
When a package to be merged contains a regular file or symlink, and the target file system contains a directory in the same place, then the file or symlink cannot be merged. For files, this produces a lot of noise, starting with 

For regular files, this scenario will cause the file to be merged with a .backup.#### suffix appended to its name. A corresponding error message is printed. For symlinks, no error message is printed. This lack of any error indication makes bugs like #311923 harder to investigate.

I would whish to see at least an error message. As section 13.4 from pms 3 forbids ebuilds to attempt merging symlinks on top of dirs, any such attempt should be considered an error warranting at least inspection by the sys admin.

For my sys-apps/portage-2.2_rc67, the code relevant to this behaviour seems to be in file vartree.py, method dblink.mergeme. Thanks to ferringdb for pointing me in the correct direction. That method has code like this:

  if stat.S_ISLNK(mymode):
    ...
    if mydmode!=None:
      #destination exists
      if not stat.S_ISLNK(mydmode):
        if stat.S_ISDIR(mydmode):
          # directory in the way: we can't merge a symlink over a directory
          # we won't merge this, continue with next file...
          continue
    ...
  elif stat.S_ISDIR(mymode):
  ...
  else:
    ...
    if mydmode != None:
      # destination file exists
      if stat.S_ISDIR(mydmode):
        # install of destination is blocked by an
        # existing directory with the same name
        newdest = self._new_backup_path(mydest)
        msg = []
        msg.append("")
        msg.append("Installation of a regular file is blocked by a directory:")
        msg.append("  '%s'" % mydest)
        msg.append("This file will be merged with a different name:")
        msg.append("  '%s'" % newdest)
        msg.append("")
        self._eerror("preinst", msg)
        mydest = newdest

It seems that the core of this behaviour, i.e. silent symlinks and noisy regular files when a dir is in the way, have been in portage at least since its import into svn resp. git. As history hasn't been imported, I can't tell more.
Comment 1 Zac Medico gentoo-dev 2012-04-23 21:21:03 UTC

*** This bug has been marked as a duplicate of bug 326685 ***