Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Zac Medico" <zmedico@g.o>
Subject: proj/portage:master commit in: pym/portage/dbapi/
Date: Tue, 1 Mar 2011 20:08:42 +0000 (UTC)
commit:     4778b4b46260a7f585e30c712a1002361302f4db
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:07:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4778b4b4

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 2e5d873..77d0256 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1785,7 +1785,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)
@@ -1847,6 +1847,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):
 
@@ -1872,6 +1873,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
@@ -1940,7 +1953,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)
@@ -1992,7 +2005,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:


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in dev-haskell/wxhaskell: ChangeLog wxhaskell-0.9.4.ebuild
Next by thread:
proj/portage:master commit in: pym/portage/dbapi/
Previous by date:
gentoo-x86 commit in dev-haskell/wxhaskell: ChangeLog wxhaskell-0.9.4.ebuild
Next by date:
gentoo-x86 commit in profiles: ChangeLog package.mask


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.