diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-04-30 07:12:41 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-04-30 07:12:41 +0000 |
commit | a57e6c5b87b00435a20fbcd74f09689482913d26 (patch) | |
tree | 7ee2e5cc0d11ec204d56dfa9016e5a6221bbe3b1 /pym/portage/__init__.py | |
parent | Add support in action_uninstall() for file -> package lookup. (trunk r13345) (diff) | |
download | portage-multirepo-a57e6c5b87b00435a20fbcd74f09689482913d26.tar.gz portage-multirepo-a57e6c5b87b00435a20fbcd74f09689482913d26.tar.bz2 portage-multirepo-a57e6c5b87b00435a20fbcd74f09689482913d26.zip |
Bug #266211 - Handle ESTALE like ENOENT in fetch and locking code. Thanks to
Krzysztof Olędzki <ole+gentoo@ans.pl> for the initial patch. (trunk r13347)
svn path=/main/branches/2.1.6/; revision=13503
Diffstat (limited to 'pym/portage/__init__.py')
-rw-r--r-- | pym/portage/__init__.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 3dada679..fba07547 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -3914,7 +3914,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", try: mysize = os.stat(myfile_path).st_size except OSError, e: - if e.errno != errno.ENOENT: + if e.errno not in (errno.ENOENT, errno.ESTALE): raise del e mysize = 0 @@ -4026,7 +4026,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", try: os.unlink(myfile_path) except OSError, e: - if e.errno != errno.ENOENT: + if e.errno not in (errno.ENOENT, errno.ESTALE): raise del e os.symlink(readonly_file, myfile_path) @@ -4041,14 +4041,14 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", " %(file)s\n" % {"file":myfile})) break except (IOError, OSError), e: - if e.errno != errno.ENOENT: + if e.errno not in (errno.ENOENT, errno.ESTALE): raise del e try: mystat = os.stat(myfile_path) except OSError, e: - if e.errno != errno.ENOENT: + if e.errno not in (errno.ENOENT, errno.ESTALE): raise del e else: @@ -4192,7 +4192,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", try: mysize = os.stat(myfile_path).st_size except OSError, e: - if e.errno != errno.ENOENT: + if e.errno not in (errno.ENOENT, errno.ESTALE): raise del e mysize = 0 @@ -4216,7 +4216,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", try: mystat = os.stat(myfile_path) except OSError, e: - if e.errno != errno.ENOENT: + if e.errno not in (errno.ENOENT, errno.ESTALE): raise del e fetched = 0 @@ -4228,7 +4228,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", try: os.unlink(myfile_path) except OSError, e: - if e.errno != errno.ENOENT: + if e.errno not in \ + (errno.ENOENT, errno.ESTALE): raise del e fetched = 0 @@ -4282,7 +4283,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", try: mystat = os.stat(myfile_path) except OSError, e: - if e.errno != errno.ENOENT: + if e.errno not in (errno.ENOENT, errno.ESTALE): raise del e fetched = 0 |