]>
git.scottworley.com Git - nix-currently-building/blob - nix_currently_building.py
1b507c8ea6d328e3507e20ec69239e3b070ae9b1
7 MIN_AGE
= time
.time() - 86400 * 7
10 def removesuffix(s
, suf
): # Until python 3.9
11 return s
[:len(s
) - len(suf
)] if s
.endswith(suf
) else s
15 return subprocess
.run(['bunzip2', '--test', log
], stderr
=subprocess
.DEVNULL
).returncode
== 2
19 for d
, _
, files
in os
.walk(os
.environ
.get('NIX_LOG_DIR', '/nix/var/log/nix')):
21 path
= os
.path
.join(d
, f
)
23 if (st
.st_size
% BLOCK_SIZE
) == 0 and st
.st_mtime
> MIN_AGE
and truncated(path
):
24 print(d
[-2:] + removesuffix(f
, '.bz2'))
27 if __name__
== '__main__':