Lines 2583-2590
Link Here
|
2583 |
|
2583 |
|
2584 |
preserve_paths = set() |
2584 |
preserve_paths = set() |
2585 |
for preserve_node in preserve_nodes: |
2585 |
for preserve_node in preserve_nodes: |
2586 |
preserve_paths.update(preserve_node.alt_paths) |
2586 |
# Make sure that at least one of the paths is not a symlink. |
|
|
2587 |
# This prevents symlinks from being erroneously preserved by |
2588 |
# themselves when the old instance installed symlinks that |
2589 |
# the new instance does not install. |
2590 |
have_lib = False |
2591 |
for f in preserve_node.alt_paths: |
2592 |
f_abs = os.path.join(root, f.lstrip(os.sep)) |
2593 |
try: |
2594 |
if stat.S_ISREG(os.lstat(f_abs).st_mode): |
2595 |
have_lib = True |
2596 |
break |
2597 |
except OSError: |
2598 |
continue |
2587 |
|
2599 |
|
|
|
2600 |
if have_lib: |
2601 |
preserve_paths.update(preserve_node.alt_paths) |
2602 |
|
2588 |
return preserve_paths |
2603 |
return preserve_paths |
2589 |
|
2604 |
|
2590 |
def _add_preserve_libs_to_contents(self, preserve_paths): |
2605 |
def _add_preserve_libs_to_contents(self, preserve_paths): |
Lines 2719-2725
Link Here
|
2719 |
unlink_list.update(node.alt_paths) |
2734 |
unlink_list.update(node.alt_paths) |
2720 |
unlink_list = sorted(unlink_list) |
2735 |
unlink_list = sorted(unlink_list) |
2721 |
for obj in unlink_list: |
2736 |
for obj in unlink_list: |
2722 |
cpv = path_cpv_map[obj] |
2737 |
cpv = path_cpv_map.get(obj) |
|
|
2738 |
if cpv is None: |
2739 |
# This means that a symlink is in the preserved libs |
2740 |
# registry, but the actual lib it points to is not. |
2741 |
self._display_merge("!!! symlink to lib is preserved, " + \ |
2742 |
"but not the lib itself:\n!!! '%s'\n" % (obj,), |
2743 |
level=logging.ERROR, noiselevel=-1) |
2744 |
continue |
2723 |
removed = cpv_lib_map.get(cpv) |
2745 |
removed = cpv_lib_map.get(cpv) |
2724 |
if removed is None: |
2746 |
if removed is None: |
2725 |
removed = set() |
2747 |
removed = set() |