pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pbulk/files/pbulk/pbuild Improve verbose mode:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c2cba104bea2
branches:  trunk
changeset: 539021:c2cba104bea2
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Sun Feb 24 15:35:42 2008 +0000

description:
Improve verbose mode:
- sprinkle whitespace so pkgnames get neatly aligned
- prepend a progress counter to printfs

diffstat:

 pkgtools/pbulk/files/pbulk/pbuild/jobs.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r a737b633b6a5 -r c2cba104bea2 pkgtools/pbulk/files/pbulk/pbuild/jobs.c
--- a/pkgtools/pbulk/files/pbulk/pbuild/jobs.c  Sun Feb 24 05:29:35 2008 +0000
+++ b/pkgtools/pbulk/files/pbulk/pbuild/jobs.c  Sun Feb 24 15:35:42 2008 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: jobs.c,v 1.7 2007/11/30 17:31:38 rillig Exp $ */
+/* $NetBSD: jobs.c,v 1.8 2008/02/24 15:35:42 tnn Exp $ */
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -71,6 +71,7 @@
        time_t now;
        va_list ap;
        char buf[512];
+       struct build_stat st;
 
        if (verbosity >= 2) {
                now = time(NULL);
@@ -81,6 +82,12 @@
                (void)printf("%s ", buf);
        }
 
+       if (verbosity >= 1) {
+               build_stats(&st);
+               printf("[%lu/%lu] ", (unsigned long)len_jobs - st.open_jobs,
+                   (unsigned long)len_jobs);
+       }
+
        va_start(ap, fmt);
        (void)vprintf(fmt, ap);
        va_end(ap);
@@ -432,7 +439,7 @@
                        free(buf);
                }
                if (verbosity >= 1)
-                       ts_printf("Failed to build %s\n", job->pkgname);
+                       ts_printf("Failed to build    %s\n", job->pkgname);
                /* FALLTHROUGH */
        case JOB_INDIRECT_FAILED:
                recursive_mark_broken(job, JOB_INDIRECT_FAILED);
@@ -444,7 +451,7 @@
                break;
        case JOB_IN_PROCESSING:
                if (verbosity >= 1)
-                       ts_printf("Starting build of %s\n", job->pkgname);
+                       ts_printf("Starting build of  %s\n", job->pkgname);
                break;
        case JOB_OPEN:
                if (job->open_depends == 0)



Home | Main Index | Thread Index | Old Index