From owner-freebsd-current@FreeBSD.ORG Tue Oct 30 05:53:16 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94E0A16A41A; Tue, 30 Oct 2007 05:53:16 +0000 (UTC) (envelope-from tom.hurst@clara.net) Received: from spork.qfe3.net (spork.qfe3.net [212.13.207.101]) by mx1.freebsd.org (Postfix) with ESMTP id 3617A13C4B7; Tue, 30 Oct 2007 05:53:16 +0000 (UTC) (envelope-from tom.hurst@clara.net) Received: from [81.104.144.87] (helo=voi.aagh.net) by spork.qfe3.net with esmtp (Exim 4.66 (FreeBSD)) (envelope-from ) id 1ImjRG-000Owx-HQ; Tue, 30 Oct 2007 05:14:54 +0000 Received: from freaky by voi.aagh.net with local (Exim 4.68 (FreeBSD)) (envelope-from ) id 1ImjRG-0001Q9-Ae; Tue, 30 Oct 2007 05:14:54 +0000 Date: Tue, 30 Oct 2007 05:14:54 +0000 From: Thomas Hurst To: Jeremy Chadwick Message-ID: <20071030051454.GB76585@voi.aagh.net> Mail-Followup-To: Jeremy Chadwick , Giorgos Keramidas , Andrew Lankford , stable@freebsd.org, current@freebsd.org References: <47240A15.8080305@charter.net> <20071028074248.GA1511@haakonia.hitnet.RWTH-Aachen.DE> <4724BAD9.7000400@charter.net> <20071028164152.GA7516@eos.sc1.parodius.com> <4724BEB3.5080905@charter.net> <20071029132447.GA2658@kobe.laptop> <20071029191836.GA58058@eos.sc1.parodius.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20071029191836.GA58058@eos.sc1.parodius.com> Organization: Not much. User-Agent: Mutt/1.5.16 (2007-06-09) Sender: Thomas Hurst Cc: Giorgos Keramidas , Andrew Lankford , stable@freebsd.org, current@freebsd.org Subject: Re: /usr/share/man/man8/MAKEDEV.8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2007 05:53:16 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Jeremy Chadwick (koitsu@FreeBSD.org) wrote: > There's a periodic script (/etc/periodic/weekly/330.catman) which > rebuilds all the catman pages for you. However, it makes an immense > mess of your weekly system mails due to all the manpage/nroff > formatting mistakes. Have a look: > > http://lists.freebsd.org/pipermail/freebsd-ports/2007-May/040648.html If you want to find what's causing these errors, you could run catman with -v so it prints the filename of what it's processing. Less spammy but still noisy in the event of these warnings would be something like the attached patch, which saves the stderr stream and prints it and the currently processed filename if it's non-empty. Maybe friendlier would be the other patch, which silences nroff unless catman is running verbose. -- Thomas 'Freaky' Hurst http://hur.st/ --XsQoSWH+UP9D9v3l Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="catman-detect-warnings.diff" --- catman.c.orig 2007-10-30 04:43:52.000000000 +0000 +++ catman.c 2007-10-30 04:45:35.000000000 +0000 @@ -403,6 +403,10 @@ dev_t src_dev; ino_t src_ino; const char *link_name; + struct stat err_st; + char err_file[MAXPATHLEN]; + int err_fd; + char err_buf[1024]; src_test = test_path(src, &src_mtime); if (!(src_test & (TEST_FILE|TEST_READABLE))) { @@ -447,13 +451,33 @@ } snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat); snprintf(cmd, sizeof cmd, - "%scat %s | tbl | nroff -T%s -man | col | %s > %s.tmp", + "%scat %s | tbl | nroff -T%s -man 2>%s.err | col | %s > %s.tmp", zipped == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "", - src, nroff_device, + src, nroff_device, cat, zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat", cat); if (system(cmd) != 0) err(1, "formatting pipeline"); + + snprintf(err_file, sizeof err_file, "%s.err", cat); + if (stat(err_file, &err_st) < 0) + warn("%s", err_file); + else if (err_st.st_size > 0) + { + fprintf(stderr, "nroff formatting errors in %s:\n", src); + if ((err_fd = open(err_file, O_RDONLY)) < 0) + warn("%s", err_file); + else + { + while (read(err_fd, &err_buf, sizeof err_buf) > 0) + fprintf(stderr, "%s", err_buf); + + close(err_fd); + } + } + if (unlink(err_file) < 0) + warn("%s", err_file); + if (rename(tmp_file, cat) < 0) warn("%s", cat); tmp_file[0] = '\0'; --XsQoSWH+UP9D9v3l Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="catman-quiet.diff" --- catman.c 2007-10-30 05:05:04.000000000 +0000 +++ catman.c.orig 2007-10-30 04:43:52.000000000 +0000 @@ -447,9 +447,9 @@ } snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat); snprintf(cmd, sizeof cmd, - "%scat %s | tbl | nroff -T%s -man %s| col | %s > %s.tmp", + "%scat %s | tbl | nroff -T%s -man | col | %s > %s.tmp", zipped == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "", - src, nroff_device, verbose ? "" : "2>/dev/null", + src, nroff_device, zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat", cat); if (system(cmd) != 0) --XsQoSWH+UP9D9v3l--