Blame SOURCES/sos-bz1912910-empty-file-stops-collecting.patch

62aeb2
From 03642cf2e5619f11c762b63c61c9c69fb2b00cdf Mon Sep 17 00:00:00 2001
62aeb2
From: Pavel Moravec <pmoravec@redhat.com>
62aeb2
Date: Tue, 8 Dec 2020 19:33:07 +0100
62aeb2
Subject: [PATCH] [plugins] Dont stop collecting by empty specfile when
62aeb2
 sizelimit=0
62aeb2
62aeb2
When sizelimit=0, collecting an empty file would set limit_reached
62aeb2
wrongly and stop collecting further files. Let fix this corner case.
62aeb2
62aeb2
Resolves: #2330
62aeb2
62aeb2
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
62aeb2
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
62aeb2
---
62aeb2
 sos/report/plugins/__init__.py | 2 +-
62aeb2
 1 file changed, 1 insertion(+), 1 deletion(-)
62aeb2
62aeb2
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
62aeb2
index deb46c93..510e116e 100644
62aeb2
--- a/sos/report/plugins/__init__.py
62aeb2
+++ b/sos/report/plugins/__init__.py
62aeb2
@@ -1483,7 +1483,7 @@ class Plugin(object):
62aeb2
                     self._add_copy_paths([_file])
62aeb2
                     # in the corner case we just reached the sizelimit, we
62aeb2
                     # should collect the whole file and stop
62aeb2
-                    limit_reached = (current_size == sizelimit)
62aeb2
+                    limit_reached = (sizelimit and current_size == sizelimit)
62aeb2
             if self.manifest:
62aeb2
                 self.manifest.files.append({
62aeb2
                     'specification': copyspec,
62aeb2
-- 
62aeb2
2.26.2
62aeb2