/* -*-c-*-
*
- * $Id: pres_curses.c,v 1.2 1999/06/24 15:51:16 mdw Exp $
+ * $Id: pres_curses.c,v 1.3 1999/07/16 12:49:58 mdw Exp $
*
* Curses-based output presentation
*
/*----- Revision history --------------------------------------------------*
*
* $Log: pres_curses.c,v $
+ * Revision 1.3 1999/07/16 12:49:58 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
* Revision 1.2 1999/06/24 15:51:16 mdw
* Fix signal handlers so they don't corrupt `errno'.
*
leaveok(c->s, TRUE);
wbkgdset(c->s, A_STANDOUT);
werase(c->s);
- mvwprintw(c->s, 0, 0, " %s [running]\n", c->e->arch);
+ mvwprintw(c->s, 0, 0, " %s [running]\n", c->e->arch);
wnoutrefresh(c->w);
wnoutrefresh(c->s);
}
/* --- @curses_close@ --- */
-void curses_close(archent *e, int ok)
+void curses_close(archent *e, int ok, const char *summ)
{
cwin *c = e->pres;
- mvwprintw(c->s, 0, 0, " %s [%s]\n", e->arch, ok ? "finished" : "failed");
+ mvwprintw(c->s, 0, 0, " %s [%s]\n", e->arch, summ);
wrefresh(c->s);
}
/* -*-c-*-
*
- * $Id: pres_curses.h,v 1.1 1999/06/02 16:53:36 mdw Exp $
+ * $Id: pres_curses.h,v 1.2 1999/07/16 12:49:58 mdw Exp $
*
* Curses-based output presentation
*
/*----- Revision history --------------------------------------------------*
*
* $Log: pres_curses.h,v $
- * Revision 1.1 1999/06/02 16:53:36 mdw
- * Initial revision
+ * Revision 1.2 1999/07/16 12:49:58 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:36 mdw
+ * Initial import.
*
*/
extern int curses_ok(void);
extern int curses_init(archcons */*a*/);
extern void curses_output(archent */*e*/, const char */*p*/, size_t /*sz*/);
-extern void curses_close(archent */*e*/, int /*ok*/);
+extern void curses_close(archent */*e*/, int /*ok*/, const char */*summ*/);
extern void curses_done(archcons */*a*/);
extern void curses_abort(archcons */*a*/);
/* -*-c-*-
*
- * $Id: pres_plain.c,v 1.1 1999/06/02 16:53:35 mdw Exp $
+ * $Id: pres_plain.c,v 1.2 1999/07/16 12:49:59 mdw Exp $
*
* Plain output style for remote builds
*
/*----- Revision history --------------------------------------------------*
*
* $Log: pres_plain.c,v $
- * Revision 1.1 1999/06/02 16:53:35 mdw
- * Initial revision
+ * Revision 1.2 1999/07/16 12:49:59 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:35 mdw
+ * Initial import.
*
*/
/* --- @plain_close@ --- */
-void plain_close(archent *e, int ok)
+void plain_close(archent *e, int ok, const char *summ)
{
lbuf_close(e->pres);
+ if (!ok)
+ printf("%s: %s\n", e->arch, summ);
}
/* --- @plain_done@ --- */
/* -*-c-*-
*
- * $Id: pres_plain.h,v 1.1 1999/06/02 16:53:35 mdw Exp $
+ * $Id: pres_plain.h,v 1.2 1999/07/16 12:49:59 mdw Exp $
*
* Plain output style for remote builds
*
/*----- Revision history --------------------------------------------------*
*
* $Log: pres_plain.h,v $
- * Revision 1.1 1999/06/02 16:53:35 mdw
- * Initial revision
+ * Revision 1.2 1999/07/16 12:49:59 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:35 mdw
+ * Initial import.
*
*/
extern int plain_init(archcons */*a*/);
extern void plain_output(archent */*e*/, const char */*p*/, size_t /*sz*/);
-extern void plain_close(archent */*e*/, int /*ok*/);
+extern void plain_close(archent */*e*/, int /*ok*/, const char */*summ*/);
extern void plain_done(archcons */*a*/);
#ifdef PRES_LINK
/* -*-c-*-
*
- * $Id: sw_build.c,v 1.1 1999/06/02 16:53:34 mdw Exp $
+ * $Id: sw_build.c,v 1.2 1999/07/16 12:50:24 mdw Exp $
*
* Management of build processes
*
/*----- Revision history --------------------------------------------------*
*
* $Log: sw_build.c,v $
- * Revision 1.1 1999/06/02 16:53:34 mdw
- * Initial revision
+ * Revision 1.2 1999/07/16 12:50:24 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:34 mdw
+ * Initial import.
*
*/
int ok = 1;
if (r->sz != 1) {
r->buf[r->sz] = 0;
- dstr_putf(&d, "\nTerminated by signal: %s.\n", r->buf);
+ dstr_putf(&d, "failed (%s)", r->buf);
ok = 0;
rc = 1;
} else if (r->buf[0]) {
- dstr_putf(&d, "\nExited with status %u.\n",
- (unsigned char)r->buf[0]);
+ dstr_putf(&d, "failed (status %u)", (unsigned char)r->buf[0]);
ok = 0;
rc = 1;
- } else if (opt_flags & optFlag_install)
- e->flags |= archFlag_built;
- if (d.len)
- p->output(e, d.buf, d.len);
- dstr_destroy(&d);
+ } else {
+ dstr_puts(&d, "finished");
+ if (opt_flags & optFlag_install)
+ e->flags |= archFlag_built;
+ }
if (p->close)
- p->close(e, ok);
+ p->close(e, ok, d.buf);
+ dstr_destroy(&d);
FD_CLR(r->fdin, &fdin);
close(r->fdin);
active--;
} break;
case PKTYPE_EOF: {
- const static char msg[] = "\nUnexpected exit.\n";
- p->output(e, msg, sizeof(msg) - 1);
if (p->close)
- p->close(e, 0);
+ p->close(e, 0, "unexpected exit");
rc = 1;
FD_CLR(r->fdin, &fdin);
close(r->fdin);
p->abort(a);
switch (exc_type) {
case EXC_ERRNO:
- die(1, "unexpected error: %s", exc_i);
+ die(1, "unexpected error: %s", strerror(exc_i));
break;
default:
RETHROW;
/* -*-c-*-
*
- * $Id: sw_build.h,v 1.1 1999/06/02 16:53:35 mdw Exp $
+ * $Id: sw_build.h,v 1.2 1999/07/16 12:50:24 mdw Exp $
*
* Management of build processes
*
/*----- Revision history --------------------------------------------------*
*
* $Log: sw_build.h,v $
- * Revision 1.1 1999/06/02 16:53:35 mdw
- * Initial revision
+ * Revision 1.2 1999/07/16 12:50:24 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:35 mdw
+ * Initial import.
*
*/
* otherwise. (A message describing the failure will have been
* synthetically output before this point, so only a small visual cue is
* needed here.) A zero value means this handler is not interested in
- * close events.
+ * close events. The argument @summ@ is a quick summary of the exit
+ * status.
*
* * @done@ informs the handler that all builds have completed. The handler
* should make sure that the display will remain as long as is needed, and
int (*ok)(void);
int (*init)(archcons */*a*/);
void (*output)(archent */*e*/, const char */*p*/, size_t /*sz*/);
- void (*close)(archent */*e*/, int /*ok*/);
+ void (*close)(archent */*e*/, int /*ok*/, const char */*summ*/);
void (*done)(archcons */*a*/);
void (*abort)(archcons */*a*/);
} pres;