Date: Tue, 30 Oct 2007 05:14:54 +0000 From: Thomas Hurst <tom.hurst@clara.net> To: Jeremy Chadwick <koitsu@FreeBSD.org> Cc: Giorgos Keramidas <keramida@ceid.upatras.gr>, Andrew Lankford <lankfordandrew@charter.net>, stable@freebsd.org, current@freebsd.org Subject: Re: /usr/share/man/man8/MAKEDEV.8 Message-ID: <20071030051454.GB76585@voi.aagh.net> In-Reply-To: <20071029191836.GA58058@eos.sc1.parodius.com> References: <47240A15.8080305@charter.net> <20071028074248.GA1511@haakonia.hitnet.RWTH-Aachen.DE> <alpine.BSF.0.9999.0710280131220.2400@qbhto.arg> <4724BAD9.7000400@charter.net> <20071028164152.GA7516@eos.sc1.parodius.com> <E1ImBHh-000OiV-Mc@cs1.cs.huji.ac.il> <4724BEB3.5080905@charter.net> <20071029132447.GA2658@kobe.laptop> <20071029191836.GA58058@eos.sc1.parodius.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071030051454.GB76585>