if (!node) {
node = xmalloc(sizeof(*node));
treap_insert(&good, &path, node, p, sz);
+ if (verbose >= 3) moan("noticed non-junk file `%.*s'", (int)sz, p);
}
}
config_subst_split_var(&config, sect, runvar, &av_version);
if (!av_version.n)
lose("empty `run-script' command for Lisp implementation `%s'", name);
- argv_append(&av_version, xstrdup("?(lisp-implementation-version)"));
+ argv_append(&av_version,
+ config_subst_string_alloc
+ (&config, sect, "<internal>",
+ "?${lisp-version?(lisp-implementation-version)}"));
config_subst_split_var(&config, sect, dumpvar, &av_dump);
if (!av_dump.n)
lose("empty `dump-image' command for Lisp implementation `%s'", name);
job->exit);
/* What happens next depends on the state of the job. This is the main
- * place which advanced the job state machine.
+ * place which advances the job state machine.
*/
if (ok) switch (job->st) {
* job, because the chances are good that it failed to produce the
* image properly.
*/
+ if (verbose >= 3)
+ moan("rename completed Lisp `%s' image `%s' to `%s'",
+ JOB_NAME(job), job->imgnew, job->imghash);
if (rename(job->imgnew, job->imghash)) {
fprintf(job->log, "%-13s > failed to rename Lisp `%s' "
"output image `%s' to `%s': %s",
ok = 0; break;
}
+ /* Notice the image so that it doesn't get junked. */
+ if (flags&AF_JUNK) {
+ p = strrchr(job->imghash, '/'); if (p) p++; else p = job->imghash;
+ notice_filename(p, strlen(p));
+ }
+
/* Determine the basename of the final image. */
p = strrchr(job->imghash, '/'); if (p) p++; else p = job->imghash;
JOB_NAME(job), job->imgnewlink, strerror(errno));
break;
}
+ if (verbose >= 3)
+ moan("establish Lisp `%s' image link `%s' referring to `%s'",
+ JOB_NAME(job), job->imglink, job->imghash);
if (symlink(p, job->imgnewlink)) {
bad("failed to create Lisp `%s' image link `%s': %s",
JOB_NAME(job), job->imgnewlink, strerror(errno));
JOB_NAME(job), job->imgnewlink, job->imglink, strerror(errno));
break;
}
- if (job->oldimg && STRCMP(job->oldimg, !=, job->imghash) &&
- unlink(job->oldimg) && errno != ENOENT) {
- if (verbose >= 1)
- moan("failed to delete old Lisp `%s' image `%s': %s",
- JOB_NAME(job), job->oldimg, strerror(errno));
+ if (job->oldimg && STRCMP(job->oldimg, !=, job->imghash)) {
+ if (verbose >= 3)
+ moan("remove old Lisp `%s' image `%s'",
+ JOB_NAME(job), job->oldimg);
+ if (unlink(job->oldimg) && errno != ENOENT) {
+ if (verbose >= 1)
+ moan("failed to delete old Lisp `%s' image `%s': %s",
+ JOB_NAME(job), job->oldimg, strerror(errno));
+ }
}
/* I think we're all done. */
{
version(fp); fputc('\n', fp); usage(fp);
fputs("\n\
-Help options:\n\
+Help options\n\
-h, --help Show this help text and exit successfully.\n\
-V, --version Show version number and exit successfully.\n\
\n\
-Diagnostics:\n\
+Diagnostics\n\
-n, --dry-run Don't run run anything (useful with `-v').\n\
-q, --quiet Don't print warning messages.\n\
-v, --verbose Print informational messages (repeatable).\n\
\n\
-Configuration:\n\
+Configuration\n\
-c, --config-file=CONF Read configuration from CONF (repeatable).\n\
-o, --set-option=[SECT:]VAR=VAL Set configuration variable (repeatable).\n\
\n\
-Image dumping:\n\
+Image dumping\n\
-O, --output=FILE|DIR Store image(s) in FILE or DIR.\n\
-R, --remove-other Delete image files for other Lisp systems.\n\
-U, --remove-unknown Delete unrecognized files in image dir.\n\