diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-09-01 15:47:08 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-09-01 15:48:32 +0530 |
commit | 1001d8bb31d7a069b6b026ae2331034e3f4f0697 (patch) | |
tree | 92b4bcf8bcbf9f119fee6c6c5f6245bc8afcc337 /src/jobs.c | |
parent | ef8272ae34c905f61cb8fe1fcce9d0c1238c0c37 (diff) |
jobs/job_read_cache: drv should start with store path
Diffstat (limited to 'src/jobs.c')
-rw-r--r-- | src/jobs.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -12,11 +12,12 @@ #include "jobs.h" #include "util.h" +#define NIX_STORE_PATH "/nix/store/" + #ifndef NIX_EVAL_JOBS_PATH #warning "NIX_EVAL_JOBS_PATH not defined, evanix will rely on PATH instead" #define NIX_EVAL_JOBS_PATH nix - eval - jobs #endif - #define XSTR(x) STR(x) #define STR(x) #x #pragma message "NIX_EVAL_JOBS_PATH=" XSTR(NIX_EVAL_JOBS_PATH) @@ -422,14 +423,20 @@ static int job_read_cache(struct job *job) nlines = 0; for (bool in_fetched_block = false; getline(&line, &n, nix_build_stream) >= 0; nlines++) { + trimmed = trim(line); + if (strstr(line, "will be built")) { continue; } else if (strstr(line, "will be fetched")) { in_fetched_block = true; continue; + } else if (strncmp(trimmed, NIX_STORE_PATH, + sizeof(NIX_STORE_PATH) - 1)) { + /* TODO: use libstore instead + * */ + continue; } - trimmed = trim(line); j = job_search(job, trimmed); if (j == NULL) { ret = job_new(&dep_job, NULL, trimmed, NULL, job); |