commit:     4748a9b19893cfb43b8f80293bec85f541490aa8
Author:     Sheng Yu <syu.os <AT> protonmail <DOT> com>
AuthorDate: Thu Jan 19 18:26:17 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 20 01:40:42 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4748a9b1

gpk: Terminate writing if space is full

Bug: https://bugs.gentoo.org/891391
Signed-off-by: Sheng Yu <syu.os <AT> protonmail.com>
Closes: https://github.com/gentoo/portage/pull/980
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                | 6 ++++++
 lib/portage/gpkg.py | 8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 3ef205a6d..b22d4e80f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+portage-3.0.45 (UNRELEASED)
+--------------
+
+Bug fixes:
+* gpkg: Handle out-of-space errors (bug #891391).
+
 portage-3.0.44 (2023-01-15)
 --------------
 

diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py
index 23f6e0c61..59339f685 100644
--- a/lib/portage/gpkg.py
+++ b/lib/portage/gpkg.py
@@ -201,8 +201,12 @@ class tar_stream_writer:
                 if not self.killed:
                     # Do not raise error if killed by portage
                     raise CompressorOperationFailed("PIPE broken")
-
-            self.container.fileobj.write(buffer)
+            try:
+                self.container.fileobj.write(buffer)
+            except OSError as err:
+                self.error = True
+                self.kill()
+                raise CompressorOperationFailed(str(err))
             if self.checksum_helper:
                 self.checksum_helper.update(buffer)
 

Reply via email to