Lines 30-35
portage.proxy.lazyimport.lazyimport(globals(),
Link Here
|
30 |
'portage.util:apply_secpass_permissions,ConfigProtect,ensure_dirs,' + \ |
30 |
'portage.util:apply_secpass_permissions,ConfigProtect,ensure_dirs,' + \ |
31 |
'writemsg,writemsg_level,write_atomic,atomic_ofstream,writedict,' + \ |
31 |
'writemsg,writemsg_level,write_atomic,atomic_ofstream,writedict,' + \ |
32 |
'grabdict,normalize_path,new_protect_filename', |
32 |
'grabdict,normalize_path,new_protect_filename', |
|
|
33 |
'portage.util.compare_files:compare_files', |
33 |
'portage.util.digraph:digraph', |
34 |
'portage.util.digraph:digraph', |
34 |
'portage.util.env_update:env_update', |
35 |
'portage.util.env_update:env_update', |
35 |
'portage.util.install_mask:install_mask_dir,InstallMask', |
36 |
'portage.util.install_mask:install_mask_dir,InstallMask', |
Lines 3418-3423
class dblink(object):
Link Here
|
3418 |
|
3419 |
|
3419 |
os = _os_merge |
3420 |
os = _os_merge |
3420 |
|
3421 |
|
|
|
3422 |
real_relative_paths = {} |
3423 |
|
3421 |
collision_ignore = [] |
3424 |
collision_ignore = [] |
3422 |
for x in portage.util.shlex_split( |
3425 |
for x in portage.util.shlex_split( |
3423 |
self.settings.get("COLLISION_IGNORE", "")): |
3426 |
self.settings.get("COLLISION_IGNORE", "")): |
Lines 3469-3476
class dblink(object):
Link Here
|
3469 |
previous = current |
3472 |
previous = current |
3470 |
progress_shown = True |
3473 |
progress_shown = True |
3471 |
|
3474 |
|
3472 |
dest_path = normalize_path( |
3475 |
dest_path = normalize_path(os.path.join(destroot, f.lstrip(os.path.sep))) |
3473 |
os.path.join(destroot, f.lstrip(os.path.sep))) |
3476 |
|
|
|
3477 |
# Relative path with symbolic links resolved only in parent directories |
3478 |
real_relative_path = os.path.join(os.path.realpath(os.path.dirname(dest_path)), os.path.basename(dest_path))[len(destroot):] |
3479 |
|
3480 |
real_relative_paths.setdefault(real_relative_path, []).append(f.lstrip(os.path.sep)) |
3474 |
|
3481 |
|
3475 |
parent = os.path.dirname(dest_path) |
3482 |
parent = os.path.dirname(dest_path) |
3476 |
if parent not in dirs: |
3483 |
if parent not in dirs: |
Lines 3556-3564
class dblink(object):
Link Here
|
3556 |
break |
3563 |
break |
3557 |
if stopmerge: |
3564 |
if stopmerge: |
3558 |
collisions.append(f) |
3565 |
collisions.append(f) |
|
|
3566 |
|
3567 |
internal_collisions = {} |
3568 |
for real_relative_path, files in real_relative_paths.items(): |
3569 |
# Detect internal collisions between non-identical files. |
3570 |
if len(files) >= 2: |
3571 |
files.sort() |
3572 |
for i in range(len(files) - 1): |
3573 |
file1 = normalize_path(os.path.join(srcroot, files[i])) |
3574 |
file2 = normalize_path(os.path.join(srcroot, files[i+1])) |
3575 |
differences = compare_files(file1, file2) |
3576 |
# Ignore differences in times. |
3577 |
for time_type in ("atime", "mtime", "ctime"): |
3578 |
if time_type in differences: |
3579 |
differences.remove(time_type) |
3580 |
if differences: |
3581 |
internal_collisions.setdefault(real_relative_path, {})[(files[i], files[i+1])] = differences |
3582 |
|
3559 |
if progress_shown: |
3583 |
if progress_shown: |
3560 |
showMessage(_("100% done\n")) |
3584 |
showMessage(_("100% done\n")) |
3561 |
return collisions, dirs_ro, symlink_collisions, plib_collisions |
3585 |
|
|
|
3586 |
return collisions, internal_collisions, dirs_ro, symlink_collisions, plib_collisions |
3562 |
|
3587 |
|
3563 |
def _lstat_inode_map(self, path_iter): |
3588 |
def _lstat_inode_map(self, path_iter): |
3564 |
""" |
3589 |
""" |
Lines 4081-4087
class dblink(object):
Link Here
|
4081 |
if blocker.exists(): |
4106 |
if blocker.exists(): |
4082 |
blockers.append(blocker) |
4107 |
blockers.append(blocker) |
4083 |
|
4108 |
|
4084 |
collisions, dirs_ro, symlink_collisions, plib_collisions = \ |
4109 |
collisions, internal_collisions, dirs_ro, symlink_collisions, plib_collisions = \ |
4085 |
self._collision_protect(srcroot, destroot, |
4110 |
self._collision_protect(srcroot, destroot, |
4086 |
others_in_slot + blockers, filelist, linklist) |
4111 |
others_in_slot + blockers, filelist, linklist) |
4087 |
|
4112 |
|
Lines 4109-4114
class dblink(object):
Link Here
|
4109 |
eerror(msg) |
4134 |
eerror(msg) |
4110 |
return 1 |
4135 |
return 1 |
4111 |
|
4136 |
|
|
|
4137 |
if internal_collisions: |
4138 |
msg = _("Package '%s' has internal collisions (between files " |
4139 |
"in separate directories in the installation image (${D}) " |
4140 |
"corresponding to merged directories in the target " |
4141 |
"filesystem (${ROOT})):") % self.settings.mycpv |
4142 |
msg = textwrap.wrap(msg, 70) |
4143 |
msg.append("") |
4144 |
for k, v in sorted(internal_collisions.items()): |
4145 |
msg.append("\t%s" % os.path.join(destroot, k.lstrip(os.path.sep))) |
4146 |
for (file1, file2), differences in sorted(v.items()): |
4147 |
msg.append("\t\t%s" % os.path.join(destroot, file1.lstrip(os.path.sep))) |
4148 |
msg.append("\t\t%s" % os.path.join(destroot, file2.lstrip(os.path.sep))) |
4149 |
msg.append("\t\t\tDifferences: %s" % ", ".join(differences)) |
4150 |
msg.append("") |
4151 |
self._elog("eerror", "preinst", msg) |
4152 |
|
4153 |
msg = _("Package '%s' NOT merged due to internal collisions.") % \ |
4154 |
self.settings.mycpv |
4155 |
msg += _(" If necessary, refer to your elog messages for the whole " |
4156 |
"content of the above message.") |
4157 |
eerror(textwrap.wrap(msg, 70)) |
4158 |
return 1 |
4159 |
|
4112 |
if symlink_collisions: |
4160 |
if symlink_collisions: |
4113 |
# Symlink collisions need to be distinguished from other types |
4161 |
# Symlink collisions need to be distinguished from other types |
4114 |
# of collisions, in order to avoid confusion (see bug #409359). |
4162 |
# of collisions, in order to avoid confusion (see bug #409359). |