"-b --suffix '' --delete --backup-dir /path/" combination does not act as expected

jw schultz jw at pegasys.ws
Fri Aug 1 18:51:53 EST 2003

On Fri, Aug 01, 2003 at 01:21:53AM -0700, Wayne Davison wrote:
> [I apparently lost some of my email that was sent to my samba.org
> address due to some bogus spam filtering involving my use of spamcop.org
> (which I just turned off).  I looked up your reply in a mailing list
> archive on the web...]
> > My only concern is that i don't like depending on
> > strcmp(backup_suffix, BACKUP_SUFFIX).
> The new test is more complex than that (you cited the old test).  The
> new test ensures that we send the suffix value if it differs from the
> default suffix value.  The 3 examples you listed are how the new code
> behaves.

If for some reason they specify
	--suffix=~ --backup-dir=../foo
it should create the backup files with the requested suffix.

It looks like it will behave that way for a pull but not a

In options.c

	if (!backup_suffix)
		backup_suffix = backup_dir ? "" : BACKUP_SUFFIX;

gets it right but

	/* Only send --suffix if it specifies a non-default * value. */
	if (strcmp(backup_suffix, backup_dir? "" : BACKUP_SUFFIX) != 0) {
		args[ac++] = "--suffix";
		args[ac++] = backup_suffix;

doesn't.  We want to send the suffix if they specified one
even if they specified the default.  Otherwise we get
inconsistant behavior.

Sorry to pick nits but this is the kind of inconsistancy
that annoys me.  I ran into the same kind of behavior with
--block-size when i was working on the dynamic checksum
lenghts.  The earlier dynamic block size code made it
impossible to force a fixed 700 byte block size because that
had been the default.

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt

More information about the rsync mailing list