# Revision 1.60  1993/06/28  14:55:52  lmjm
# Fixup symlinks ending in .Z to files that are going to be converted to gzip.
# Only print timestamp message on -T or if debuging.
#
# Revision 1.59  1993/06/28  09:23:54  lmjm
# Fixed timestamp code.
# Move old debug prints to debug > 4
#
# Revision 1.58  1993/06/24  22:01:37  lmjm
# Use same variable for time stamping throughout.
# Handle change of file type properly.
# Check symlink against correct directory.
#
# Revision 1.57  1993/06/23  00:45:12  lmjm
# If making a directory then zap any file/symlink with that name.
#
# Revision 1.56  1993/06/22  21:41:37  lmjm
# Warn when not creating bad symlinks.
#
# Revision 1.55  1993/06/22  17:11:56  lmjm
# Rename symlinks if what they point at is going to be renamed.
# Patch from Pieter Immelman to correct removing symlinks before replacing them.
#
# Revision 1.54  1993/06/21  18:59:25  lmjm
# Chopped up the really long source lines.
# Added improved exit handling from Joachim Schrod.
#
# Revision 1.53  1993/06/18  16:55:57  lmjm
# Don't create non-existant symlinks
# Print out version if debug > =2
# Simplier code to update compress defaults override.
# Make follow_local_symlinks a regexp.
#
# Revision 1.52  1993/06/11  14:42:44  lmjm
# Allow for directory tree to be symlinks to elsewhere.
#
# Revision 1.51  1993/06/08  20:04:14  lmjm
# Keep an eye out for old .z stuff.
# Reorderd the defaults to match the man page.
# Added umask support (I seemed to have lost it!)
# Added make_bad_symlinks control from: Pieter Immelman
# Added delete_patt/delete_get_patt from Joachim Schrod
# Corrected missing \n's in msg calls (mostly from Joachim + some lmjm)
# Corrected handling of compress_prog variable (from Joachim).
# Corrected bad calls to &msg.
# Corrected error printing on deleting (from Pieter).
#
# Revision 1.50  1993/06/03  00:52:15  lmjm
# New suffix for gzip of .gz
# Use variables for suffixes not literals.
# Much simpler squishing code.  Always use squished version.
#
# Revision 1.49  1993/05/27  00:15:41  lmjm
# Increased default timeout to match the new ones in ftp.pl
# Make sure just tmp files are kept.
# Junked call to chat'close.  Now that two files are opened by ftp.pl
# Now chat no longer required.
#
# Revision 1.48  1993/05/19  09:19:11  lmjm
# Added patches from: Pieter Immelman <pi@itu1.sun.ac.za>
#
# Revision 1.47  1993/05/14  14:55:09  lmjm
# More code to handle compressed/gzipped files.
# Beware of timeouts.
# Make sure to keep files just got.
#
# Revision 1.46  1993/05/07  23:38:31  lmjm
# ftp.pl no longer treats timeouts as fatal.  Fail anyway if too many.
# Zap tmp file for uncompressed local ls file.
#
# Revision 1.45  1993/05/06  23:13:31  lmjm
# Only prod remote if necessary.
#
# Revision 1.44  1993/05/06  21:14:23  lmjm
# Just the _rev patterns as no longer needed.
# Try to get the style consistent all the way thru.
# Moved the max_age code to ignore files very early on.
#
# Revision 1.43  1993/04/29  23:28:19  lmjm
# If not interactive have all errrors go to stdout so output is contuous.
# Free up space earlier.
# Cleaned up dont debugging.
# Show what deletions would be done even if -n set.
#
# Revision 1.42  1993/04/27  19:53:52  lmjm
# New deletions code.
# Reverse_mappings no longer needed.
# Started added the vms support.
#
# Revision 1.41  1993/04/26  19:58:35  lmjm
# Added patterns to reverse compress->gzip conversion.
# Added remote idle timer support.
#
# Revision 1.40  1993/04/25  22:53:30  lmjm
# Process symlinks after all the files have been pulled back and deletions
# have been done. Then try and make them point at existing files so look
# out for compressing, gzipping and splitting.
# Allow split sizes to have k|b|m suffixes.
# Apply compress_conv_expr to symlink parts.
# Allow for more than 99 parts in a split file.
#
# Revision 1.39  1993/04/25  13:15:47  lmjm
# Default to loading mirror.default
# Removed the chown stuff - do it with perl.
# Allow for gzip as well as compress and compress -> gzip conversion.
# Cleanup up flags and made sure they are all commented.
# Allow for whitespace between option and arg.
# Started on DUMP/undump.
# In new ftp signal handler.
# Delete the assocs AFTER there last use.
# Timeout directory parsing.
# Assign to $0 so when you do a 'ps' it gives the last log msg.
#
# Revision 1.38  1993/01/28  23:17:03  lmjm
# Now that the time,size.. arrays are indexed by numbers - turned them into
# arrays (zeroth element left empty).
# Don't use defined() - use the fact an index of 0 isn't possible.
# Filled the arrays by push, as indexing is slower.
# Lifted variables out of long running loops to avoid a perl but looses memory.
#
# Revision 1.37  1993/01/28  18:59:11  lmjm
# Added outgoing compression.
# Cleaned up a lot of comments.
# Made compress_excl case insensitive
# Added recurse_hard
# Added mapping in an external file
# Under big array when not in use any more.
# When remote dir listing if type A works before it is fatal for the reverse
# type change to fail.
#
# Revision 1.36  1992/12/07  17:18:32  lmjm
# Make compress_exclude variable case insensitive.
#
# Revision 1.35  1992/11/25  21:09:33  lmjm
# map filenames into shorter keys to reduce memory requirements.
#
# Revision 1.34  1992/10/27  23:03:35  lmjm
# Need the local hostname to skip local packages.
# Cleaned up the pretty printer.
# Tried to make the trace printing make more sense.
#
# Revision 1.33  1992/08/12  14:33:39  lmjm
# Corrected some typos.
# Now scans for programs so doesn't rely so heavily on builtins.
# Reduced prod_interval.
# Added dir from mirror's full path into @INC
# Allow $me to come from LOGNAME
# Allow deletes to be saved away.
# Added max_delete_files and dirs - to limit deletions.
# Added local->remote path mappings.
# Added -gsite:packge option.
# Cleaned up all the logging.
#
# Revision 1.32  1992/03/20  21:01:07  lmjm
# Cleaned up disconnect on error code.
# Allow for uncompressing listing files.
# Black magic the mail_prog variable to allow for more meaningful subject lines.
# Added the TEMPORARY flag really_do_deletes
# Added proxy code from Edwards Reed.
# Added flags_recursive and flags_nonrecursive.
# Added delete_source
# Added disconnect - force close at end of package even next package at same site
# Allow variables to be read from a file if first char is a <
#
# Revision 1.31  1992/02/06  23:25:58  lmjm
# Use /usr/bin/perl.
# Added -L option.
# Use new ftp.pl routines
#
# Revision 1.30  1992/01/14  11:02:55  lmjm
# Corrected '-s arg' in mail_prog.
# Added local_ls_lR_file - useful when first copying a large remote package
# Corrected set_assoc_from_array.
#
# Revision 1.29  1991/12/18  16:58:04  lmjm
# Just have a mail_prog variable with the '-s subject' as part of it.
# Start on new -M option, load the mirror.defaults file and scan
#  packages dir.
# Added -Rpackage - like -p but restarts a full-pull from that package.
# Get the chdir in the right place so <> doesn't bomb.
#
# Revision 1.28  1991/12/06  18:13:48  lmjm
# DONT use if( $path ) as a test to see if path is there.  Fails if path
# is the pathname "0" !!!
#
# Revision 1.27  1991/12/03  15:00:47  lmjm
# Moved boolean_values and packages into an associative array, for speed.
#
# Revision 1.26  1991/12/03  13:52:54  lmjm
# Added a chdir to make sure that <> works ok.
# Added in patches from Amos to speed up the greps and fix splits.
# Made the error prints for split's more helpful.
#
# Revision 1.25  1991/11/27  22:06:01  lmjm
# Allow the associative arrays to be held in files - for very large directories.
# Allow files to be split up.
# Added 'a' to ls options.
# Don't use filenames in printf format strings! (may contain a %)
# Prod the remote server every once and a while to keep the connection open.
#
# Revision 1.24  1991/10/23  22:42:26  lmjm
# Upped the timeout.
# Turned buffering back on again.  I was mistaken in what effect it was having.
# Call chat'close where necessary.
# Added ls_lR_file option.
# Try and allow for time zone changes when comparing dates.
#
# Revision 1.23  1991/10/07  18:30:39  lmjm
# Added restarts.
# Some more patches from Amos Shapira to correct somewhat dumb confile file loop.
# Also now uses the value not the default value in key+value operations.
# Neatened up error messages
#
# Revision 1.22  1991/10/02  14:48:49  lmjm
# Corrected escaping of values.
# Corrected use of ftp'restart (patch from Amos Shapira)
# Corrected $user and $group resetting and arguments to chgrp.
#
# Revision 1.21  1991/09/24  01:21:20  lmjm
# Look at the right var to decide if there is mail to send.
#
# Revision 1.20  1991/09/20  22:31:19  lmjm
# Make the output look prettier!
# Corrected some typos.
#
# Revision 1.19  1991/09/20  21:13:09  lmjm
# Gave -U a default.
#
# Revision 1.18  1991/09/20  20:55:34  lmjm
# Added an -Ufile option just to record uploads.
#
# Revision 1.17  1991/09/17  22:53:18  lmjm
# Avoid the CHMOD check unless necessary
# More playing with debug levels.
# Added back in the timestamp code.
#
# Revision 1.16  1991/09/12  22:40:27  lmjm
# Changed arguments over to be more compatible with the original.
# Don't mirror a remote site if it is really the local host!
# Added deletion code.
# Made prompt for password more meaningful.
#
# Revision 1.15  1991/09/06  19:53:54  lmjm
# Merged in considerable changes by Alan Martllo for sending files,
# plus command line work, plus internal changes to work as a series of steps...
# Changed debug printing to be a little more appropriate.
#
# Revision 1.14  1991/09/04  14:17:02  lmjm
# Made debug level 1 more useful.
# Print site:remote_dir (not local_dir) in messages.
#
# Revision 1.13  1991/08/29  16:23:53  lmjm
# Added some new keywords.
# Stay connected to the site when done in case next entry is from the same
# site.
# Only die on really fatal errors.
# Treat symlinks more like files when checking it.
#
# Revision 1.12  1991/08/21  10:45:58  lmjm
# Allow for line continuation (& at end of line)
# Don't create local dirs or symlinks when -n turned on.
#
# Revision 1.11  1991/08/20  11:51:52  lmjm
# added more detail to the log and mail messages.
# Correct the timestamp code.
#
# Revision 1.10  1991/08/19  09:53:41  lmjm
# Corrected -p, was pushing wrong variable
#
# Revision 1.9  1991/08/16  22:30:06  lmjm
# Added -v option to print the version.
#
# Revision 1.8  1991/08/16  22:17:45  lmjm
# Added the -T option to re-timestamp the local archive.
# Check the argument to the -p flag.
# Added the update_local option.
# Allow key+value
# Tried to make the logging messages more meaningful.
#
# Revision 1.7  1991/08/14  21:02:47  lmjm
# Implement mail_to, update_log, compress_patt and compress_excl
# Local directory scaned by direct perl.
# Allow for unreadable files.
#
# Revision 1.6  1991/08/14  17:50:14  lmjm
# Short circuit mkdirs if the path already exists.
# Added in the compression code.
#
# Revision 1.5  1991/08/09  22:31:01  lmjm
# Added a simple name_mappings (it can be a single s/// expression)
# get_file via a temp file
# Corrected (YET AGAIN) the max_age code.
# Made mkdirs more sensible.
#
# Revision 1.4  1991/08/09  21:35:02  lmjm
# Parse args rather than use -s.
# Added -pPackage arg to limit packages looked at.
# Reset all the logging levels.
#
# Revision 1.3  1991/08/09  20:10:15  lmjm
# Now use the package keyword to name entries.
# Don't recurse by setting a suitable exclude_patt
# Corrected age checking and null directory creation.
#
# Revision 1.2  1991/08/09  18:06:56  lmjm
# Call chown/chgrp if necessary.
# Quit remote site correctly
# Compared time the wrong way around
# Create dirs/symlinks locally.
# Set file/dir modes
#
# Revision 1.1  1991/08/08  20:19:27  lmjm
# Initial revision
