[comp.sources.misc] v17i022: rkive - Usenet sources archiver, Part06/06

kent@sparky.imd.sterling.com (Kent Landfield) (02/25/91)

Submitted-by: Kent Landfield <kent@sparky.imd.sterling.com>
Posting-number: Volume 17, Issue 22
Archive-name: rkive/part06

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
#		"End of archive 6 (of 6)."
# Contents:  rkive/IDEAS rkive/MANIFEST rkive/cfg.h rkive/ckconfig.1
#   rkive/disp_grp.c rkive/efopen.c rkive/makedir.c rkive/patchlevel.h
#   rkive/port/dirent.h rkive/port/getopt.c rkive/record_arc.c
#   rkive/str.c rkive/suffix.c rkive/suffix.h rkive/t.cf
#   rkive/update_netdocs rkive/version.c rkive/zfopen.c
# Wrapped by kent@sparky on Sun Feb 24 16:11:23 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'rkive/IDEAS' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/IDEAS'\"
else
echo shar: Extracting \"'rkive/IDEAS'\" \(2840 characters\)
sed "s/^X//" >'rkive/IDEAS' <<'END_OF_FILE'
X@(#)IDEAS	2.1 2/21/91
XWhat follows is my ideas file. It gives you a glimse into some enhancements,
Xideas, problems and work in progress for rkive. This is a minimal list but
Xit will grow after you send me your good ideas. :-)
X
X1.  If a posting should replace the current entry it is the moderator's
X    responsibility to Supersedes: any invalid postings.  rkive should
X    be able to handle Supersedes. Currently it does not. Usually used in
X    a reposting.
X
X2.  Add Support For Multiple Archive Formats. 
X    Have rkive link the files into a different archiving format.
X    All articles should be storable in *as many* of the user-requested 
X    formats as possible.  
X
X3.  Add a Configure.sh to handle configuration of default parameters 
X    and to setup the software.
X
X4.  Better and more extensive documentation as well as documentation
X    that explains archiving in general.
X
X6.  An application that would allow retrieval requests from the archives 
X    by reading the rkive.cf file to determine the location of the 
X    newsgroup's archive and to retrieve packages by any of the archive
X    methods.  This may end up using software like narc to actually do
X    the unpacking for the requester. This too is just an idea now...
X
X7.  An application that would allow retrieval requests from the archives 
X    for patches or entire packages including all posted patches. This is
X    still currently in progress... :-) The mythical "random downloader" :-)
X
X8.  Have rkive be able to handle crosspostings intelligently instead of
X    making to copies of the article as it does now.
X
X9.  Changes needed to prevent the attempted compression of articles
X     whose basenames are longer than 12 characters on systems that support
X     only 14 character file names.
X
X10.  Why not make the archive types specified by a table then it would be easy 
X     to add extra types. Surely the more the merry.
X
X11.  Ta-rkive - have rkive feed the articles to be archived into tar
X     by printing the article on stdout so that rkive -T | tar cvf - > date.tar
X     could be used for putting the articles on to tape. tarkive would be
X     an application that does only the article reading and taring.
X
X12.  Allow for directory modes in the .cf file.
X
X13.  Program to clean up the INDEX file and move the sources to tape.
X
X14.  Use the posted date for chronological archiving instead of the 
X     archived date.
X
X15. Mail on error only.
X
X16. Add a selection control-character which gives the local system article 
X    number to put in 'log' and 'index'.  Would help if one runs into trouble. 
X
XWell that's the direction I am heading... If you have *any* additional
Xideas that are constructive, positive or negative (flames to /nev/dull)
XI will be glad to hear from you. 
X
X		Good luck and Happy archiving...:-)
X			kent@sparky.imd.sterling.com
X			sparky!kent
END_OF_FILE
if test 2840 -ne `wc -c <'rkive/IDEAS'`; then
    echo shar: \"'rkive/IDEAS'\" unpacked with wrong size!
fi
# end of 'rkive/IDEAS'
fi
if test -f 'rkive/MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/MANIFEST'\"
else
echo shar: Extracting \"'rkive/MANIFEST'\" \(2791 characters\)
sed "s/^X//" >'rkive/MANIFEST' <<'END_OF_FILE'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X Changes                    1   General description of changes in each version.
X IDEAS                      1	Contains future improvement ideas.
X MANIFEST                   1	This shipping list
X Makefile                   2	rkive make file for generating the software.
X README                     1	Information posting that should be read first.
X article.1                  2	Manual page for article command.
X article.c                  2	Source containing article main routines.
X article.h                  1	Include file for News article information.
X cfg.h                      1	Include file for variable declarations.
X ck_name.c                  2	Assure the archive-name is valid and safe.
X ckconfig.1                 1	Manual page for ckconfig command.
X ckconfig.c                 2	Source containing ckconfig main routine.
X disp_grp.c                 1	Display newsrgoup configuration file info..
X efopen.c                   1	Fopen a file with error checking.
X format.c                   2	Formatting output for indexes, logs, articles.
X header.c                   3	News article header reading routines.
X makedir.c                  1	Make directory routines.
X match.y                    1   Matching routines for globbing support.
X news_arc.c                 4	News archiving gut functions.
X nntpart.c                  4	NNTP article retrieval functions.
X patchlevel.h               1	Include file containing current patchlevel.
X port/README.port           1	Information concerning portability.
X port/getopt.c              1	AT&T getopt(3) for systems missing it.
X port/dirent.h              1	dirent.h for sequents w/o Doug Gwyn's dirlib
X record_arc.c               2	Routines to deal with .archived file.
X retrieve.c                 2	retrieving an article to be archived.
X rkive.1                    1	Manual page for the rkive command.
X rkive.5                    2	Manual page for the rkive configuration file.
X rkive.c                    4	Source containing rkive main routines.
X rkive.cf                   3	Template configuration file.
X rkive.h                    2	Include file for rkive software.
X setup.c                    3	Routines to read the rkive configuration file.
X str.c                      1	String manipulation routines.
X suffix.c                   1	Compression suffix addition/removal routines.
X suffix.h                   1	Include for suffix structure and table.
X t.cf                       1	Test archive config file. Not the template.
X update_netdocs             1	Script to archive Usenet periodic articles.
X version.c                  1	Print the current version and patchlevel.
X zfopen.c                   1	Fopen a compressed file with error checking.
END_OF_FILE
if test 2791 -ne `wc -c <'rkive/MANIFEST'`; then
    echo shar: \"'rkive/MANIFEST'\" unpacked with wrong size!
fi
# end of 'rkive/MANIFEST'
fi
if test -f 'rkive/cfg.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/cfg.h'\"
else
echo shar: Extracting \"'rkive/cfg.h'\" \(720 characters\)
sed "s/^X//" >'rkive/cfg.h' <<'END_OF_FILE'
X/*
X** 	@(#)cfg.h	2.1 2/21/91 
X*/
X#include "rkive.h"
X
X#ifndef CFG
X#define CFG 1
X	int num;
X	char *progname;
X	struct group_archive group[NUM_NEWSGROUPS];
X	FILE *errfp;
X	FILE *logfp;
X	int fill_in_defaults;
X	struct group_archive *newsgrp;
X	extern char *config_file;
X	extern char problems_dir[];
X	extern char spooldir[];
X	extern char compress[];
X	extern char log[];
X	extern char log_format[];
X	extern char mindex[];
X	extern char index_format[];
X	extern char mail[];
X	extern char checkhash[];
X	extern char arch_command[];
X#ifdef NNTP
X	extern char nntp[];
X#endif /*NNTP*/
X	extern int default_type;
X	extern int default_patch_type;
X	extern int default_owner;
X	extern int default_group;
X	extern int default_modes;
X#endif /* CFG */
END_OF_FILE
if test 720 -ne `wc -c <'rkive/cfg.h'`; then
    echo shar: \"'rkive/cfg.h'\" unpacked with wrong size!
fi
# end of 'rkive/cfg.h'
fi
if test -f 'rkive/ckconfig.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/ckconfig.1'\"
else
echo shar: Extracting \"'rkive/ckconfig.1'\" \(4661 characters\)
sed "s/^X//" >'rkive/ckconfig.1' <<'END_OF_FILE'
X'br "@(#)ckconfig.1	2.2 2/23/91"
X.TH CKCONFIG 1
X.SH NAME
Xckconfig \- check the rkive configuration file setup
X.SH SYNOPSIS
X.B ckconfig
X[ -V ] [ -f config_file ] [ -n newsgroup ]
X.SH DESCRIPTION
X.I ckconfig
Xis used to verify a new or modified USENET archiver configuration file.
X.PP
XThe output is displayed as is shown in the sample below.
X.nf
X
X
X	Configuration Check for /usr/local/lib/rkive/rkive.cf
X
X			Global Defines
X
XNews Directory:          /usr/spool/news
XProblems Directory:      /usenet/problems
XGlobal Logfile:          /usenet/archive.log
XGlobal Index:            NO INDEXING
XLogfile Format:          %B %a %T
XIndex Format:            NOT SPECIFIED
XMail Results To:         kent,rick,kent@uunet.uu.net
X
XThe following values are used if the administrator has
Xnot set a value for a necessary configuration item(s).
X
XArchive Type:            Volume-Issue
XPatches Type:            Historical
XDefault Owner:           10 <src>
XDefault Group:           11 <archive>
XDefault Modes:           444
XCompression:             NO COMPRESSION
XCheckhash:               NO CHECKHASH
XArchiving From:          LOCAL DISK
X
X		Newsgroup Archive Configuration
X
Xcomp.sources.unix newsgroup archived to /usenet/unix
X	Archive Type:        Archive-Name
X	Patches Type:        Package
X	Owner:               10 <src>
X	Group:               11 <archive>
X	File Modes:          444
X	Logfile:             /usenet/unix/log
X	Index File:          /usenet/unix/index
X	Logfile Format:      NOT SPECIFIED   (DEFAULT)
X	Index Format:        %B %a %T
X	Mail Results:        NO ONE          (DEFAULT)
X	Compression:         NO COMPRESSION  (*NO* DEFAULT)
X	Checksum:            /usr/local/bin/checknews -s
X	Archiving From:      sparky.imd.sterling.com
X
Xsci.space newsgroup archived to /usenet/space
X	Archive Type:        Chronological
X	Patches Type:        Historical
X	Owner:               10 <src>
X	Group:               11 <archive>
X	File Modes:          444
X	Logfile:             /usenet/space/log
X	Index File:          /usenet/space/index
X	Logfile Format:      %O %S
X	Index Format:        NOT SPECIFIED   (*NO* DEFAULT)
X	Mail Results:        NO ONE          (DEFAULT)
X	Compression:         /usr/ucb/compress -f
X	Checksum:            NO CHECKHASH    (*NO* DEFAULT)
X	Archiving From:      LOCAL DISK
X
X
Xcomp.misc newsgroup archived to /usr/doc/news
X	Archive Type:        External-Command
X	Archive Command:     /usr/local/lib/rkive/update_netdocs $m $o $g $U
X	Patches Type:        Historical
X	Owner:               10 <src>
X	Group:               11 <archive>
X	File Modes:          444
X	Logfile:             /usr/doc/.admin/log
X	Index File:          /usr/doc/.admin/index
X	.archived File:      /usr/doc/.admin/misc.archived
X	.patchlog File:      /usr/doc/.admin/misc.patchlog
X	Logfile Format:      %O %S
X	Index Format:        NOT SPECIFIED   (*NO* DEFAULT)
X	Mail Results:        NO ONE          (DEFAULT)
X	Compression:         NO COMPRESSION  (DEFAULT)
X	Checksum:            NO CHECKHASH    (*NO* DEFAULT)
X	Archiving From:      LOCAL DISK
X
X.nr
X
X.PP
XThe "(DEFAULT)" indicates that the global value will be used since
Xthe administrator did not specify a value specific to that newsgroup.
XThe "(*NO* DEFAULT)" indicates that there is no global value to
Xbe substituted. In the entry for comp.sources.unix displayed above,
Xthere was no compression routine specified in the newsgroups entry
Xand there is no globally defined compression routine.
X.SH OPTIONS
X.IP "-V"
XPrint the version number and patchlevel of the current executable.
X.IP "-f config_file"
XExecute ckconfig using the specified config_file as the input file to 
Xbe checked.
X.IP "-g"
XThis option allows the global default values to be displayed in the 
Xnewsgroup variables when there is nothing specified in the newsgroup 
Xentry of the configuration file. If the above example had been run
Xusing this option, the output would have been:
X.nf
X
Xcomp.sources.unix newsgroup archived to /usenet/unix
X	Archive Type:   Archive-Name
X	Patches Type:   Package
X	Owner:          10 <src>
X	Group:          11 <archive>
X	File Modes:     444
X	Logfile:        /usenet/unix/log
X	Index File:     /usenet/unix/index
X	Logfile Format: %B %a\t%T
X	Index Format:   %B %a %T
X	Mail Results:   kent,rick
X	Compression:    NO COMPRESSION  (*NO* DEFAULT)
X	Checknews:      /usr/local/bin/checknews -s
X	Archiving From: sparky.imd.sterling.com
X
X.nr
X.IP "-n newsgroup"
XThis option allows a newsgroup to be specified on the command line.
XOnly one newsgroup can be specified in this manner. If only global 
Xinformation is requested, specify "-n none" on the command line.
X.LP
X.SH FILES
X/usr/local/lib/rkive/rkive.cf
X.SH "SEE ALSO"
Xarticle(1), rkive(1), rkive(5)
X.SH BUGS
XNone known.
END_OF_FILE
if test 4661 -ne `wc -c <'rkive/ckconfig.1'`; then
    echo shar: \"'rkive/ckconfig.1'\" unpacked with wrong size!
fi
# end of 'rkive/ckconfig.1'
fi
if test -f 'rkive/disp_grp.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/disp_grp.c'\"
else
echo shar: Extracting \"'rkive/disp_grp.c'\" \(4912 characters\)
sed "s/^X//" >'rkive/disp_grp.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X#ifndef lint
Xstatic char SID[] = "@(#)disp_grp.c	2.2 2/23/91";
X#endif
X
X#include <sys/types.h>
X#include <stdio.h>
X#include <pwd.h>
X#include <grp.h>
X#include "rkive.h"
X
Xextern fill_in_defaults;
Xextern FILE *logfp;
Xextern char log[];
Xextern char mindex[];
Xextern char log_format[];
Xextern char index_format[];
Xextern char mail[];
Xextern char compress[];
Xextern char checkhash[];
X
Xstruct passwd *pw;
Xstruct passwd *getpwuid();
Xstruct group *gr;
Xstruct group *getgrgid();
X
Xchar *what_to_print(ng_val, gbl_val, str)
Xchar *ng_val, *gbl_val, *str;
X{
X    static char rtbuf[50];
X
X    /*
X    ** If the newsgroup variable has been 
X    ** specified, return that value.
X    */
X    if (*(ng_val)) 
X        return (ng_val);
X
X    /*
X    ** If no global value has been specified
X    ** so that there is no default, build the
X    ** display string and return.
X    */
X    if (!*gbl_val) {
X        (void) sprintf(rtbuf,"%-15s (*NO* DEFAULT)", str);
X        return (rtbuf);
X    }
X
X    /*
X    ** Ok, here we have a global value.
X    ** Check if the user has requested to display global default
X    ** values in variables that are not specifically assigned 
X    ** for the newsgroup...
X    */
X    if (fill_in_defaults)
X        return (gbl_val);
X
X    (void) sprintf(rtbuf,"%-15s (DEFAULT)", str);
X    return (rtbuf);
X}
X
X
Xvoid display_group_info(ng)
Xstruct group_archive *ng;
X{
X    if (!*ng->location)
X       (void) fprintf(logfp,"\007\007%s does not have an archived location\n",
X                  ng->ng_name);
X    else
X       (void) fprintf(logfp,"%s newsgroup archived to %s\n", 
X                  ng->ng_name, ng->location);
X
X    (void) fprintf(logfp,"\tArchive Type:        %s\n",
X                  ng->type == ARCHIVE_NAME ? "Archive-Name" : 
X                  ng->type == VOLUME_ISSUE ? "Volume-Issue" :
X                  ng->type == CHRONOLOGICAL ? "Chronological" :
X                  ng->type == COMP_ARCHIVES ? "Comp-Archives" :
X                  ng->type == ONLY_ARCHIVE_NAME ? "Only-Archive-Name":
X                  ng->type == EXTERNAL_COMMAND ? "External-Command" :
X                                             "Article-Number"); 
X    if (ng->type == EXTERNAL_COMMAND) {
X       /* Must have an ARCHIVE_CMD line... */
X       (void) fprintf(logfp,"\tArchive Command:     %s\n",
X                  *(ng->arch_command) ? ng->arch_command : "ERROR - NOT SPECIFIED");
X    }
X
X    (void) fprintf(logfp,"\tPatches Type:        %s\n", 
X                  ng->patch_type == PACKAGE ? "Package" : "Historical");
X
X    /* 
X    ** The getpwuid() and getgrgid() calls have been previously made
X    ** thus verifying the entries exist. No real reason to check if
X    ** calls fail. If they do, something a lot bigger than this program
X    ** is hosed...
X    */
X    pw = getpwuid(ng->owner);
X    (void) fprintf(logfp,"\tOwner:               %d <%s>\n", 
X                  ng->owner, pw->pw_name);
X    gr = getgrgid(ng->group);
X    (void) fprintf(logfp,"\tGroup:               %d <%s>\n", 
X                  ng->group, gr->gr_name);
X
X    (void) fprintf(logfp,"\tFile Modes:          %o\n", ng->modes);
X    (void) fprintf(logfp,"\tLogfile:             %s\n", 
X               what_to_print(ng->logfile, log, "NO LOGGING"));
X    (void) fprintf(logfp,"\tIndex File:          %s\n", 
X               what_to_print(ng->index, mindex, "NO INDEXING"));
X    if (*ng->arc_done)
X        (void) fprintf(logfp,"\t.archived File:      %s\n", ng->arc_done);
X    if (*ng->patchlog)
X        (void) fprintf(logfp,"\t.patchlog File:      %s\n", ng->patchlog);
X    (void) fprintf(logfp,"\tLogfile Format:      %s\n", 
X               what_to_print(ng->logformat, log_format, "NOT SPECIFIED"));
X    (void) fprintf(logfp,"\tIndex Format:        %s\n", 
X               what_to_print(ng->indformat, index_format, "NOT SPECIFIED"));
X    (void) fprintf(logfp,"\tMail Results:        %s\n", 
X               what_to_print(ng->mail_list, mail, "NO ONE"));
X    (void) fprintf(logfp,"\tCompression:         %s\n", 
X               what_to_print(ng->compress, compress, "NO COMPRESSION"));
X    (void) fprintf(logfp,"\tChecksum:            %s\n", 
X               what_to_print(ng->checkhash, checkhash, "NO CHECKHASH"));
X#ifdef NNTP
X    if (*ng->nntp)
X        (void) fprintf(logfp,"\tNNTP Archiving From: %s\n", ng->nntp);
X    else
X        (void) fprintf(logfp,"\tArchiving From:      LOCAL DISK\n");
X#endif /*NNTP*/
X
X    if ((ng->patch_type == PACKAGE) && (ng->type != ARCHIVE_NAME)) {
X        (void) fprintf(logfp,"\nWARNING: Package Patches archiving is only\n");
X        (void) fprintf(logfp,"         used with Archive-Name archiving.\n");
X    }
X}
END_OF_FILE
if test 4912 -ne `wc -c <'rkive/disp_grp.c'`; then
    echo shar: \"'rkive/disp_grp.c'\" unpacked with wrong size!
fi
# end of 'rkive/disp_grp.c'
fi
if test -f 'rkive/efopen.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/efopen.c'\"
else
echo shar: Extracting \"'rkive/efopen.c'\" \(727 characters\)
sed "s/^X//" >'rkive/efopen.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X#if !defined(lint) && !defined(SABER)
Xstatic char SID[] = "@(#)efopen.c	2.1 2/21/91";
X#endif
X
X#include <stdio.h>
X
Xint fprintf();
XFILE *fopen();
Xvoid exit();
X
Xextern FILE *errfp;
X
XFILE *efopen(file,mode)       
Xchar *file, *mode;
X{
X     FILE *fp;
X
X     if ((fp = fopen (file, mode)) == NULL) {
X         (void) fprintf (errfp, "Can't open file %s\n", file);
X         exit(1);
X     }
X     return (fp);
X}
END_OF_FILE
if test 727 -ne `wc -c <'rkive/efopen.c'`; then
    echo shar: \"'rkive/efopen.c'\" unpacked with wrong size!
fi
# end of 'rkive/efopen.c'
fi
if test -f 'rkive/makedir.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/makedir.c'\"
else
echo shar: Extracting \"'rkive/makedir.c'\" \(3811 characters\)
sed "s/^X//" >'rkive/makedir.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X
X#if !defined(lint) && !defined(SABER)
Xstatic char SID[] = "@(#)makedir.c	2.1 2/21/91";
X#endif
X
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <stdio.h>
X#include "rkive.h"
X
Xextern char *progname;
X
Xextern int verbose;
Xextern int test;
X
Xextern FILE *errfp;
Xextern FILE *logfp;
X
Xint makedir(dirpath, mode, owner_id, group_id)
X    char *dirpath;
X    int mode;
X    int owner_id;
X    int group_id;
X{
X    int strlen();
X    int chown();
X
X#ifndef HAVE_MKDIR
X# ifndef USE_SYSMKDIR
X
X    char *strcat();
X    char *strncpy();
X    char *strcpy();
X    int access();
X    int mknod();
X    int link();
X    int unlink();
X
X    register i;
X    register slen = 0;
X
X    char parent[MAXNAMLEN];
X
X# else /* USE_SYSMKDIR */
X
X    int chmod();
X
X# endif /* USE_SYSMKDIR */
X
X    char crnt_dir[MAXNAMLEN];
X
X#else /* HAVE_MKDIR */
X
X    int mkdir();
X    int svmask;          /* Old umask value */
X
X#endif /* HAVE_MKDIR */
X    
X    if ((strlen(dirpath) == 0) || (dirpath[0] == '\0')) {
X        (void) fprintf(errfp,"%s: cannot make %s\n", progname,dirpath);
X        return(-1);
X    }
X
X    if (verbose) {
X        (void) fprintf(logfp,"making\t<%s>\n",dirpath);
X        if (test) 
X            return(0);
X    }
X
X#ifdef HAVE_MKDIR
X
X    /*
X    ** mkdir function supplied in system library.
X    */
X
X    svmask = umask(0);
X
X    if (mkdir(dirpath,mode) != 0)
X        return(-1);
X
X    (void) umask(svmask);
X    (void) chown(dirpath, owner_id, group_id);
X
X#else
X# ifdef USE_SYSMKDIR
X
X    /* 
X    ** Use the system mkdir executable.. why?
X    */
X
X    /* build up command */
X
X    (void) sprintf(crnt_dir, "/bin/mkdir %s", dirpath);
X
X    if (system(crnt_dir) != 0)
X        return(-1);
X
X    (void) chmod(dirpath, mode);
X    (void) chown(dirpath, owner_id, group_id);
X
X# else
X
X    /*
X    ** Builtin mkdir function in use ...
X    **
X    ** Save the parent path
X    */
X
X    i = 0;
X    parent[0] = '\0';
X
X    while (dirpath[i]) {
X        if (dirpath[i] == '/')
X            slen = i + 1;
X        ++i;
X    }
X
X    if (slen)    /* Is there a parent string to save ? */
X        (void) strncpy(parent, dirpath, slen);
X
X    (void) strcpy(parent+slen, ".");
X
X    /* Does the parent directory exist and is it writable ? */
X
X    if (access(parent, 02)) {
X        (void) fprintf(errfp,"%s: cannot access %s\n", progname,parent);
X        return(-1);
X    }
X
X    /* make the actual directory file */
X
X    if ((mknod(dirpath, S_IFDIR | mode, 0)) < 0) {
X        (void)fprintf(errfp,"%s: can't make directory %s\n",progname,dirpath);
X        return(-1);
X    }
X
X    (void) chown(dirpath, owner_id, group_id);
X
X    /* need to create the "." directory entry */
X
X    (void) strcpy(crnt_dir, dirpath);
X    (void) strcat(crnt_dir, "/.");
X
X    if ((link(dirpath, crnt_dir)) < 0) {
X        /* 
X        ** Could not link the  directory to it's "." entry.
X        ** Clean up and return.
X        */
X        (void) unlink(dirpath);
X        (void) fprintf(errfp, "%s: cannot link [%s]\n", progname,crnt_dir);
X        return(-1);
X    }
X
X    /* need to create the "." directory entry */
X
X    (void) strcat(crnt_dir, ".");
X
X    if ((link(parent, crnt_dir)) < 0) {
X        /* 
X        ** Could not link the parent directory to the ".." entry.
X        ** Clean up and return.
X        */
X        crnt_dir[strlen(crnt_dir)] = '\0';
X        (void) unlink(crnt_dir);
X        (void) unlink(dirpath);
X        (void) fprintf(errfp, "%s: cannot link [%s]\n",progname,crnt_dir);
X        return(-1);
X    }
X#endif /* USE_SYSMKDIR */
X#endif /* HAVE_MKDIR */
X    return(0); 
X}
END_OF_FILE
if test 3811 -ne `wc -c <'rkive/makedir.c'`; then
    echo shar: \"'rkive/makedir.c'\" unpacked with wrong size!
fi
# end of 'rkive/makedir.c'
fi
if test -f 'rkive/patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/patchlevel.h'\"
else
echo shar: Extracting \"'rkive/patchlevel.h'\" \(80 characters\)
sed "s/^X//" >'rkive/patchlevel.h' <<'END_OF_FILE'
X/*
X**    @(#)patchlevel.h	2.2 2/23/91
X*/
X#define RELEASE 2
X#define PATCHLEVEL 0
END_OF_FILE
if test 80 -ne `wc -c <'rkive/patchlevel.h'`; then
    echo shar: \"'rkive/patchlevel.h'\" unpacked with wrong size!
fi
# end of 'rkive/patchlevel.h'
fi
if test -f 'rkive/port/dirent.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/port/dirent.h'\"
else
echo shar: Extracting \"'rkive/port/dirent.h'\" \(43 characters\)
sed "s/^X//" >'rkive/port/dirent.h' <<'END_OF_FILE'
X#include <sys/dir.h>
X#define dirent direct
END_OF_FILE
if test 43 -ne `wc -c <'rkive/port/dirent.h'`; then
    echo shar: \"'rkive/port/dirent.h'\" unpacked with wrong size!
fi
# end of 'rkive/port/dirent.h'
fi
if test -f 'rkive/port/getopt.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/port/getopt.c'\"
else
echo shar: Extracting \"'rkive/port/getopt.c'\" \(1799 characters\)
sed "s/^X//" >'rkive/port/getopt.c' <<'END_OF_FILE'
X#define ERR(s, c)       if(opterr){\
X        extern int strlen(), write();\
X        char errbuf[2];\
X        errbuf[0] = c; errbuf[1] = '\n';\
X        (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
X        (void) write(2, s, (unsigned)strlen(s));\
X        (void) write(2, errbuf, 2);}
X
Xextern int strcmp();
Xextern char *strchr();
X
Xint     opterr = 1;
Xint     optind = 1;
Xint     optopt;
Xchar    *optarg;
X 
Xint
Xgetopt(argc, argv, opts)
Xint     argc;
Xchar    **argv, *opts;
X{
X        static int sp = 1;
X        register int c;
X        register char *cp;
X 
X        if(sp == 1)
X                if(optind >= argc ||
X                   argv[optind][0] != '-' || argv[optind][1] == '\0')
X                        return(-1);
X                else if(strcmp(argv[optind], "--") == 0) {
X                        optind++;
X                        return(-1);
X                }
X        optopt = c = argv[optind][sp];
X        if(c == ':' || (cp=strchr(opts, c)) == 0) {
X                ERR(": illegal option -- ", c);
X                if(argv[optind][++sp] == '\0') {
X                        optind++;
X                        sp = 1;
X                }
X                return('?');
X        }
X        if(*++cp == ':') {
X                if(argv[optind][sp+1] != '\0')
X                        optarg = &argv[optind++][sp+1];
X                else if(++optind >= argc) {
X                        ERR(": option requires an argument -- ", c);
X                        sp = 1;
X                        return('?');
X                } else
X                        optarg = argv[optind++];
X                sp = 1;
X        } else {
X                if(argv[optind][++sp] == '\0') {
X                        sp = 1;
X                        optind++;
X                }
X                optarg = 0;
X        }
X        return(c);
X}
END_OF_FILE
if test 1799 -ne `wc -c <'rkive/port/getopt.c'`; then
    echo shar: \"'rkive/port/getopt.c'\" unpacked with wrong size!
fi
# end of 'rkive/port/getopt.c'
fi
if test -f 'rkive/record_arc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/record_arc.c'\"
else
echo shar: Extracting \"'rkive/record_arc.c'\" \(3917 characters\)
sed "s/^X//" >'rkive/record_arc.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X
X#if !defined(lint) && !defined(SABER)
Xstatic char SID[] = "@(#)record_arc.c	2.1 2/21/91";
X#endif
X
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <stdio.h>
X#include "cfg.h"
X
Xstatic char work[BUFSIZ];
Xstatic int len;
Xstatic FILE *archived_fp;
X
Xint fclose();
Xint sscanf();
Xint strlen();
Xint strncmp();
XFILE *fopen();
XFILE *efopen();
X
Xextern int retrieve;
Xextern int verbose;
Xextern int test;
Xextern struct group_archive *newsgrp;
X
X/*
X** ********************************************************************
X** This file contains functions to maintain the .archived file in the
X** newsgroup's archive BASEDIR directory. The .archived file is used to 
X** assure that articles are not archived over and over and that the 
X** administrator does not need to wait until the articles have
X** expired before they are added to the archive. 
X** The .archived file stores a list of message-ids and archived paths
X** of articles that have been added to the archives already. 
X** *******************************************************************
X*/
X
X/*
X** get_archived_rec:
X**
X** get_archived_rec(message_id) char *message_id; { return(work); }
X**
X** get_archived_rec is used to determine if the message_id
X** passed to it has been archived. If its message_id is found
X** in the .archived file, it has been previously archived
X** and its archive information record is  returned to the
X** caling routine. Else it returns NULL.
X*/
X
Xchar *get_archived_rec(message_id)
X    char *message_id;
X{
X    /*
X    ** If the .archived file is missing, it must be
X    ** the first time that it is to be archived.
X    */
X    if ((archived_fp = fopen(newsgrp->arc_done,"r")) == NULL) 
X	return(NULL);
X
X    len = strlen(message_id);
X 
X    while (fgets(work, sizeof work, archived_fp) != NULL) {
X        if (*work == '#')
X            continue;
X        if ((strncmp(work,message_id,len) == 0) && (work[len] == ' ')) {
X            (void) fclose(archived_fp);
X            *(work+(strlen(work)-1)) = '\0';
X            return(work);
X        }
X    }
X    (void) fclose(archived_fp);
X    return(NULL);
X}
X
X/*
X** needs_to_be_archived:
X**
X** int needs_to_be_archived(message_id) char *message_id; { return(0); }
X**
X** This function is used to determine if the message-id
X** passed to it requires archiving. If the message-id is
X** found in the .archived file, it has been previously
X** archived and does not need to be now. If it is not
X** found in the .archived file, it needs to be archived.
X*/
X
Xint needs_to_be_archived(message_id)
X    char *message_id;
X{
X    if (get_archived_rec(message_id) == NULL)
X	return(1);
X#ifdef NNTP
X    if (verbose && retrieve == FROM_NNTP) 
X        (void) fprintf(logfp, "Skipping, %s, previously archived.\n", message_id);
X#endif /*NNTP*/
X    return(0);
X}
X
X/*
X** write_archived:
X**
X** write_archived(message_id, path) char *message_id, path; {}
X**
X** This function is used to write a message_id and its archived location
X** to the .archived file in the newsgroup's archive BASEDIR
X** directory since we do not want it rearchived tomorrow.
X*/
X
Xvoid write_archived(message_id, path)
X    char *message_id;
X    char *path;
X{
X    FILE *fp;
X    struct stat sb;
X
X    /* 
X    ** If in test mode no actual operations are 
X    ** to be done...
X    */
X    if (test)
X        return;
X
X    if ((stat(path ,&sb) != 0)) 
X        if (mkparents(path) == -1)
X            return;          /* unable to build parent directories */
X
X    /*
X    ** open the file and append the record
X    */
X
X    fp = efopen(newsgrp->arc_done,"a+");
X    (void) fprintf(fp,"%s %s\n",message_id, path);
X    (void) fclose(fp);
X    return;
X}
END_OF_FILE
if test 3917 -ne `wc -c <'rkive/record_arc.c'`; then
    echo shar: \"'rkive/record_arc.c'\" unpacked with wrong size!
fi
# end of 'rkive/record_arc.c'
fi
if test -f 'rkive/str.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/str.c'\"
else
echo shar: Extracting \"'rkive/str.c'\" \(1893 characters\)
sed "s/^X//" >'rkive/str.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X
X#if !defined(lint) && !defined(SABER)
Xstatic char SID[] = "@(#)str.c	2.1 2/21/91";
X#endif
X
X/*
X** Strchr() and Strrchr() are included for portability sake only.
X*/
X
X#ifndef NULL
X#define NULL 0
X#endif
X
X#ifndef lint
X/*
X** strchr:
X**
X** strchr(str, c) returns a pointer to the first place in
X** str where c occurs, or NULL if c does not occur in str.
X**
X** char *strchr(str, c) char *str, c; { return (str); }
X**
X*/
X
Xchar *strchr(str, c)
Xregister char *str, c;
X{
X    for (;;) {
X        if (*str == c)
X            return (str);
X        if (!*str++)
X            return (NULL);
X    }
X}
X
X/*
X** strrchr:
X**
X** strrchr(str, c) returns a pointer to the last place in 
X** str where c occurs, or NULL if c does not occur in str.
X**
X** char *strrchr(str, c) char *str, c; { return (str); }
X*/
X
Xchar *strrchr(str, c)
Xregister char *str, c;
X{
X    register char *t;
X
X    t = NULL;
X    do {
X        if (*str == c)
X            t = str;
X    } while (*str++);
X    return(t);
X}
X#endif /* lint */
X
X/*
X** strstrip:
X**
X** strstrip(str) returns a pointer to the first non-blank character 
X** in str. It strips all blanks, and tabs from the front and back
X** of a string as well as strip off newlines from the rear.
X**
X** char *strstrip(str) char *str; { return (str); }
X*/
X
Xchar *strstrip(str)
Xregister char *str;
X{
X    int strlen();
X    register char *cp, *dp;
X    
X    cp = str;
X    dp = ((str+strlen(str))-1);
X
X    while(*cp && (*cp == ' ' || *cp == '\t')) 
X      cp++;
X
X    while(dp != cp && (*dp == ' ' || *dp == '\t' || *dp == '\n'))
X      --dp;
X    *(dp+1) = '\0';
X
X    return(cp);
X}
X
END_OF_FILE
if test 1893 -ne `wc -c <'rkive/str.c'`; then
    echo shar: \"'rkive/str.c'\" unpacked with wrong size!
fi
# end of 'rkive/str.c'
fi
if test -f 'rkive/suffix.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/suffix.c'\"
else
echo shar: Extracting \"'rkive/suffix.c'\" \(2259 characters\)
sed "s/^X//" >'rkive/suffix.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X
X#if !defined(lint) && !defined(SABER)
Xstatic char SID[] = "@(#)suffix.c	2.1 2/21/91";
X#endif
X
X#include <stdio.h>
X#include <sys/types.h>
X#include "rkive.h"
X#include "suffix.h"
X
Xint strcmp();
X
Xextern char compress[];
X
Xchar *suffix(compression)
X    char *compression;
X {
X    struct compress_tab *ct;
X
X    ct = &cprgs[0];
X    while ((ct->com_name) != NULL) {
X        if (strcmp(compression, ct->com_name) == 0) 
X            return(ct->com_suffix);
X        ct++;
X    }
X    return("");
X}
X
Xint remove_suffix(path_str)
Xchar *path_str;
X {
X    int strlen();
X
X    char *ss;
X    struct compress_tab *ct;
X
X    /*
X    ** need to compare the filename passed in to 
X    ** the compression suffix table in order to
X    ** determine if the file has a recognized,
X    ** compression suffix attached.
X    */
X    
X    ss = path_str + (strlen(path_str) -2);
X
X    ct = &cprgs[0];
X    while ((ct->com_name) != NULL) {
X        if (strcmp(ss, ct->com_suffix) == 0) {
X            *ss = '\0';
X            return(TRUE);
X        }
X        ct++;
X    }
X    return(FALSE);
X}
X
Xchar *expand_name(filename,ng)
Xchar *filename;
Xstruct group_archive *ng;
X{
X    char *comp_cmd;
X    char *strcpy();
X    char *strcat();
X    char *basename();
X
X    static char compress_path[MAXNAMLEN];
X
X    (void) strcpy(compress_path, filename);
X
X    /*
X    ** Check to see if a group specific compress was specified.      
X    ** If so, then attach the suffix and return.                    
X    ** Else check to see if a global compress was specified. If so,
X    ** then attach the suffix and return.                         
X    ** If both are NULL, return filename.                        
X    */
X
X    if (*(ng->compress)) {
X        comp_cmd = basename(ng->compress);
X        (void) strcat(compress_path, suffix(comp_cmd));
X    }
X    else if (*compress) {
X        comp_cmd = basename(compress);
X        (void) strcat(compress_path, suffix(comp_cmd));
X    }
X    return(compress_path);
X}
END_OF_FILE
if test 2259 -ne `wc -c <'rkive/suffix.c'`; then
    echo shar: \"'rkive/suffix.c'\" unpacked with wrong size!
fi
# end of 'rkive/suffix.c'
fi
if test -f 'rkive/suffix.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/suffix.h'\"
else
echo shar: Extracting \"'rkive/suffix.h'\" \(590 characters\)
sed "s/^X//" >'rkive/suffix.h' <<'END_OF_FILE'
X/*
X** 	@(#)suffix.h	2.1 2/21/91
X*/
X
X/*
X** IF YOU USE A COMPRESSION ROUTINE OTHER THAN COMPRESS
X** OR PACK, ADD YOUR COMPRESSION SPECIFIC INFORMATION
X** TO THE cprgs COMPRESS_TABLE BELOW......
X*/
X
Xstruct compress_tab {
X    char     *com_name;              /* compression routine   */
X    char     *uncom_name;            /* decompression routine */
X    char     *com_suffix;            /* commpression suffix   */
X};
X
Xstruct compress_tab cprgs[] = {
X{    "compress",    "zcat",        ".Z"    },
X{    "pack",        "pcat",        ".z"    },
X{    NULL,           0,              0     },
X};
END_OF_FILE
if test 590 -ne `wc -c <'rkive/suffix.h'`; then
    echo shar: \"'rkive/suffix.h'\" unpacked with wrong size!
fi
# end of 'rkive/suffix.h'
fi
if test -f 'rkive/t.cf' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/t.cf'\"
else
echo shar: Extracting \"'rkive/t.cf'\" \(1513 characters\)
sed "s/^X//" >'rkive/t.cf' <<'END_OF_FILE'
X#
X#   junk test file.  Convienience only... :-)
X#
X######################################################################
XSPOOLDIR=/usr/spool/news      
XPROBLEMS=/usenet/problems
XTYPE= Volume-Issue
X#TYPE= External-Command
X#ARCHIVE_CMD=update_netdocs
XPATCHES=Historical
XMAIL=kent
XOWNER=src
XGROUP=archive
XMODE=0444
X#LOG=/usenet/archive.log
X#LOG_FORMAT= "%B %a\t%T"
X#INDEX= /usenet/index
X#INDEX_FORMAT= "%O\t%a\t%T"
XCOMPRESS=/usr/ucb/compress -f
X#CHECKHASH=/usr/local/bin/checkhash -s
X#NNTP=sparky
X#MATCH="I have no idea what a global match might be but it was a freebee so..\
X#	I put it in.. Creaping featurism ya know... :-) "
X
X######################################################################
X$$comp.sources.test		
X	BASEDIR: /usenet/test 
X	TYPE: Volume-Issue
X        PATCHES: Historical
X        MAIL: kent@sparky.imd.sterling.com,kent@uunet.uu.net,rick,sparky!rick
X        OWNER: src
X        GROUP: archive
X        MODE: 0644
X        LOG: /usenet/admin/test.log
X        LOG_FORMAT: "%B %a %T" 
X        INDEX: /usenet/amiga/index
X        INDEX_FORMAT: "%B %a %T" 
X	COMPRESS: /usr/ucb/compress -f
X	CHECKHASH: /usr/local/bin/checkhash -s
X	ARCHIVE_CMD: /usr/local/bin/external_test
X	ARCHIVED_LOG: /usenet/.admin/cst.archived
X	PATCHLOG: /usenet/.admin/cst.patchlog
X	NNTP: smokey
X        MATCH: subject glob-matches "How to Get Information about Networks" \
X        or subject glob-matches "USENET Software: History and Sources" \
X        or subject glob-matches "A Primer on How to Work With the Usenet Community"
END_OF_FILE
if test 1513 -ne `wc -c <'rkive/t.cf'`; then
    echo shar: \"'rkive/t.cf'\" unpacked with wrong size!
fi
# end of 'rkive/t.cf'
fi
if test -f 'rkive/update_netdocs' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/update_netdocs'\"
else
echo shar: Extracting \"'rkive/update_netdocs'\" \(5091 characters\)
sed "s/^X//" >'rkive/update_netdocs' <<'END_OF_FILE'
X#!/bin/sh
X#
X#  @(#)update_netdocs	2.1 2/21/91
X#
X#  Author: Kent Landfield
X#
X# This script is called by rkive to keep current all the periodic postings
X# that I save. 
X#
X# called as:
X#    update_netdocs filename-to-archive modes owner group [users to notify..] 
X#
X
Xset -x
X
XARTICLE=/usr/local/bin/article
X
Xapproved=NOCHECK
Xfrom=NOCHECK
X
Xbasedir=/usr/doc/news
X
Xif [ $# -lt 4 ]
Xthen
X	echo "usage: $0 FileToSave modes owner group [ user to notify ... ]"
X	exit 1
Xfi
X
Xfl_to_archive=$1
Xmodes=$2
Xowner=$3
Xgroup=$4
X
Xshift; shift; shift; shift
X
XSUB=`$ARTICLE -f "%T" $fl_to_archive`
Xcase $SUB in
X	# 
X	# comp.misc
X	#
X	"Anonymous FTP list")
X		filename=$basedir/'anonymous.ftp' 
X		from="odin@pilot.njin.net (Jon Granrose)"
X		;;
X	# 
X	# comp.mail.misc
X	#
X	"Inter-Network Mail Guide")
X		filename=$basedir/'mail.quide' 
X		;;
X	# 
X	# comp.std.unix
X	#
X	"Access to UNIX-Related Standards")
X		filename=$basedir/'unix.standards' 
X		approved="jsq@cs.utexas.edu (Moderator, John S. Quarterman)"
X		;;
X	"Calendar of UNIX-related Events")
X		filename=$basedir/'unix.events' 
X		approved="jsq@cs.utexas.edu (Moderator, John S. Quarterman)"
X		;;
X	"Access to UNIX User Groups")
X		filename=$basedir/'user.groups' 
X		approved="jsq@cs.utexas.edu (Moderator, John S. Quarterman)"
X		;;
X	"Access to UNIX-Related Publications")
X		filename=$basedir/'unix.pubs' 
X		approved="jsq@cs.utexas.edu (Moderator, John S. Quarterman)"
X		;;
X	# 
X	# comp.windows.x
X	#
X	"Frequently Asked Questions about X with Answers 1/3 [long monthly posting]")
X		filename=$basedir/'X.questions.1' 
X		from="xug@lta.com (X User's Group)"
X		;;
X	"Frequently Asked Questions about X with Answers 2/3 [long monthly posting]")
X		filename=$basedir/'X.questions.2' 
X		from="xug@lta.com (X User's Group)"
X		;;
X	"Frequently Asked Questions about X with Answers 3/3 [long monthly posting]")
X		filename=$basedir/'X.questions.3' 
X		from="xug@lta.com (X User's Group)"
X		;;
X	# 
X	# News.admin
X	#
X	"Checkgroups message (without INET groups)")
X		filename=$basedir/admin/'checkgroups' 
X		from="spaf@cs.purdue.EDU (Gene Spafford)"
X		;;
X	"Checkgroups message (with INET groups)")
X		filename=$basedir/admin/'checkgroups' 
X		from="spaf@cs.purdue.EDU (Gene Spafford)"
X		;;
X        "How to Create a New Trial Newsgroup")
X		filename=$basedir/admin/'trial.create' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"How to Construct the Mailpaths File")
X		filename=$basedir/admin/'mailpaths' 
X		from="spaf@cs.purdue.EDU (Gene Spafford)"
X		;;
X	# 
X	# News.announce.newusers
X	#
X        "How to Get Information about Networks")
X		filename=$basedir/'network.info' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X        "USENET Software: History and Sources")
X		filename=$basedir/'usenet.history' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X        "A Primer on How to Work With the Usenet Community")
X		filename=$basedir/'usenet.primer' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X        "Answers to Frequently Asked Questions")
X		filename=$basedir/'questions' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X        "Emily Postnews Answers Your Questions on Netiquette")
X		filename=$basedir/'netiquette' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X        "Hints on writing style for Usenet")
X		filename=$basedir/'hints.style' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"Regional Newsgroup Hierarchies")
X		filename=$basedir/'regionals' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X        "Rules for posting to Usenet")
X		filename=$basedir/'posting.rules' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"How to Create a New Newsgroup")
X		filename=$basedir/'create.group' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"List of Periodic Informational Postings")
X		filename=$basedir/'info.postings' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"List of Active Newsgroups")
X		filename=$basedir/'active.groups' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"Alternative Newsgroup Hierarchies")
X		filename=$basedir/'alt.groups' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"List of Moderators")
X		filename=$basedir/'moderators' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	"Publicly Accessible Mailing Lists")
X		filename=$basedir/'mail.lists' 
X		approved="spaf@cs.purdue.EDU"
X		;;
X	*) echo "Specified filename error. please update $0"
X		exit 1 ;;
Xesac 
X
X#
X# Now lets see if the file has an approved submitter
X#
Xif [ "$approved" != "NOCHECK" ]
Xthen
X	f_ap=`$ARTICLE -f"%A" $fl_to_archive`
X	if [ "$f_ap" != "$approved" ]
X	then
X		echo 
X		echo "Invalid approval found in $fl_to_archive."
X		echo "Please check to assure that $0 is current..."
X		echo 
X		exit 1 
X	fi
Xelif [ "$from" != "NOCHECK" ]
Xthen
X	f_ap=`$ARTICLE -f"%F" $fl_to_archive`
X	if [ "$f_ap" != "$from" ]
X	then
X		echo 
X		echo "Invalid from found in $fl_to_archive."
X		echo "Please check to assure that $0 is current..."
X		echo 
X		exit 1 
X	fi
Xfi
X	
X#
X# At this point the file found has been validated as being sent
X# by the appropriate person. Now it is time to save it off.
X#
X
X#if [ -f $filename ]
X#then
X#	mv -f $filename $filename.old
X#fi
X
Xcp $fl_to_archive $filename
Xchmod $modes $filename
Xchown $owner $filename
Xchgrp $group $filename
X
Xwhile [ $1 ]
Xdo
X	echo "$filename Updated - `date`" | Mail -s "$filename Updated" $1
X	shift
Xdone
Xexit 0
END_OF_FILE
if test 5091 -ne `wc -c <'rkive/update_netdocs'`; then
    echo shar: \"'rkive/update_netdocs'\" unpacked with wrong size!
fi
# end of 'rkive/update_netdocs'
fi
if test -f 'rkive/version.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/version.c'\"
else
echo shar: Extracting \"'rkive/version.c'\" \(691 characters\)
sed "s/^X//" >'rkive/version.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X
X#if !defined(lint) && !defined(SABER)
Xstatic char SID[] = "@(#)version.c	2.2 2/23/91";
X#endif
X
X#include <stdio.h>
X#include "patchlevel.h"
X
Xint fprintf();
Xextern char sccsid[];
X
Xvoid version()
X{
X    void exit();
X
X    (void) fprintf(stderr,"%s\nRelease: %d\nPatch level: %d\n", 
X                           sccsid, RELEASE, PATCHLEVEL);
X    exit(0);
X/*NOTREACHED*/
X}
END_OF_FILE
if test 691 -ne `wc -c <'rkive/version.c'`; then
    echo shar: \"'rkive/version.c'\" unpacked with wrong size!
fi
# end of 'rkive/version.c'
fi
if test -f 'rkive/zfopen.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive/zfopen.c'\"
else
echo shar: Extracting \"'rkive/zfopen.c'\" \(1733 characters\)
sed "s/^X//" >'rkive/zfopen.c' <<'END_OF_FILE'
X/*
X** This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X*/
X#if !defined(lint) && !defined(SABER)
Xstatic char SID[] = "@(#)zfopen.c	2.2 2/23/91";
X#endif
X
X#include <sys/types.h>
X#include <stdio.h>
X#include "rkive.h"
X#include "suffix.h"
X
Xextern FILE *errfp;
X
Xstatic    char    cmdline[512] = "";
X
XFILE *zfopen(file,mode)       
Xchar *file, *mode;
X{
X    int strlen();
X    int strcmp();
X    FILE *fopen();
X    FILE *popen();
X
X    char *ss;
X    FILE *fp;
X    struct compress_tab *ct;
X
X    /*
X    ** need to compare the filename passed in to 
X    ** the compression suffix table in order to
X    ** determine if the file has a recognized,
X    ** compression suffix attached.
X    */
X    
X    cmdline[0] = '\0';
X    ss = file + (strlen(file)-2);
X
X    ct = &cprgs[0];
X    while ((ct->com_name) != NULL) {
X        if (strcmp(ss, ct->com_suffix) == 0) {
X            *ss = '\0';
X            (void) sprintf(cmdline, "%s %s", ct->uncom_name, file);
X            break;
X        }
X        ct++;
X    }
X
X    if (cmdline[0] != '\0') {
X        if ((fp = popen(cmdline, "r")) == NULL) {
X            (void) fprintf(errfp, "Can't execute command: %s\n", cmdline);
X            exit(1);
X        }
X    } else if ((fp = fopen (file, mode)) == NULL) {
X         (void) fprintf (errfp, "Can't open file %s\n", file);
X         exit(1);
X     }
X     return (fp);
X}
X
Xint        zfclose(fp)
XFILE    *fp;
X{
X    int fclose();
X    int pclose();
X
X    return (cmdline[0] == '\0' ? fclose(fp) : pclose(fp));
X}
END_OF_FILE
if test 1733 -ne `wc -c <'rkive/zfopen.c'`; then
    echo shar: \"'rkive/zfopen.c'\" unpacked with wrong size!
fi
# end of 'rkive/zfopen.c'
fi
echo shar: End of archive 6 \(of 6\).
cp /dev/null ark6isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 6 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
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.