Blame SOURCES/BZ-1212514-not-enough-space.patch

5e9bef
commit 7b125d415195713596c798e8ac79e4812873d948
5e9bef
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5e9bef
Date:   Tue Dec 9 10:27:40 2014 +0100
5e9bef
5e9bef
    Expect KB as well as MB in disk requirements message from rpm. BZ 1051931
5e9bef
5e9bef
diff --git a/cli.py b/cli.py
5e9bef
index b7f5b5a..f04fe63 100755
5e9bef
--- a/cli.py
5e9bef
+++ b/cli.py
5e9bef
@@ -498,13 +498,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
5e9bef
         """
5e9bef
         summary = ''
5e9bef
         # do disk space report first
5e9bef
-        p = re.compile('needs (\d+)MB on the (\S+) filesystem')
5e9bef
+        p = re.compile('needs (\d+)(K|M)B on the (\S+) filesystem')
5e9bef
         disk = {}
5e9bef
         for m in p.finditer(errstring):
5e9bef
-            if m.group(2) not in disk:
5e9bef
-                disk[m.group(2)] = int(m.group(1))
5e9bef
-            if disk[m.group(2)] < int(m.group(1)):
5e9bef
-                disk[m.group(2)] = int(m.group(1))
5e9bef
+            size_in_mb = int(m.group(1)) if m.group(2) == 'M' else round(int(m.group(1))/1024.0, 3)
5e9bef
+            if m.group(3) not in disk:
5e9bef
+                disk[m.group(3)] = size_in_mb
5e9bef
+            if disk[m.group(3)] < size_in_mb:
5e9bef
+                disk[m.group(3)] = size_in_mb
5e9bef
                 
5e9bef
         if disk:
5e9bef
             summary += _('Disk Requirements:\n')
5e9bef
commit 6ea8a6cf572efa7d7601dfc8535f5cc3cd80c3bd
5e9bef
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5e9bef
Date:   Tue Mar 17 11:19:10 2015 +0100
5e9bef
5e9bef
    Fix rounding issue in required disk space message.
5e9bef
5e9bef
diff --git a/cli.py b/cli.py
5e9bef
index cefc67e..9766f89 100755
5e9bef
--- a/cli.py
5e9bef
+++ b/cli.py
5e9bef
@@ -25,6 +25,7 @@ import sys
5e9bef
 import time
5e9bef
 import random
5e9bef
 import logging
5e9bef
+import math
5e9bef
 from optparse import OptionParser,OptionGroup,SUPPRESS_HELP
5e9bef
 import rpm
5e9bef
 
5e9bef
@@ -501,7 +502,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
5e9bef
         p = re.compile('needs (\d+)(K|M)B on the (\S+) filesystem')
5e9bef
         disk = {}
5e9bef
         for m in p.finditer(errstring):
5e9bef
-            size_in_mb = int(m.group(1)) if m.group(2) == 'M' else round(int(m.group(1))/1024.0, 3)
5e9bef
+            size_in_mb = int(m.group(1)) if m.group(2) == 'M' else math.ceil(int(m.group(1))/1024.0)
5e9bef
             if m.group(3) not in disk:
5e9bef
                 disk[m.group(3)] = size_in_mb
5e9bef
             if disk[m.group(3)] < size_in_mb: