summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-30 06:19:49 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-30 06:19:49 +0000
commit740f71301ed3daf44c0e77df5d5de39fe1438fb1 (patch)
tree4de89d0ac994da40108aa3d9098eb6cb182e9961
parenta02f455a6b8ed2772a63e39deed5b84378d9b555 (diff)
downloadportage-740f71301ed3daf44c0e77df5d5de39fe1438fb1.tar.gz
portage-740f71301ed3daf44c0e77df5d5de39fe1438fb1.tar.bz2
portage-740f71301ed3daf44c0e77df5d5de39fe1438fb1.zip
Bug #286895 - Generate an eerror message when a directory blocks merge
of a regular file and the file is merged using a 'config protect' filename even though the path may not be among those covered by CONFIG_PROTECT. svn path=/main/trunk/; revision=14468
-rw-r--r--pym/portage/dbapi/vartree.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 93fbfe397..1bf05f14e 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -4161,12 +4161,20 @@ class dblink(object):
protected = self.isprotected(mydest)
if mydmode != None:
# destination file exists
- cfgprot = 0
+
if stat.S_ISDIR(mydmode):
# install of destination is blocked by an existing directory with the same name
- cfgprot = 1
- showMessage("!!! %s\n" % mydest,
- level=logging.ERROR, noiselevel=-1)
+ newdest = new_protect_filename(mydest, newmd5=mymd5)
+ 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
+
elif stat.S_ISREG(mydmode) or (stat.S_ISLNK(mydmode) and os.path.exists(mydest) and stat.S_ISREG(os.stat(mydest)[stat.ST_MODE])):
# install of destination is blocked by an existing regular file,
# or by a symlink to an existing regular file;
@@ -4174,6 +4182,7 @@ class dblink(object):
# we only need to tweak mydest if cfg file management is in play.
if protected:
# we have a protection path; enable config file management.
+ cfgprot = 0
destmd5 = perform_md5(mydest, calc_prelink=1)
if mymd5 == destmd5:
#file already in place; simply update mtimes of destination
@@ -4198,8 +4207,9 @@ class dblink(object):
"""A previously remembered update has been
accepted, so it is removed from confmem."""
del cfgfiledict[myrealdest]
- if cfgprot:
- mydest = new_protect_filename(mydest, newmd5=mymd5)
+
+ if cfgprot:
+ mydest = new_protect_filename(mydest, newmd5=mymd5)
# whether config protection or not, we merge the new file the
# same way. Unless moveme=0 (blocking directory)