public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dbapi/
Date: Tue,  1 Mar 2011 20:55:26 +0000 (UTC)	[thread overview]
Message-ID: <f9895ac7a04ee31af370151f238409cae4ac1a01.zmedico@gentoo> (raw)

commit:     f9895ac7a04ee31af370151f238409cae4ac1a01
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  1 20:07:53 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar  1 20:54:01 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f9895ac7

unmerge: implicitly unmerge parent directories

We can't necessarily assume that they are explicitly listed in
CONTENTS.

---
 pym/portage/dbapi/vartree.py |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index b8881c8..a7a7d40 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1784,7 +1784,7 @@ class dblink(object):
 			mykeys.reverse()
 
 			#process symlinks second-to-last, directories last.
-			mydirs = []
+			mydirs = set()
 			ignored_unlink_errnos = (
 				errno.EBUSY, errno.ENOENT,
 				errno.ENOTDIR, errno.EISDIR)
@@ -1846,6 +1846,7 @@ class dblink(object):
 
 			real_root = self.settings['ROOT']
 			real_root_len = len(real_root) - 1
+			eroot_split_len = len(self.settings["EROOT"].split(os.sep)) - 1
 
 			for i, objkey in enumerate(mykeys):
 
@@ -1871,6 +1872,18 @@ class dblink(object):
 							os = portage.os
 							perf_md5 = portage.checksum.perform_md5
 
+				# Try to unmerge parent directories of everything
+				# listed in CONTENTS, since we can't necessarily
+				# assume that directories are listed in CONTENTS.
+				obj_split = obj.split(os.sep)
+				obj_split.pop()
+				while len(obj_split) > eroot_split_len:
+					parent = os.sep.join(obj_split)
+					if parent in mydirs:
+						break
+					mydirs.add(parent)
+					obj_split.pop()
+
 				file_data = pkgfiles[objkey]
 				file_type = file_data[0]
 				statobj = None
@@ -1939,7 +1952,7 @@ class dblink(object):
 					if lstatobj is None or not stat.S_ISDIR(lstatobj.st_mode):
 						show_unmerge("---", unmerge_desc["!dir"], file_type, obj)
 						continue
-					mydirs.append(obj)
+					mydirs.add(obj)
 				elif pkgfiles[objkey][0] == "sym":
 					if not islink:
 						show_unmerge("---", unmerge_desc["!sym"], file_type, obj)
@@ -1991,7 +2004,7 @@ class dblink(object):
 				elif pkgfiles[objkey][0] == "dev":
 					show_unmerge("---", "", file_type, obj)
 
-			mydirs.sort()
+			mydirs = sorted(mydirs)
 			mydirs.reverse()
 
 			for obj in mydirs:



             reply	other threads:[~2011-03-01 21:05 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 20:55 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-05-27  2:56 [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dbapi/ Zac Medico
2011-05-27  2:16 Zac Medico
2011-05-27  0:05 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-12 20:13 Zac Medico
2011-05-12 17:58 Zac Medico
2011-05-12  7:13 Zac Medico
2011-05-12  5:47 Zac Medico
2011-05-12  5:47 Zac Medico
2011-05-12  5:24 Zac Medico
2011-05-12  5:24 Zac Medico
2011-05-12  5:24 Zac Medico
2011-05-12  5:24 Zac Medico
2011-05-12  5:24 Zac Medico
2011-05-12  5:24 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-08 20:50 Zac Medico
2011-05-04 20:03 Zac Medico
2011-03-27 21:00 Zac Medico
2011-03-18 21:12 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-14 16:24 Zac Medico
2011-03-01 21:54 Zac Medico
2011-03-01 21:06 Zac Medico
2011-03-01 20:55 Zac Medico
2011-03-01 20:55 Zac Medico
2011-02-14  4:31 Zac Medico

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=f9895ac7a04ee31af370151f238409cae4ac1a01.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@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