Subject: zcat, uncompress, compress, gzip fix
To: None <current-users@netbsd.org>
From: None <JUENGST@saph2.physik.uni-bonn.de>
List: current-users
Date: 09/18/1994 22:24:21
Hello,

  I just had a problem with zcat and a compressed file which includes
a ' in its name. Zcat.sh uses $* ...

I removed it, removed the installation procedure for zcat and uncompress in
the compress Makefile, removed the remarks in the gzip Makefile to get zcat
and uncompress linked onto gzip, modified the compress man pages, added the
missing -d option in the compress man pages, added a prototype for zopen
and made a little test (gunzip against compress -d).

BTW, a long time ago somebody made some jokes about the AT&T copyright
notice and number of revisions in true. Well, have a look into zcat.sh :-)

Henry
===========================================================================
/tmp# cp /netbsd .
/tmp# compress netbsd 
/tmp# time gunzip netbsd.Z 
4.824u 0.319s 0:05.84 87.8% 0+0k 47+75io 0pf+0w
/tmp# cp /netbsd .
/tmp# compress netbsd 
/tmp# time compress -d netbsd.Z 
6.982u 0.378s 0:07.97 92.2% 0+0k 40+69io 0pf+0w
/tmp# ls -la netbsd 
-rw-r-----  1 root  wheel  957003 Sep 18 21:51 netbsd
/tmp# compress netbsd 
/tmp# ls -la netbsd.Z 
-rw-r-----  1 root  wheel  653071 Sep 18 21:51 netbsd.Z
---------------------------------------------------------------------------
#!/bin/sh
rm -f /usr/src/usr.bin/compress/zcat.sh
---------------------------------------------------------------------------
*** /usr/src/usr.bin/compress/Makefile.orig	Tue Jun 14 12:30:15 1994
--- /usr/src/usr.bin/compress/Makefile	Sun Sep 18 21:05:59 1994
***************
*** 3,13 ****
  
  PROG=	compress
  SRCS=	compress.c zopen.c
- LINKS=	${BINDIR}/compress ${BINDIR}/uncompress
- MLINKS=	compress.1 uncompress.1 compress.1 zcat.1
- 
- afterinstall:
- 	install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- 	    ${.CURDIR}/zcat.sh ${DESTDIR}/usr/bin/zcat
  
  .include <bsd.prog.mk>
--- 3,7 ----
*** /usr/src/usr.bin/compress/compress.1.orig	Tue Jun 14 12:30:15 1994
--- /usr/src/usr.bin/compress/compress.1	Sun Sep 18 21:16:26 1994
***************
*** 40,59 ****
  .Dt COMPRESS 1
  .Os BSD 4.3
  .Sh NAME
! .Nm compress ,
! .Nm uncompress ,
! .Nm zcat
  .Nd compress and expand data
  .Sh SYNOPSIS
  .Nm compress
! .Op Fl cfv
  .Op Fl b Ar bits
  .Op Ar
- .Nm uncompress
- .Op Fl cfv
- .Op Ar 
- .Nm zcat
- .Op Ar
  .Sh DESCRIPTION
  .Nm Compress
  reduces the size of the named files using adaptive Lempel-Ziv coding.
--- 40,52 ----
  .Dt COMPRESS 1
  .Os BSD 4.3
  .Sh NAME
! .Nm compress
  .Nd compress and expand data
  .Sh SYNOPSIS
  .Nm compress
! .Op Fl cdfv
  .Op Fl b Ar bits
  .Op Ar
  .Sh DESCRIPTION
  .Nm Compress
  reduces the size of the named files using adaptive Lempel-Ziv coding.
***************
*** 99,104 ****
--- 92,99 ----
  .It Fl c
  Compressed or uncompressed output is written to the standard output.
  No files are modified.
+ .It Fl d
+ Uncompress the input file.
  .It Fl f
  Force compression of
  .Ar file ,
***************
*** 158,163 ****
--- 153,159 ----
  .Nm compress
  utility exits 0 on success, and >0 if an error occurs.
  .Sh SEE ALSO
+ .Xr gzip 1
  .Rs
  .%A Welch, Terry A.
  .%D June, 1984
*** /usr/src/usr.bin/compress/compress.c.orig	Tue Jun 14 12:30:15 1994
--- /usr/src/usr.bin/compress/compress.c	Sun Sep 18 21:34:09 1994
***************
*** 59,64 ****
--- 59,66 ----
  #include <varargs.h>
  #endif
  
+ #include "zopen_proto.h"
+ 
  void	compress __P((char *, char *, int));
  void	cwarn __P((const char *, ...));
  void	cwarnx __P((const char *, ...));
*** /usr/src/usr.bin/compress/zopen.c.orig	Mon Jun 13 16:48:44 1994
--- /usr/src/usr.bin/compress/zopen.c	Sun Sep 18 21:33:14 1994
***************
*** 73,78 ****
--- 73,80 ----
  #include <string.h>
  #include <unistd.h>
  
+ #include "zopen_proto.h"
+ 
  #define	BITS		16		/* Default bits. */
  #define	HSIZE		69001		/* 95% occupancy */
  
***************
*** 692,700 ****
  }
  
  FILE *
! zopen(fname, mode, bits)
! 	const char *fname, *mode;
! 	int bits;
  {
  	struct s_zstate *zs;
  
--- 694,700 ----
  }
  
  FILE *
! zopen(const char *fname,const char *mode,const int bits)
  {
  	struct s_zstate *zs;
  
*** /dev/null	Sun Sep 18 16:40:00 1994
--- /usr/src/usr.bin/compress/zopen_proto.h	Sun Sep 18 21:31:53 1994
***************
*** 0 ****
--- 1,8 ----
+ #ifndef _ZOPEN_PROTO_H_
+ #  define _ZOPEN_PROTO_H_
+ 
+ #  include <stdio.h>
+ 
+ FILE *zopen(const char *fname,const char *mode,const int bits);
+ 
+ #endif
*** /usr/src/gnu/usr.bin/gzip/Makefile.orig	Tue Jun 21 12:11:05 1994
--- /usr/src/gnu/usr.bin/gzip/Makefile	Sun Sep 18 21:48:20 1994
***************
*** 18,25 ****
  MLINKS= gzip.1 gunzip.1 gzip.1 gzcat.1 # gzip.1 uncompress.1 gzip.1 zcat.1
  LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip
  LINKS+= ${BINDIR}/gzip ${BINDIR}/gzcat
! #LINKS+= ${BINDIR}/gzip ${BINDIR}/uncompress
! #LINKS+= ${BINDIR}/gzip ${BINDIR}/zcat
  
  afterinstall:
  	install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
--- 18,25 ----
  MLINKS= gzip.1 gunzip.1 gzip.1 gzcat.1 # gzip.1 uncompress.1 gzip.1 zcat.1
  LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip
  LINKS+= ${BINDIR}/gzip ${BINDIR}/gzcat
! LINKS+= ${BINDIR}/gzip ${BINDIR}/uncompress
! LINKS+= ${BINDIR}/gzip ${BINDIR}/zcat
  
  afterinstall:
  	install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \

--
juengst@saph2.physik.uni-bonn.de   [131.220.221.12]  (internet)
juengst@boss1.physik.uni-bonn.de   [131.220.221.30]
saph2::juengst                     [13.259]          (decnet)

Any opinions in this mail are my own.