]>
git.scottworley.com Git - nix-currently-building/blob - nix_currently_building.py
6 MIN_AGE
= time
.time() - 86400 * 1
9 def removesuffix(s
, suf
): # Until python 3.9
10 return s
[:len(s
) - len(suf
)] if s
.endswith(suf
) else s
14 return subprocess
.run(['bunzip2', '--test', log
], stderr
=subprocess
.DEVNULL
).returncode
== 2
18 for d
, _
, files
in os
.walk(os
.environ
.get('NIX_LOG_DIR', '/nix/var/log/nix')):
20 path
= os
.path
.join(d
, f
)
22 if st
.st_mtime
> MIN_AGE
and truncated(path
):
23 print(d
[-2:] + removesuffix(f
, '.bz2'))
26 if __name__
== '__main__':