- # 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($_);
+# We want to use our passphrase-providing "gpg" script, so modify the PATH.
+$ENV{PATH} = "$curdir/packaging/bin:$path";
+
+my $passphrase;
+while (1) {
+ ReadMode('noecho');
+ print "\nEnter your GPG pass-phrase: ";
+ chomp($passphrase = <STDIN>);
+ ReadMode(0);
+ print "\n";
+
+ # Briefly create a temp file with the passphrase for git's tagging use.
+ my $oldmask = umask 077;
+ unlink($passfile);
+ open(OUT, '>', $passfile) or die $!;
+ print OUT $passphrase, "\n";
+ close OUT;
+ umask $oldmask;
+ $ENV{'GPG_PASSFILE'} = $passfile;
+
+ $_ = `git tag -s -m 'Version $version.' v$version 2>&1`;
+ print $_;
+ next if /bad passphrase/;
+ exit 1 if /failed/;
+
+ if (-d 'patches/.git') {
+ $_ = `cd patches && git tag -s -m 'Version $version.' v$version 2>&1`;
+ print $_;
+ exit 1 if /bad passphrase|failed/;