dml@rabbit1.UUCP (David Langdon) (10/27/86)
We have (at times) needed to store news in different directory paths due to space limitations. Enclosed is an update to vn to allow searching and retrieving news from an alternate storage directory path. The changes can be applied using the patch facility which was posted earlier on the net (NOTE: changes are in diff -c format) Good luck .. Dave Langdon ----------------------- CUT HERE ---------------------------------------------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # README # config.h.diff # groupdir.c.dif # pagefile.c.dif # This archive created: Mon Oct 27 11:38:19 1986 export PATH; PATH=/bin:$PATH echo shar: extracting "'README'" '(282 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^ X//' << \SHAR_EOF > 'README' XAfter applying the enclosed patches, you should: X X 1) Change the config.h file as needed to specify the proper X paths for your system. X 2) Change the ASPOOLDIR path to the alternate search path for X news if necessary in config.h. X 3) Recompile vn. X XGood luck... Dave Langdon X SHAR_EOF if test 282 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 282 characters)' fi fi # end of overwriting check echo shar: extracting "'config.h.diff'" '(340 characters)' if test -f 'config.h.diff' then echo shar: will not over-write existing file "'config.h.diff'" else sed 's/^ X//' << \SHAR_EOF > 'config.h.diff' X*** config.h Mon Oct 27 10:49:33 1986 X--- old/config.h Mon Oct 27 10:47:21 1986 X*************** X*** 21,25 X X #define SPOOLDIR "/usr/netnews/spool" X #define ACTFILE "/usr/netnews/lib/active" X- X- #define ASPOOLDIR "/usr/netnews/spool" X X--- 21,23 ----- X X #define SPOOLDIR "/usr/netnews/spool" X #define ACTFILE "/usr/netnews/lib/active" SHAR_EOF if test 340 -ne "`wc -c < 'config.h.diff'`" then echo shar: error transmitting "'config.h.diff'" '(should have been 340 characters)' fi fi # end of overwriting check echo shar: extracting "'groupdir.c.dif'" '(1668 characters)' if test -f 'groupdir.c.dif' then echo shar: will not over-write existing file "'groupdir.c.dif'" else sed 's/^ X//' << \SHAR_EOF > 'groupdir.c.dif' X*** groupdir.c Wed Sep 24 15:24:11 1986 X--- old/groupdir.c Sat Sep 6 11:27:19 1986 X*************** X*** 7,14 X /* X g_dir converts newsgroup name to directory string X */ X! g_dir(dir,s,t) X! char *dir,*s,*t; X { X char *ptr, *index(); X sprintf (t,"%s/%s",dir,s); X X--- 7,14 ----- X /* X g_dir converts newsgroup name to directory string X */ X! g_dir(s,t) X! char *s,*t; X { X char *ptr, *index(); X sprintf (t,"%s/%s",SPOOLDIR,s); X*************** X*** 11,18 X char *dir,*s,*t; X { X char *ptr, *index(); X! sprintf (t,"%s/%s",dir,s); X! for (ptr=t+strlen(dir)+1; (ptr = index(ptr,'.')) != NULL; *ptr = '/') X ; X } X X X--- 11,18 ----- X char *s,*t; X { X char *ptr, *index(); X! sprintf (t,"%s/%s",SPOOLDIR,s); X! for (ptr=t+strlen(SPOOLDIR)+1; (ptr = index(ptr,'.')) != NULL; *ptr = '/') X ; X } X X*************** X*** 23,29 X cd_group () X { X char dbuf [RECLEN]; X! g_dir (SPOOLDIR,(Page.h.group)->nd_name,dbuf); X if (chdir(dbuf) < 0) X { X g_dir (ASPOOLDIR,(Page.h.group)->nd_name,dbuf); X X--- 23,29 ----- X cd_group () X { X char dbuf [RECLEN]; X! g_dir ((Page.h.group)->nd_name,dbuf); X if (chdir(dbuf) < 0) X { X Page.h.artnum = 1; X*************** X*** 26,37 X g_dir (SPOOLDIR,(Page.h.group)->nd_name,dbuf); X if (chdir(dbuf) < 0) X { X! g_dir (ASPOOLDIR,(Page.h.group)->nd_name,dbuf); X! if (chdir(dbuf) < 0) X! { X! Page.h.artnum = 1; X! Page.b[0].art_id = 0; X! strcpy (Page.b[0].art_t, "CANNOT FIND NEWSGROUP"); X! } X } X } X X--- 26,33 ----- X g_dir ((Page.h.group)->nd_name,dbuf); X if (chdir(dbuf) < 0) X { X! Page.h.artnum = 1; X! Page.b[0].art_id = 0; X! strcpy (Page.b[0].art_t, "CANNOT FIND NEWSGROUP"); X } X } SHAR_EOF if test 1668 -ne "`wc -c < 'groupdir.c.dif'`" then echo shar: error transmitting "'groupdir.c.dif'" '(should have been 1668 characters)' fi fi # end of overwriting check echo shar: extracting "'pagefile.c.dif'" '(1305 characters)' if test -f 'pagefile.c.dif' then echo shar: will not over-write existing file "'pagefile.c.dif'" else sed 's/^ X//' << \SHAR_EOF > 'pagefile.c.dif' X*** pagefile.c Wed Sep 24 15:24:11 1986 X--- old/pagefile.c Sat Sep 6 11:27:21 1986 X*************** X*** 3,9 X #include <sys/file.h> X #include "vn.h" X #include "head.h" X- #include "config.h" X X extern int Nfltr,Ncount,Lrec,L_allow,Cur_page,C_allow; X extern FILTER Filter[]; X X--- 3,8 ----- X #include <sys/file.h> X #include "vn.h" X #include "head.h" X X extern int Nfltr,Ncount,Lrec,L_allow,Cur_page,C_allow; X extern FILTER Filter[]; X*************** X*** 51,57 X { X int i,aid; X char title[RECLEN],gd[RECLEN]; X! g_dir(SPOOLDIR,s,gd); X if (chdir(gd) < 0) X { X g_dir(ASPOOLDIR,s,gd); X X--- 50,56 ----- X { X int i,aid; X char title[RECLEN],gd[RECLEN]; X! g_dir(s,gd); X if (chdir(gd) < 0) X { X grp_indic(s,0); X*************** X*** 54,65 X g_dir(SPOOLDIR,s,gd); X if (chdir(gd) < 0) X { X! g_dir(ASPOOLDIR,s,gd); X! if (chdir(gd) < 0) X! { X! grp_indic(s,0); X! return; X! } X } X grp_indic(s,1); X aid = 0; X X--- 53,60 ----- X g_dir(s,gd); X if (chdir(gd) < 0) X { X! grp_indic(s,0); X! return; X } X grp_indic(s,1); X aid = 0; X*************** X*** 100,106 X { X long off,lseek(); X int i,last; X- X Cur_page = n; X off = Pgsize; X off *= (long) n; X X--- 95,100 ----- X { X long off,lseek(); X int i,last; X Cur_page = n; X off = Pgsize; X off *= (long) n; SHAR_EOF if test 1305 -ne "`wc -c < 'pagefile.c.dif'`" then echo shar: error transmitting "'pagefile.c.dif'" '(should have been 1305 characters)' fi fi # end of overwriting check # End of shell archive exit 0 -- David Langdon Rabbit Software Corp. (215) 647-0440 7 Great Valley Parkway East Malvern PA 19355 ...!ihnp4!{cbmvax,cuuxb}!hutch!dml ...!psuvax1!burdvax!hutch!dml