Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] preserve-libs: handle manually removed libraries better (bug 599240)
Date: Wed, 09 Nov 2016 09:08:08
Message-Id: 1478682351-18596-1-git-send-email-zmedico@gentoo.org
1 Before a package is merge, prune any libraries from the registry that no
2 longer exist on disk, in case they have been manually removed. This has
3 to be done prior to merge, since after merge it is non-trivial to
4 distinguish these files from files that have just been merged.
5
6 X-Gentoo-Bug: 599240
7 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=599240
8 ---
9 pym/portage/dbapi/vartree.py | 14 ++++++++++++++
10 1 file changed, 14 insertions(+)
11
12 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
13 index 2cb96ea..5053801 100644
14 --- a/pym/portage/dbapi/vartree.py
15 +++ b/pym/portage/dbapi/vartree.py
16 @@ -4252,6 +4252,20 @@ class dblink(object):
17 #if we have a file containing previously-merged config file md5sums, grab it.
18 self.vartree.dbapi._fs_lock()
19 try:
20 + # This prunes any libraries from the registry that no longer
21 + # exist on disk, in case they have been manually removed.
22 + # This has to be done prior to merge, since after merge it
23 + # is non-trivial to distinguish these files from files
24 + # that have just been merged.
25 + plib_registry = self.vartree.dbapi._plib_registry
26 + if plib_registry:
27 + plib_registry.lock()
28 + try:
29 + plib_registry.load()
30 + plib_registry.store()
31 + finally:
32 + plib_registry.unlock()
33 +
34 # Always behave like --noconfmem is enabled for downgrades
35 # so that people who don't know about this option are less
36 # likely to get confused when doing upgrade/downgrade cycles.
37 --
38 2.7.4

Replies