1 |
Le mar. 7 mars 2023 à 05:36, Bryan Gardiner <bog@××××××.net> a écrit : |
2 |
> |
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 |
> |
18 |
> tail -c +1 -f build.log.gz | gunzip |
19 |
> |
20 |
> even with a build log that is 72KB compressed (2.4MB uncompressed), |
21 |
> which should be larger than any pipe buffers... Any idea why gunzip |
22 |
> can't handle this, or what I should I should be doing instead? |
23 |
> |
24 |
> Thanks, |
25 |
> Bryan |
26 |
> |
27 |
Hi |
28 |
|
29 |
Reading the man page, "zless" is just a wrapper around "less". |
30 |
You can check with: |
31 |
$ file $(which zless) |
32 |
/usr/bin/zless: POSIX shell script, ASCII text executable |
33 |
$ less $(which zless) |
34 |
|
35 |
So it should support the same options including typing "F" at the end |
36 |
of a file to keep trying to read when the end of file is reached. |
37 |
|
38 |
I made a small test, but it didn't work: |
39 |
# Create a growing file |
40 |
$ yes | nl | gzip > zless-test.gz & |
41 |
# Try to follow at the end |
42 |
$ zless zless-test.gz |
43 |
|
44 |
With ">" to go to the end and "F" to continue, I didn't get the |
45 |
expected behavior, it stood still at the point I was viewing. |
46 |
I don't know if it's really a bug or if I made a mistake... |
47 |
(Don't forget to stop the growing file :) ) |
48 |
|
49 |
Best regards |
50 |
|
51 |
Mickaël Bucas |