z***@osuosl.org
2012-11-07 14:34:10 UTC
createrepo/__init__.py | 4 ----
createrepo/utils.py | 10 +++++++++-
2 files changed, 9 insertions(+), 5 deletions(-)
New commits:
commit 910d335110518536d0e3dcd0359aee7ced05c7c6
Author: ZdenÄk Pavlas <***@redhat.com>
Date: Wed Nov 7 11:19:10 2012 +0100
Skip write("") to avoid "LZMA.error: unknown error!"
diff --git a/createrepo/utils.py b/createrepo/utils.py
index d66b115..cfe68e6 100644
--- a/createrepo/utils.py
+++ b/createrepo/utils.py
@@ -98,6 +98,10 @@ def gzFile(source, dest):
s_fn.close()
+class Duck:
+ def __init__(self, **attr):
+ self.__dict__ = attr
+
def compressFile(source, dest, compress_type):
"""Compress an existing file using any compression type from source to dest"""
@@ -120,7 +124,11 @@ def compressOpen(fn, mode='rb', compress_type=None):
compress_type = 'gz'
if compress_type == 'xz':
- return lzma.LZMAFile(fn, mode)
+ fh = lzma.LZMAFile(fn, mode)
+ if mode == 'w':
+ fh = Duck(write=lambda s, write=fh.write: s != '' and write(s),
+ close=fh.close)
+ return fh
elif compress_type == 'bz2':
return bz2.BZ2File(fn, mode)
elif compress_type == 'gz':
commit ed6a3da32a72f214a758862c82b01fb6eb08c405
Author: ZdenÄk Pavlas <***@redhat.com>
Date: Wed Nov 7 11:36:26 2012 +0100
Remove empty log message
diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 7e75789..f0f4d93 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -706,10 +706,6 @@ class MetaDataGenerator:
def closeMetadataDocs(self):
- if not self.conf.quiet:
- self.callback.log('')
-
-
# save them up to the tmp locations:
if not self.conf.quiet:
self.callback.log(_('Saving Primary metadata'))
createrepo/utils.py | 10 +++++++++-
2 files changed, 9 insertions(+), 5 deletions(-)
New commits:
commit 910d335110518536d0e3dcd0359aee7ced05c7c6
Author: ZdenÄk Pavlas <***@redhat.com>
Date: Wed Nov 7 11:19:10 2012 +0100
Skip write("") to avoid "LZMA.error: unknown error!"
diff --git a/createrepo/utils.py b/createrepo/utils.py
index d66b115..cfe68e6 100644
--- a/createrepo/utils.py
+++ b/createrepo/utils.py
@@ -98,6 +98,10 @@ def gzFile(source, dest):
s_fn.close()
+class Duck:
+ def __init__(self, **attr):
+ self.__dict__ = attr
+
def compressFile(source, dest, compress_type):
"""Compress an existing file using any compression type from source to dest"""
@@ -120,7 +124,11 @@ def compressOpen(fn, mode='rb', compress_type=None):
compress_type = 'gz'
if compress_type == 'xz':
- return lzma.LZMAFile(fn, mode)
+ fh = lzma.LZMAFile(fn, mode)
+ if mode == 'w':
+ fh = Duck(write=lambda s, write=fh.write: s != '' and write(s),
+ close=fh.close)
+ return fh
elif compress_type == 'bz2':
return bz2.BZ2File(fn, mode)
elif compress_type == 'gz':
commit ed6a3da32a72f214a758862c82b01fb6eb08c405
Author: ZdenÄk Pavlas <***@redhat.com>
Date: Wed Nov 7 11:36:26 2012 +0100
Remove empty log message
diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 7e75789..f0f4d93 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -706,10 +706,6 @@ class MetaDataGenerator:
def closeMetadataDocs(self):
- if not self.conf.quiet:
- self.callback.log('')
-
-
# save them up to the tmp locations:
if not self.conf.quiet:
self.callback.log(_('Saving Primary metadata'))