-print $note;
-
-system "patches/verify-patches -pun -an";
-
-chdir($releasedir) or die $!;
-
-print $dots;
-
-mkdir("rsync-$version", 0755) or die $!;
-system "rsync -aC --exclude=.cvsignore rsync/ rsync-$version";
-
-# When creating a pre-release after a normal release, there's nothing to move.
-if ($diffdir ne $dest) {
- chdir($dest) or die $!;
-
- # 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')) {
- link($fn, "old-versions/$fn") or die $!;
- push(@moved_files, $fn);
- }
+system "git commit -a -m 'Preparing for release of $version'" and exit 1;
+print "\nSign the tag:";
+system "git tag -s -m 'Version $version.' v$version" and exit 1;
+
+# Extract the generated files from the old tar.
+@_ = @extra_files;
+map { s#^#rsync-$lastversion/# } @_;
+system "tar xzf $lasttar_file @_";
+rename("rsync-$lastversion", 'a');
+
+print "Creating $diff_file ...\n";
+system "./config.status Makefile; make gen; rsync -a @extra_files b/";
+my $sed_script = 's:^((---|\+\+\+) [ab]/[^\t]+)\t.*:\1:';
+system "(git diff v$lastversion v$version; diff -upN a b | sed -r '$sed_script') | gzip -9 >$diff_file";
+system "rm -rf a";
+rename('b', "rsync-$version");
+
+print "Creating $srctar_file ...\n";
+system "git archive --format=tar --prefix=rsync-$version/ v$version | tar xf -";
+system "support/git-set-file-times --prefix=rsync-$version/";
+system "fakeroot tar czf $srctar_file rsync-$version; rm -rf rsync-$version";
+
+mkdir("rsync-$version", 0755);
+mkdir("rsync-$version/patches", 0755);
+system "support/patch-update --skip-check --gen=rsync-$version/patches";
+system "fakeroot tar chzf $pattar_file rsync-$version/patches; rm -rf rsync-$version";
+
+print "Updating the other files in $dest ...\n";
+system "rsync -a README NEWS OLDNEWS TODO $dest";
+unlink($news_file);
+link("$dest/NEWS", $news_file);
+system "git log --name-status | gzip -9 >$dest/ChangeLog.gz";
+
+system "yodl2html -o $dest/rsync.html rsync.yo";
+system "yodl2html -o $dest/rsyncd.conf.html rsyncd.conf.yo";
+
+my $cnt = 0;
+print "\n";
+foreach my $fn ($srctar_file, $pattar_file, $diff_file) {
+ print ++$cnt, ". Sign file \"$fn\":";
+ system "gpg -ba $fn";
+}