From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D95BE138010 for ; Thu, 25 Oct 2012 19:49:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BE48A21C0BD; Thu, 25 Oct 2012 19:49:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4A21121C0BD for ; Thu, 25 Oct 2012 19:49:19 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A8A6233D7C7 for ; Thu, 25 Oct 2012 19:49:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id F0B67E5436 for ; Thu, 25 Oct 2012 19:49:15 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1351194536.690312722e111cf813b591dd4dccb4400f5f7f79.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/vartree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 690312722e111cf813b591dd4dccb4400f5f7f79 X-VCS-Branch: master Date: Thu, 25 Oct 2012 19:49:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f749f451-8be5-4fae-98af-567295ce2f84 X-Archives-Hash: 161fcf5ec2cacdc8263a0d10a8af0df7 commit: 690312722e111cf813b591dd4dccb4400f5f7f79 Author: Zac Medico gentoo org> AuthorDate: Thu Oct 25 19:48:56 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Oct 25 19:48:56 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=69031272 merge-sync: handle unmerge corner cases In dblink_merged_path we need to distinguish between existing and non-existing, since we need an existing path of syncfs. --- pym/portage/dbapi/vartree.py | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5bcd077..aae23e6 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -2156,7 +2156,7 @@ class dblink(object): # here so that _unmerge_dirs can see that we've # removed a file from this device, and will record # the parent directory for a syncfs call. - self._merged_path(file_name, lstatobj) + self._merged_path(file_name, lstatobj, exists=False) finally: if bsd_chflags and pflags != 0: @@ -4706,10 +4706,17 @@ class dblink(object): outfile.write("dev %s\n" % myrealdest) showMessage(zing + " " + mydest + "\n") - def _merged_path(self, path, lstatobj): + def _merged_path(self, path, lstatobj, exists=True): previous_path = self._device_path_map.get(lstatobj.st_dev) - if previous_path is None or len(path) < len(previous_path): - self._device_path_map[lstatobj.st_dev] = path + if previous_path is None or previous_path is False or \ + (exists and len(path) < len(previous_path)): + if exists: + self._device_path_map[lstatobj.st_dev] = path + else: + # This entry is used to indicate that we've unmerged + # a file from this device, and later, this entry is + # replaced by a parent directory. + self._device_path_map[lstatobj.st_dev] = False def _post_merge_sync(self): """ @@ -4731,6 +4738,8 @@ class dblink(object): proc.wait() else: for path in self._device_path_map.values(): + if path is False: + continue try: fd = os.open(path, os.O_RDONLY) except OSError: