diff --git a/support/buildbot/package.pl b/support/buildbot/package.pl index 55322a9..3a420b9 100755 --- a/support/buildbot/package.pl +++ b/support/buildbot/package.pl @@ -3,6 +3,7 @@ use strict; use Cwd; use File::Basename; +use File::Temp qw/ tempfile :seekable/; use Net::FTP; my ($ftp_file, $ftp_host, $ftp_user, $ftp_pass, $ftp_path, $tag); @@ -70,6 +71,20 @@ else system("zip -r $filename addons"); } +my ($tmpfh, $tmpfile) = tempfile(); +print $tmpfh $filename; +$tmpfh->seek( 0, SEEK_END ); +my $latest = "mmsource-latest-"; +if ($^O eq "darwin") { + $latest .= "mac"; +} +elsif ($^O =~ /MSWin/) { + $latest .= "windows"; +} +else { + $latest .= $^O; +} + my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/); $ftp_path .= "/$major.$minor"; @@ -90,6 +105,8 @@ if ($ftp_path ne '') $ftp->binary(); $ftp->put($filename) or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n"; +$ftp->put($tmpfile, $latest) + or die "Cannot drop file $latest ($ftp_path): " . $ftp->message . "\n"; $ftp->close();