Wayne Davison [Mon, 24 Jan 2005 01:41:51 +0000 (01:41 +0000)]
Moved a call to add_cvs_exclude() from the delete code to one code-
path in this file. This avoids a potential duplication of the
cvs-excludes that would occur in the old logic.
Wayne Davison [Sat, 22 Jan 2005 22:48:34 +0000 (22:48 +0000)]
- We now set a delete_before variable for the --delete option.
- Reordered some of the options in the --help list.
- Made the popt-handling of the delete options simpler.
- Parse the new --keep-dirs option.
- Parse the new --list-only option.
- Set recurse to -1 (infinite) for the -r and -a options.
- Set keep_dirs for --list-only.
Wayne Davison [Sat, 22 Jan 2005 22:48:31 +0000 (22:48 +0000)]
- Implemented a new handling of the recurse variable: if it is
< 0, it specifies infinite recursion, otherwise it contains a
count of how many levels of recursion we will allow.
- If the user is processing/listing a non-recursive directory/
arg, send the contents.
Wayne Davison [Sat, 22 Jan 2005 22:48:27 +0000 (22:48 +0000)]
- Mustn't override a user-specified list_only value.
- Moved the computing of the options for the server down until
after we've figured out the protocol_version for the transfer.
- If we're talking to a protocol-29 server in list-only mode,
force the new --list-only mode (which avoids the -r with
--exclude="/*/*" kluge).
- Output the options we sent to the daemon if verbose > 1.
Wayne Davison [Thu, 20 Jan 2005 23:51:57 +0000 (23:51 +0000)]
In delete_file(): got rid of DEL_NO_RECURSE code and added
DEL_RECURSE code. Improved the verbose output of a recursively
deleted directory when --dry-run is specified.
Wayne Davison [Wed, 19 Jan 2005 21:00:26 +0000 (21:00 +0000)]
A perl script that outputs excludes for all mount points that affect
the supplied source dir (or all mount points if the arg is omitted).
The excludes are appropriately anchored relative to the supplied dir,
and honor rsync's trailing-slash idiom.
Wayne Davison [Wed, 19 Jan 2005 20:11:03 +0000 (20:11 +0000)]
- Updated delete_file() to take a flag arg that makes it more
flexible. Optimized away a stat() call since the caller knows
if the item to delete is a directory or not.
- Tweaked delete_file()'s "deleting ..." messages to include a
trailing slash when we're deleting a directory.
- No need for conditional code around do_lstat() anymore.
Wayne Davison [Wed, 19 Jan 2005 00:24:35 +0000 (00:24 +0000)]
Use the new "keep_dirs" var instead of separately checking the
"recurse" and "files_from" vars. This also simplifies the case
where the code wants to send the implied dirs without recursing.
Wayne Davison [Wed, 19 Jan 2005 00:23:32 +0000 (00:23 +0000)]
- Added new int, keep_dirs, which is set if either recurse or
files_from was specified.
- Pass the the sender the --no-implied-dirs option if --relative
was specified (or implied) and the sender is not the client.
Wayne Davison [Mon, 17 Jan 2005 23:11:26 +0000 (23:11 +0000)]
For --inplace over protocol-version 29 or greater, read the
type the type of basis file the generator is using from the
socket and set the new updating_basis_file var.
Wayne Davison [Mon, 17 Jan 2005 22:51:17 +0000 (22:51 +0000)]
- Changed the map_size parameter to map_file() to be an int32 named
"read_size".
- Changed some int vars in map_ptr() needed to be int32 vars.
- All callers expect map_ptr() to return back the full "len" bytes,
so we never shorten this value, even near EOF--the read will
just get zero-padded, as needed.
- Die with an error if someone calls map_ptr() with a len < 0, or
if read_size is computed as a value < 0.
Wayne Davison [Mon, 17 Jan 2005 22:51:15 +0000 (22:51 +0000)]
- Incremented the PROTOCOL_VERSION to 29.
- Added define for MAX_BLOCK_SIZE.
- Reorder the variables in the structure defs to sort by size.
- Some vars in map_struct needed to be int32 instead of int.
Wayne Davison [Fri, 14 Jan 2005 18:20:46 +0000 (18:20 +0000)]
Make sure that the presence of a partial-dir file is noted, even
if --whole-file is in effect. Also needed to force statret to 0
when using a partial-dir file.
Wayne Davison [Thu, 13 Jan 2005 22:01:56 +0000 (22:01 +0000)]
Aid forward-compatibility in the include/exclude syntax by putting
a "- " in front of any name that starts with a '+' or a '-' and would
otherwise be unprefixed (the old code only did this if the '+' or '-'
was followed by a space).
Wayne Davison [Wed, 12 Jan 2005 19:20:07 +0000 (19:20 +0000)]
- Allow multiple source paths to be specified (and checked).
- Allow spaces and a few other extra chars in file names.
- For safety, disallow any option that takes an arg. This should
be improved in the future because it blocks options such as
--block-size=N, but without this rule the user could specify
something like --files-from=FILE or --backup-dir=DIR and have
it affect files outside the desired SUBDIR restriction.
- Switched to SSH_CONNECTION from the deprecated SSH_CLIENT.
- Strip "::ffff:" from the start of an IP from SSH_CONNECTION.
Wayne Davison [Mon, 10 Jan 2005 20:52:08 +0000 (20:52 +0000)]
Fixed the file_checksum1() function that is compiled only when
TEST_MDFOUR is defined: it did not have the fix that the main
rsync code got back in protocol 27 to properly handle files
that are a multiple of 64-bytes long.
Wayne Davison [Mon, 10 Jan 2005 10:03:10 +0000 (10:03 +0000)]
- Call finish_transfer() with its new arg. This ensures that we only
create a backup file if we're about to overwrite the basis file.
- Only clear make_backups for the redo phase if partial_dir isn't set.
Wayne Davison [Mon, 10 Jan 2005 00:31:55 +0000 (00:31 +0000)]
Moved the reading of the final MSG_DONE message here from main.c
(this message comes from the receiver). This ensures that any
redo-pass files and delete-after processing are known to be done
prior to the start of our hard-link and dir-time-munging loops.
Wayne Davison [Mon, 10 Jan 2005 00:31:55 +0000 (00:31 +0000)]
Moved the reading of the final MSG_DONE message from here to
generator.c (the message comes from the receiver). This ensures
that any redo-pass files and delete-after processing are known to be
done prior to the start of the hard-link and dir-time-munging loops.