[Fedora-livecd-list] [PATCH] disable mksquashfs progress bar for non-interactive sessions

Jeremy Katz katzj at redhat.com
Mon Sep 24 01:49:25 UTC 2007


On Sun, 2007-09-23 at 20:31 -0400, Jeremy Katz wrote:
> On Sun, 2007-09-23 at 05:31 -0500, Douglas McClendon wrote:
> > This patch introduces a global variable 'interactive' which is defined
> > as true if stdout of livecd-creator is attached to a tty.  This global
> > is then used to add the -no-progress option to mksquashfs for
> > non-interactive sessions.  Thus making logfiles created by redirecting
> > the output of livecd-creator, reasonably readable (e.g. with less).
> 
> I'm not sure how useful it really is as a global when we're using it for
> one thing.  If we find more places that we want it, I might be convinced
> to make it more generally accessible, but until then, it just feels a
> little bit like polluting the namespace.
> 
> Also, the more pythonic way to check is looking at sys.stdout.isatty()
> rather than os.isatty(Fdno) -- makes it a little bit more obvious to
> those who don't instinctively know "well duh, fd 1 is stdout"

And done in my local tree[1] while moving mksquashfs into its own
function.  This adds the advantage of we don't need to copy around the
hack of setting PWD in the environment as we have more than one place
that we execute mksquashfs now.

Jeremy

[1] Not pushed to master as I'm about to head off to watch some TV
before going to bed and thus want to make sure that the image I have
going _finishes_ before pushing it




More information about the livecd mailing list