From: "Zac Medico (zmedico)" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] portage r10250 - main/trunk/pym/portage/dbapi
Date: Thu, 08 May 2008 21:18:02 +0000 [thread overview]
Message-ID: <E1JuDV4-0004dx-Ly@stork.gentoo.org> (raw)
Author: zmedico
Date: 2008-05-08 21:18:01 +0000 (Thu, 08 May 2008)
New Revision: 10250
Modified:
main/trunk/pym/portage/dbapi/vartree.py
Log:
Make some confmem behavior modifications in order to try and make it
less confusing for people who have forgotten about the --noconfmem
option or are completely unaware of it. Thanks to Joe Peterson
<lavajoe@gentoo.org> for suggesting these:
* Always behave like --noconfmem is enabled for downgrades.
* Purge confmem entries when a package is unmerged rather
than replaced.
Modified: main/trunk/pym/portage/dbapi/vartree.py
===================================================================
--- main/trunk/pym/portage/dbapi/vartree.py 2008-05-08 20:05:53 UTC (rev 10249)
+++ main/trunk/pym/portage/dbapi/vartree.py 2008-05-08 21:18:01 UTC (rev 10250)
@@ -1403,8 +1403,12 @@
vartree=self.vartree))
dest_root = normalize_path(self.vartree.root).rstrip(os.path.sep) + \
os.path.sep
- dest_root_len = len(dest_root)
+ dest_root_len = len(dest_root) - 1
+ conf_mem_file = os.path.join(dest_root, CONFIG_MEMORY_FILE)
+ cfgfiledict = grabdict(conf_mem_file)
+ stale_confmem = []
+
unmerge_orphans = "unmerge-orphans" in self.settings.features
if pkgfiles:
@@ -1468,6 +1472,9 @@
continue
if obj.startswith(dest_root):
relative_path = obj[dest_root_len:]
+ if not others_in_slot and \
+ relative_path in cfgfiledict:
+ stale_confmem.append(relative_path)
is_owned = False
for dblnk in others_in_slot:
if dblnk.isowner(relative_path, dest_root):
@@ -1592,6 +1599,12 @@
show_unmerge("---", "!empty", "dir", obj)
del e
+ # Remove stale entries from config memory.
+ if stale_confmem:
+ for filename in stale_confmem:
+ del cfgfiledict[filename]
+ writedict(cfgfiledict, conf_mem_file)
+
#remove self from vartree database so that our own virtual gets zapped if we're the last node
self.vartree.zap(self.mycpv)
@@ -2206,6 +2219,15 @@
else:
cfgfiledict["IGNORE"]=0
+ # Always behave like --noconfmem is enabled for downgrades
+ # so that people who don't know about this option are less
+ # likely to get confused when doing upgrade/downgrade cycles.
+ pv_split = catpkgsplit(self.mycpv)[1:]
+ for other in others_in_slot:
+ if pkgcmp(pv_split, catpkgsplit(other.mycpv)[1:]) < 0:
+ cfgfiledict["IGNORE"] = 1
+ break
+
# Don't bump mtimes on merge since some application require
# preservation of timestamps. This means that the unmerge phase must
# check to see if file belongs to an installed instance in the same
--
gentoo-commits@lists.gentoo.org mailing list
reply other threads:[~2008-05-08 21:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1JuDV4-0004dx-Ly@stork.gentoo.org \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox