1
0
Fork 0

actually use bz2 log compression properly

This commit is contained in:
Sebastien Bourdeauducq 2019-02-19 00:01:20 +08:00
parent e160e83ca8
commit e16c81e8da
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import json import json
import bz2
import sys import sys
with open(sys.argv[1], "r") as f: with open(sys.argv[1], "r") as f:
@ -7,7 +8,7 @@ with open(sys.argv[1], "r") as f:
drv = hydra_json["drvPath"] drv = hydra_json["drvPath"]
assert drv.startswith("/nix/store/") assert drv.startswith("/nix/store/")
drv = drv[len("/nix/store/"):] drv = drv[len("/nix/store/"):]
hydra_log = "/var/lib/hydra/build-logs/" + drv[:2] + "/" + drv[2:] hydra_log = "/var/lib/hydra/build-logs/" + drv[:2] + "/" + drv[2:] + ".bz2"
with open(hydra_log, "w") as f: with bz2.BZ2File(hydra_log, "w") as f:
f.write("hack successful") f.write(b"hack successful")