From 0296e40fc73d88b33e78899f95ef7b6c1a957d06 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 22 Sep 2013 12:13:28 -0400 Subject: Allow loaded objects to opt out of the "auto-rebuild" feature. --- read.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'read.c') diff --git a/read.c b/read.c index a4ca72d..7f90b9b 100644 --- a/read.c +++ b/read.c @@ -947,19 +947,27 @@ eval (struct ebuffer *ebuf, int set_default) PARSEFS_NOAR); free (p); - /* Load each file and add it to the list "to be rebuilt". */ + /* Load each file. */ while (files != 0) { struct nameseq *next = files->next; const char *name = files->name; struct dep *deps; + int r; + + /* Load the file. 0 means failure. */ + r = load_file (&ebuf->floc, &name, noerror); + if (! r && ! noerror) + fatal (&ebuf->floc, _("%s: failed to load"), name); free_ns (files); files = next; - if (! load_file (&ebuf->floc, &name, noerror) && ! noerror) - fatal (&ebuf->floc, _("%s: failed to load"), name); + /* Return of -1 means a special load: don't rebuild it. */ + if (r == -1) + continue; + /* It succeeded, so add it to the list "to be rebuilt". */ deps = alloc_dep (); deps->next = read_files; read_files = deps; -- cgit v1.2.3