1 |
On Tuesday, 7 March 2023 07:52:01 GMT Mickaël Bucas wrote: |
2 |
> Le mar. 7 mars 2023 à 05:36, Bryan Gardiner <bog@××××××.net> a écrit : |
3 |
> > Hi folks, |
4 |
> > |
5 |
> > How can I follow Portage's compressed build logs in real time as they |
6 |
> > are generated? |
7 |
> > |
8 |
> > I keep build logs and use FEATURES=compress-build-logs so that they |
9 |
> > don't get too large. I can peek at how a build is going with zless on |
10 |
> > build.log.gz, which doesn't update (understandably), but I would |
11 |
> > really like to be able to watch a log with some "tail -f" equivalent. |
12 |
> > I get streaming output with |
13 |
> > |
14 |
> > tail -c +1 -f build.log.gz | od -t x1 |
15 |
> > |
16 |
> > but the following hangs with no output: |
17 |
> > tail -c +1 -f build.log.gz | gunzip |
18 |
> > |
19 |
> > even with a build log that is 72KB compressed (2.4MB uncompressed), |
20 |
> > which should be larger than any pipe buffers... Any idea why gunzip |
21 |
> > can't handle this, or what I should I should be doing instead? |
22 |
> > |
23 |
> > Thanks, |
24 |
> > Bryan |
25 |
> |
26 |
> Hi |
27 |
> |
28 |
> Reading the man page, "zless" is just a wrapper around "less". |
29 |
> You can check with: |
30 |
> $ file $(which zless) |
31 |
> /usr/bin/zless: POSIX shell script, ASCII text executable |
32 |
> $ less $(which zless) |
33 |
> |
34 |
> So it should support the same options including typing "F" at the end |
35 |
> of a file to keep trying to read when the end of file is reached. |
36 |
> |
37 |
> I made a small test, but it didn't work: |
38 |
> # Create a growing file |
39 |
> $ yes | nl | gzip > zless-test.gz & |
40 |
> # Try to follow at the end |
41 |
> $ zless zless-test.gz |
42 |
> |
43 |
> With ">" to go to the end and "F" to continue, I didn't get the |
44 |
> expected behavior, it stood still at the point I was viewing. |
45 |
> I don't know if it's really a bug or if I made a mistake... |
46 |
> (Don't forget to stop the growing file :) ) |
47 |
> |
48 |
> Best regards |
49 |
> |
50 |
> Mickaël Bucas |
51 |
|
52 |
You could try: |
53 |
|
54 |
tail -c +1 -f build.log.gz | gunzip | less |
55 |
|
56 |
I think it should work, but I haven't tried it. |