[RFC] [PATCH] Intelligible build progress

Rob Landley (landley@trommello.org)
Thu, 10 Jan 2002 06:11:20 -0500


--------------Boundary-00=_W2ZPP27OUZ3HC19PORO3
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: 8bit

I got bored. I wrote a toy. It's an output filter you pipe a build into
that actually explains what's going on. It cuts the output down enough that
you can actually see warnings (wow!), but not so much you don't know what
it's doing or have some kind of progress indicator.

It's evil, it's nasty, it's ugly, it's vicious. It currently requires python
2.x (because I intend to put a curses front end on it, that's why). But it
also seems to be working, so I'm releasing what I've got so far under the GPL
so people can flame me now and avoid the rush. :)

At the moment, you just copy "blueberry.py" onto your system (the "scripts"
directory makes sense) and then use it like this (cut and paste and you've
got a shell script):

### Start of script

# "Entering directory" messages are just clutter in make dep

make dep | scripts/blueberry.py e

# This is short enough we don't need to see progress

echo "Cleaning out old temporary files."
echo " "
make clean > /dev/null

# Okay, build.

make bzImage | scripts/blueberry.py
make modules | scripts/blueberry.py

# make install/modules install require root access, not handling this yet.

### End of script

As I said, later I want to make it part of a curses front-end showing you
what directory you're currently in, what action is being taken, and with
stderr (warnings, etc) scrolling by in its own little box. Oh, and not
having to run make dep and make clean all the time would be nice too, but
that waits on Kieth Owens' new makefiles.

Yeah it's a big evil mess of heuristics. I know. And the above script will
still try to build modules if bzImage bombs with an error. And you've got to
ctrl-c twice to kill it...

I've tested it (if you can use that word) against 2.4.17, I don't know if
there's new stuff in 2.5 it can't deal with yet. (Shouldn't be, but...)

Here's the file.

You may cringe now.
--------------Boundary-00=_W2ZPP27OUZ3HC19PORO3
Content-Type: application/x-python;
name="blueberry.py"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="blueberry.py"

IyEvdXNyL2Jpbi9weXRob24yCgojIEtlcm5lbCBidWlsZCBjbGVhbmVyIHZlcnNpb24gMC4wMDAw
MDAwMDAwMSwgb3IgbGVzcy4KIyBDb3B5cmlnaHQgMjAwMiBSb2IgTGFuZGxleQojIFJlbGVhc2Vk
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XApCgogICAgIyBUaGF0
J3MgYWxsIHdlIHVuZGVyc3RhbmQuICBOb3cgZG8gc29tZXRoaW5nIHdpdGggaXQuCgogICAgaWYg
bm90IHJlc3VsdDoKICAgICAgb3V0cHV0LndyaXRlKCJVbmtub3duIGxpbmU6ICVzXG4iICUgbGlu
ZSkKICAgIGVsc2U6CiAgICAgIG91dHB1dC53cml0ZShyZXN1bHQpCiAgICAgIGlmIG5vdCBzaHV0
dXA6IG91dHB1dC53cml0ZSgiXG4iKQoKZW5kb2ZsaW5lPSJcciIKaWYgbGVuKHN5cy5hcmd2KT4x
OgogIGlmIHN5cy5hcmd2WzFdLmZpbmQoIm4iKSE9LTE6IGVuZG9mbGluZT0iXG4iCiAgaWYgc3lz
LmFyZ3ZbMV0uZmluZCgiYyIpIT0tMTogc2hvd2NvdW50PTEKICBlbHNlOiBzaG93Y291bnQ9MAog
IGlmIHN5cy5hcmd2WzFdLmZpbmQoImUiKSE9LTE6IG5vZW50ZXI9MQoKbWFuZ2xlKHN5cy5zdGRp
biwgc3lzLnN0ZG91dCkKcHJpbnQKCgo=

--------------Boundary-00=_W2ZPP27OUZ3HC19PORO3--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/