From pa.dec.com!decwrl!uunet!sparky!kent Sat Mar 2 14:16:06 PST 1991 Article: 2065 of comp.sources.misc Path: pa.dec.com!decwrl!uunet!sparky!kent From: fmc@cnam.cnam.fr (Frederic Chauveau) Newsgroups: comp.sources.misc Subject: v17i010: news_split1.6 - News to Archive, Patch01 Message-ID: <1991Feb22.014201.14663@sparky.IMD.Sterling.COM> Date: 22 Feb 91 01:42:01 GMT Sender: kent@sparky.IMD.Sterling.COM (Kent Landfield) Organization: Sterling Software, IMD Lines: 197 Approved: kent@sparky.imd.sterling.com X-Checksum-Snefru: cc47ce3e 40c2a21b f568026b ebff0a28 Submitted-by: Frederic Chauveau Posting-number: Volume 17, Issue 10 Archive-name: news_split1.6/patch01 Patch-To: news_split1.6: Volume 17, Issue 1 Some people asked me to provide a means to archive the files in compressed format. Here are the diffs to do it. The main change is to #define COMPRESS "compress" (or whatever your compress program is called) and recompile the new version. If compress doesn't reside in your path, #define COMPRESS "/whatever/directory/compress". The rest of this article should be unshared and fed to the patch program. Frederic Chauveau ---- Cut Here and unpack ---- #!/bin/sh # This is news_split patch 1, a shell archive (shar 3.32) # made 02/21/1991 15:12 UTC by fmc@cnam.cnam.fr # Source directory /users/labinf/fmc/tools/news_split/v1.6 # # existing files will NOT be overwritten # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 3635 -rw-r--r-- diffs # if touch 2>&1 | fgrep 'amc' > /dev/null then TOUCH=touch else TOUCH=true fi # ============= diffs ============== if test X"$1" != X"-c" -a -f 'diffs'; then echo "File already exists: skipping 'diffs'" else echo "x - extracting diffs (Text)" sed 's/^X//' << 'SHAR_EOF' > diffs && Xdiff -c ./INSTALL ../v1.7/INSTALL X*** ./INSTALL Thu Feb 21 15:02:30 1991 X--- ../v1.7/INSTALL Thu Feb 21 15:14:46 1991 X*************** X*** 1,4 **** X! news_split Version 1.6 Bugs, Gripes, etc... to fmc@cnam.cnam.fr X Last Modification: 12 Feb 91 X X Before compiling, check to see if the default values for the following X--- 1,4 ---- X! news_split Version 1.7 Bugs, Gripes, etc... to fmc@cnam.cnam.fr X Last Modification: 12 Feb 91 X X Before compiling, check to see if the default values for the following X*************** X*** 19,24 **** X--- 19,30 ---- X A log file for comp.sources.misc will be created as : X LOGDIR/comp.sources.misc/Index.ns X X+ - COMPRESS undefined X+ A compression programm (like compress). If you want the article saved X+ in compressed format, you should X+ #define COMPRESS "compress" or X+ #define COMPRESS "/some/place/not/in/current/PATH/compress" X+ if COMPRESS is left undefined, articles will be saved in plain text format. X X Compilation options and caveats : X Xdiff -c ./Makefile ../v1.7/Makefile X*** ./Makefile Thu Feb 21 15:02:22 1991 X--- ../v1.7/Makefile Thu Feb 21 16:10:39 1991 X*************** X*** 2,7 **** X--- 2,9 ---- X X # for system with no scandir function add -DNOSCANDIR to CFLAGS X # for system with no file, add -dNOUNISTD to CFLAGS X+ # if you want to save in compressed format add X+ # -DCOMPRESS=\"compress\" to CFLAGS X X CFLAGS = -O X Xdiff -c ./README ../v1.7/README X*** ./README Thu Feb 21 15:02:27 1991 X--- ../v1.7/README Thu Feb 21 15:14:45 1991 X*************** X*** 1,5 **** X /* X! * news_split [fmc] 09/02/91 Version 1.6 X * Browse a given NewsGroup (usualy comp.sources.??? X * and try to update/maintain a directory for the X * sources found in it. X--- 1,5 ---- X /* X! * news_split [fmc] 09/02/91 Version 1.7 X * Browse a given NewsGroup (usualy comp.sources.??? X * and try to update/maintain a directory for the X * sources found in it. Xdiff -c ./news_split.c ../v1.7/news_split.c X*** ./news_split.c Thu Feb 21 15:02:18 1991 X--- ../v1.7/news_split.c Thu Feb 21 15:14:45 1991 X*************** X*** 1,5 **** X /* X! * news_split [fmc] 09/02/91 Version 1.6 X * Browse a given NewsGroup (usualy comp.sources.??? X * and try to update/maintain a directory for the X * sources found in it. X--- 1,5 ---- X /* X! * news_split [fmc] 20/02/91 Version 1.7 X * Browse a given NewsGroup (usualy comp.sources.??? X * and try to update/maintain a directory for the X * sources found in it. X*************** X*** 107,112 **** X--- 107,115 ---- X } X if (!infile) X return; X+ #ifdef COMPRESS X+ strcat(dirname,".Z"); X+ #endif X if (access(dirname,F_OK) != -1) X { X fprintf(stderr," Warning: %s %s\n", X*************** X*** 116,122 **** X--- 119,130 ---- X if (!Supercede_P) X return; X } X+ #ifdef COMPRESS X+ sprintf(buf,"%s > %s",COMPRESS,dirname); /* .Z already tacked at the end */ X+ outfile = popen(buf,"w"); X+ #else X outfile = fopen(dirname,"w"); X+ #endif X if (!outfile) X { X FILE *foo = stderr; X*************** X*** 130,136 **** X--- 138,148 ---- X rewind(infile); X while (fgets(buf,BUFSIZ,infile)) X fputs(buf,outfile); X+ #ifdef COMPRESS X+ pclose(outfile); X+ #else X fclose(outfile); X+ #endif X } X } X X*************** X*** 299,305 **** X X main(argc,argv) X char **argv; { X! FILE *from_file; X char cwd[BUFSIZ], *pname = *argv; X X getcwd(cwd,BUFSIZ); X--- 311,317 ---- X X main(argc,argv) X char **argv; { X! FILE *from_file = NULL; X char cwd[BUFSIZ], *pname = *argv; X X getcwd(cwd,BUFSIZ); SHAR_EOF $TOUCH -am 0221161191 diffs && chmod 0644 diffs || echo "restore of diffs failed" set `wc -c diffs`;Wc_c=$1 if test "$Wc_c" != "3635"; then echo original size 3635, current size $Wc_c fi fi exit 0 [fmc] ------------------------------------------------------------------------------- Frederic Chauveau Conservatoire National des Arts et Metiers fmc@cnam.cnam.fr ------------------------------------------------------------------------------- Paradise is exactly like where you are right now, only much, much better. William S. Burroughs ------------------------------------------------------------------------------- exit 0 # Just in case... -- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM Sterling Software, IMD UUCP: uunet!sparky!kent Phone: (402) 291-8300 FAX: (402) 291-4362 Please send comp.sources.misc-related mail to kent@uunet.uu.net.