[yum-commits] Branch 'yum-3_2_X' - 2 commits - yummain.py yum/misc.py

skvidal at osuosl.org skvidal at osuosl.org
Fri Aug 28 00:05:43 UTC 2009


 yum/misc.py |    8 +++++++-
 yummain.py  |    2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit e1e55afd5da049d4d78dd0b09148cea751198693
Merge: 54f5970... 861fc8e...
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Aug 27 20:03:58 2009 -0400

    Merge branch 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X
    
    * 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:
      Fix printing of empty transactions, this is pretty hard to do:

commit 54f597039161e0735fa27ad4807147130d042b7f
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Aug 27 16:41:46 2009 -0400

    Emit non-pipe IOErrors properly and raise some semi-useful errors from bunzipFile
    
    when running out of space bunzipping a file  - if you hit an IOError it would just
    kinda vanish. This is ultimately due to exIOError() in yummain.py but it would be good
    to make a better error message so we know where the file is that had the error, etc
    
    fixes rh bug https://bugzilla.redhat.com/show_bug.cgi?id=518720
    and probably A LOT more that went away b/c someone ran 'yum clean all' and freed up the space

diff --git a/yum/misc.py b/yum/misc.py
index ab92b78..68ab9e4 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -10,6 +10,7 @@ import base64
 import struct
 import re
 import errno
+import Errors
 import pgpmsg
 import tempfile
 import glob
@@ -629,8 +630,13 @@ def bunzipFile(source,dest):
             break
         
         if not data: break
-        destination.write(data)
 
+        try:
+            destination.write(data)
+        except (OSError, IOError), e:
+            msg = "Error writing to file %s: %s" % (dest, str(e))
+            raise Errors.MiscError, msg
+    
     destination.close()
     s_fn.close()
 
diff --git a/yummain.py b/yummain.py
index 281d0fc..964975b 100755
--- a/yummain.py
+++ b/yummain.py
@@ -46,6 +46,8 @@ def main(args):
     def exIOError(e):
         if e.errno == 32:
             logger.critical(_('\n\nExiting on Broken Pipe'))
+        else:
+            logger.critical(_('\n\n%s') % str(e))
         if unlock(): return 200
         return 1
 


More information about the Yum-commits mailing list