From 5e3d5b45a397f257384473e0a99adcc265b52fee Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Fri, 3 Dec 2010 09:53:21 +0100 Subject: [PATCH] Don't append yum output to the diff file --- utils/filediff.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/filediff.py b/utils/filediff.py index a75af9d0..4233d97b 100644 --- a/utils/filediff.py +++ b/utils/filediff.py @@ -72,9 +72,22 @@ def main(args): sys.stdout.write(line) # set up yum + + # XXX HACK + # we don't want yum's stuff in the output + # so we redirect stdout to /dev/null for a while... + stdout = os.dup(1) + null = open("/dev/null", "w") + os.dup2(null.fileno(), 1) + + # here yum prints out some stuff we really don't care about yb = yum.YumBase() yb.doSackSetup() + # give the stdout back + os.dup2(stdout, 1) + null.close() + # get excessive files in source sys.stderr.write("getting excessive files in source\n") sizedict, pkgdict = {}, {}