From owner-freebsd-bugs@FreeBSD.ORG Wed May 14 03:50:19 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B38BB37B404 for ; Wed, 14 May 2003 03:50:19 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 605D043FE5 for ; Wed, 14 May 2003 03:50:16 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h4EAoGUp014646 for ; Wed, 14 May 2003 03:50:16 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h4EAoGnj014645; Wed, 14 May 2003 03:50:16 -0700 (PDT) Resent-Date: Wed, 14 May 2003 03:50:16 -0700 (PDT) Resent-Message-Id: <200305141050.h4EAoGnj014645@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Krister Joas Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 200BE37B401 for ; Wed, 14 May 2003 03:47:11 -0700 (PDT) Received: from duronimo.local.gazonk.net (fw1.tcn-catv.ne.jp [219.109.192.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id E891643F85 for ; Wed, 14 May 2003 03:47:09 -0700 (PDT) (envelope-from krister@gazonk.net) Received: from yuri.local.gazonk.net (yuri.local.gazonk.net [192.168.0.2]) h4EAZI5L075085 for ; Wed, 14 May 2003 19:35:18 +0900 (JST) (envelope-from krister@duronimo.local.gazonk.net) Received: from yuri.local.gazonk.net (localhost [127.0.0.1]) by yuri.local.gazonk.net (8.12.9/8.12.9) with ESMTP id h4EAO6Bb063136 for ; Wed, 14 May 2003 19:24:06 +0900 (JST) (envelope-from krister@yuri.local.gazonk.net) Received: (from krister@localhost) by yuri.local.gazonk.net (8.12.9/8.12.9/Submit) id h4EAO5L5063135; Wed, 14 May 2003 19:24:05 +0900 (JST) Message-Id: <200305141024.h4EAO5L5063135@yuri.local.gazonk.net> Date: Wed, 14 May 2003 19:24:05 +0900 (JST) From: Krister Joas To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/52213: catman compresses with wrong program if source files are uncompressed X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Krister Joas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2003 10:50:20 -0000 >Number: 52213 >Category: bin >Synopsis: catman compresses with wrong program if source files are uncompressed >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed May 14 03:50:16 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Krister Joas >Release: FreeBSD 5.1-BETA i386 >Organization: Gazonk >Environment: System: FreeBSD yuri.local.gazonk.net 5.1-BETA FreeBSD 5.1-BETA #1: Sun May 11 23:38:06 JST 2003 root@yuri.local.gazonk.net:/usr/obj/usr/src/sys/YURI5 i386 >Description: If the system is installed with NOMANCOMPRESS=true in /etc/make.conf so that man pages are installed uncompressed, running catman results in unusable preformated files in the corresponding cat? directories. The files are compressed with bzip2 but with the extension .gz. When running 'man' the files fail to uncompress. >How-To-Repeat: Run catman on a directory with uncompressed man-pages. The files in the cat? directories are bzip2'ed with extension .gz: $ file cat1/write.1.gz cat1/write.1.gz: bzip2 compressed data, block size = 900k $ man write zcat: /home/krister/man/cat1/write.1.gz: not in gzip format >Fix: The following patch fixes catman so that if the source file is compressed the preformatted files are compressed with the same program as the source and if the source files are uncompressed the preformatted files are also uncompressed. Index: catman.c =================================================================== RCS file: /usr/cvs/freebsd/src/usr.bin/catman/catman.c,v retrieving revision 1.5 diff -u -r1.5 catman.c --- catman.c 29 Oct 2002 09:20:22 -0000 1.5 +++ catman.c 14 May 2003 10:06:09 -0000 @@ -461,9 +461,11 @@ } snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat); snprintf(cmd, sizeof cmd, - "%scat %s | tbl | nroff -T%s -man | col | %s -c > %s.tmp", + "%scat %s | tbl | nroff -T%s -man | col | %s > %s.tmp", zipped == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "", - src, nroff_device, zipped == GZIP ? GZ_CMD : BZ2_CMD, cat); + src, nroff_device, + zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat", + cat); if (system(cmd) != 0) err(1, "formatting pipeline"); if (rename(tmp_file, cat) < 0) @@ -541,8 +543,8 @@ "warning, %s is uncompressed\n", page_path); } - snprintf(cat_path, sizeof cat_path, "%s/%s%s", - cat_section, page_name, GZ_EXT); + snprintf(cat_path, sizeof cat_path, "%s/%s", + cat_section, page_name); if (expected != NULL) { asprintf(&expected[nexpected++], "%s%s", page_name, GZ_EXT); >Release-Note: >Audit-Trail: >Unformatted: