1 |
commit: f90400eedc6a8788878c050880db564800c825d2 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 23 20:00:15 2019 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 24 02:41:35 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f90400ee |
7 |
|
8 |
preserve-libs: ignore dropped non-soname symlink (bug 692698) |
9 |
|
10 |
Fix the dblink _find_libs_to_preserve method to ignore a dropped |
11 |
non-soname symlink. For example, pam-1.3.1-r1 drops the non-soname |
12 |
symlink named libpam_misc.so, and we don't want this to trigger |
13 |
unnecessary preservation of the corresponding library, since the |
14 |
corresponding libpam_misc.so.0 soname symlink and the hardlink |
15 |
that it references are still provided by pam-1.3.1-r1. |
16 |
|
17 |
Bug: https://bugs.gentoo.org/692698 |
18 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
19 |
|
20 |
lib/portage/dbapi/vartree.py | 15 +++++++++++---- |
21 |
1 file changed, 11 insertions(+), 4 deletions(-) |
22 |
|
23 |
diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py |
24 |
index 4f069474b..fa1e1523c 100644 |
25 |
--- a/lib/portage/dbapi/vartree.py |
26 |
+++ b/lib/portage/dbapi/vartree.py |
27 |
@@ -3133,10 +3133,6 @@ class dblink(object): |
28 |
os = portage.os |
29 |
|
30 |
f = f_abs[root_len:] |
31 |
- if not unmerge and self.isowner(f): |
32 |
- # We have an indentically named replacement file, |
33 |
- # so we don't try to preserve the old copy. |
34 |
- continue |
35 |
try: |
36 |
consumers = linkmap.findConsumers(f, |
37 |
exclude_providers=(installed_instance.isowner,)) |
38 |
@@ -3184,16 +3180,27 @@ class dblink(object): |
39 |
hardlinks = set() |
40 |
soname_symlinks = set() |
41 |
soname = linkmap.getSoname(next(iter(preserve_node.alt_paths))) |
42 |
+ have_replacement_soname_link = False |
43 |
+ have_replacement_hardlink = False |
44 |
for f in preserve_node.alt_paths: |
45 |
f_abs = os.path.join(root, f.lstrip(os.sep)) |
46 |
try: |
47 |
if stat.S_ISREG(os.lstat(f_abs).st_mode): |
48 |
hardlinks.add(f) |
49 |
+ if not unmerge and self.isowner(f): |
50 |
+ have_replacement_hardlink = True |
51 |
+ if os.path.basename(f) == soname: |
52 |
+ have_replacement_soname_link = True |
53 |
elif os.path.basename(f) == soname: |
54 |
soname_symlinks.add(f) |
55 |
+ if not unmerge and self.isowner(f): |
56 |
+ have_replacement_soname_link = True |
57 |
except OSError: |
58 |
pass |
59 |
|
60 |
+ if have_replacement_hardlink and have_replacement_soname_link: |
61 |
+ continue |
62 |
+ |
63 |
if hardlinks: |
64 |
preserve_paths.update(hardlinks) |
65 |
preserve_paths.update(soname_symlinks) |