aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-09-01 15:47:08 +0530
committersinanmohd <sinan@sinanmohd.com>2024-09-01 15:48:32 +0530
commit1001d8bb31d7a069b6b026ae2331034e3f4f0697 (patch)
tree92b4bcf8bcbf9f119fee6c6c5f6245bc8afcc337 /src
parentef8272ae34c905f61cb8fe1fcce9d0c1238c0c37 (diff)
jobs/job_read_cache: drv should start with store path
Diffstat (limited to 'src')
-rw-r--r--src/jobs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/jobs.c b/src/jobs.c
index f9e74db..41fa3f3 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -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);