Permalink
Browse files

Add generation of mmsource-latest download.

  • Loading branch information...
psychonic committed Apr 30, 2017
1 parent dc371b6 commit e2594008c03682b08474d7522b48a0c04fdf5e50
Showing with 17 additions and 0 deletions.
  1. +17 −0 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 @@
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 @@
$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();

0 comments on commit e259400

Please sign in to comment.