Rather than requiring -q, if redirected to a log, we shouldn't write \r.
--- /usr/share/createrepo/genpkgmetadata.py.orig	2010-03-11 16:46:04.605295368 -0500
+++ /usr/share/createrepo/genpkgmetadata.py	2010-03-11 16:47:36.272047459 -0500
@@ -180,6 +180,9 @@
 
 class MDCallBack(object):
     """cli callback object for createrepo"""
+    def __init__(self):
+        self.__show_progress = os.isatty(1)
+	
     def errorlog(self, thing):
         """error log output"""
         print >> sys.stderr, thing
@@ -190,6 +193,8 @@
     
     def progress(self, item, current, total):
         """progress bar"""
+        if not self.__show_progress:
+            return
         beg = "%*d/%d - " % (len(str(total)), current, total)
         left = 80 - len(beg)
         sys.stdout.write("\r%s%-*.*s" % (beg, left, left, item))
--
buildsys mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/buildsys

Reply via email to