-# When creating a pre-release after a normal release, there's nothing to move.
-if ($diffdir ne $dest) {
- chdir($dest) or die $!;
-
- print "Shuffling old files ...\n";
-
- # We need to run this regardless of $lastversion's "pre"ness.
- my @moved_files;
- foreach my $fn (glob('rsync*pre*.tar.gz*'), glob('rsync*pre*-NEWS')) {
- link($fn, "old-previews/$fn") or die $!;
- push(@moved_files, $fn);
- }
-
- if ($version !~ /pre/) {
- foreach my $fn (glob('rsync*.tar.gz*'), glob('rsync*-NEWS')) {
- next if $fn =~ /^rsync.*pre/;
- link($fn, "old-versions/$fn") or die $!;
- push(@moved_files, $fn);
- }
-
- foreach my $fn (glob('rsync*pre*.diffs.gz*')) {
- unlink($fn);
- }
-
- foreach my $fn (glob('rsync*.diffs.gz*')) {
- link($fn, "old-patches/$fn") or die $!;
- push(@moved_files, $fn);
- }
- }
-
- # Optimize our future upload (in the absence of --detect-renamed) by
- # using rsync to hard-link the above files on samba.org.
- system "rsync -avHOC --include='rsync*.gz*' --include='old-*/' --exclude='*' . samba.org:/home/ftp/pub/rsync";
- foreach (@moved_files) {
- unlink($_);
- }
-
- chdir($curdir) or die $!;
-}
-