2019-02-18 23:53:48 +08:00
|
|
|
import json
|
2019-02-19 00:01:20 +08:00
|
|
|
import bz2
|
2019-02-18 23:53:48 +08:00
|
|
|
import sys
|
2019-02-17 20:26:46 +08:00
|
|
|
|
2019-02-18 23:53:48 +08:00
|
|
|
with open(sys.argv[1], "r") as f:
|
|
|
|
hydra_json = json.load(f)
|
|
|
|
|
|
|
|
drv = hydra_json["drvPath"]
|
|
|
|
assert drv.startswith("/nix/store/")
|
|
|
|
drv = drv[len("/nix/store/"):]
|
2019-02-19 00:01:20 +08:00
|
|
|
hydra_log = "/var/lib/hydra/build-logs/" + drv[:2] + "/" + drv[2:] + ".bz2"
|
2019-02-18 23:53:48 +08:00
|
|
|
|
2019-02-19 00:01:20 +08:00
|
|
|
with bz2.BZ2File(hydra_log, "w") as f:
|
|
|
|
f.write(b"hack successful")
|