summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2014-02-26 13:44:01 -0800
committerWayne Davison <wayned@samba.org>2014-02-26 14:00:10 -0800
commite1bfdf67f3944e4f23202943cc5f535b4b66ee57 (patch)
tree8f189e54c40c0f71088668e0a8225a300ecd5ce5
parent3fe686b577132243d90e0d807b0f592ddfee7dc2 (diff)
downloadrsync-e1bfdf67f3944e4f23202943cc5f535b4b66ee57.tar.gz
rsync-e1bfdf67f3944e4f23202943cc5f535b4b66ee57.tar.bz2
rsync-e1bfdf67f3944e4f23202943cc5f535b4b66ee57.zip
Avoid the use of an extra leading dot when using --temp-dir.
-rw-r--r--NEWS3
-rw-r--r--receiver.c9
-rw-r--r--rsync.yo3
3 files changed, 12 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index bef1944a..9407d3ca 100644
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,9 @@ Changes since 3.1.0:
ENHANCEMENTS:
+ - Tweaked the temp-file naming when --temp-dir=DIR is used: the temp-file
+ names with not get an extra leading '.' prepended.
+
- Added the support/rsync-no-vanished wrapper script.
- Made configure more prominently mention when we failed to find yodl (in
diff --git a/receiver.c b/receiver.c
index 413c31cd..39f66274 100644
--- a/receiver.c
+++ b/receiver.c
@@ -113,9 +113,12 @@ int get_tmpname(char *fnametmp, const char *fname, BOOL make_unique)
}
} else
f = fname;
- if (*f == '.') /* avoid an extra leading dot for OS X's sake */
- f++;
- fnametmp[length++] = '.';
+
+ if (!tmpdir) { /* using a tmpdir avoids the leading dot on our temp names */
+ if (*f == '.') /* avoid an extra leading dot for OS X's sake */
+ f++;
+ fnametmp[length++] = '.';
+ }
/* The maxname value is bufsize, and includes space for the '\0'.
* NAME_MAX needs an extra -1 for the name's leading dot. */
diff --git a/rsync.yo b/rsync.yo
index 6295110b..6b558187 100644
--- a/rsync.yo
+++ b/rsync.yo
@@ -1726,6 +1726,9 @@ dit(bf(-T, --temp-dir=DIR)) This option instructs rsync to use DIR as a
scratch directory when creating temporary copies of the files transferred
on the receiving side. The default behavior is to create each temporary
file in the same directory as the associated destination file.
+Beginning with rsync 3.1.1, the temp-file names inside the specified DIR will
+not be prefixed with an extra dot (though they will still have a random suffix
+added).
This option is most often used when the receiving disk partition does not
have enough free space to hold a copy of the largest file in the transfer.