Bug #194081 - Add EBUSY to the list of ignored errnos for unlink
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Sep 2007 17:09:24 +0000 (17:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Sep 2007 17:09:24 +0000 (17:09 -0000)
and rmdir calls during unmerge. (trunk r7869)

svn path=/main/branches/2.1.2/; revision=7870

pym/portage.py

index c3c640182ecb0cd4572656fc12a1fe819194e7d2..66edec9367edabb3b88c7cdb9eed83b83d923bbf 100644 (file)
@@ -7471,7 +7471,13 @@ class dblink:
 
                        #process symlinks second-to-last, directories last.
                        mydirs = []
-                       ignored_unlink_errnos = (errno.ENOENT, errno.ENOTDIR, errno.EISDIR)
+                       ignored_unlink_errnos = (
+                               errno.EBUSY, errno.ENOENT,
+                               errno.ENOTDIR, errno.EISDIR)
+                       ignored_rmdir_errnos = (
+                               errno.EEXIST, errno.ENOTEMPTY,
+                               errno.EBUSY, errno.ENOENT,
+                               errno.ENOTDIR, errno.EISDIR)
                        modprotect = os.path.join(self.vartree.root, "lib/modules/")
 
                        def unlink(file_name, lstatobj):
@@ -7636,9 +7642,7 @@ class dblink:
                                                        bsd_chflags.chflags(parent_name, pflags)
                                        show_unmerge("<<<", "", "dir", obj)
                                except EnvironmentError, e:
-                                       if e.errno not in (errno.ENOENT,
-                                               errno.EEXIST, errno.ENOTEMPTY,
-                                               errno.ENOTDIR):
+                                       if e.errno not in ignored_rmdir_errnos:
                                                raise
                                        if e.errno != errno.ENOENT:
                                                show_unmerge("---", "!empty", "dir", obj)