From e2594008c03682b08474d7522b48a0c04fdf5e50 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sun, 30 Apr 2017 19:27:15 -0400 Subject: [PATCH] Add generation of mmsource-latest download. --- support/buildbot/package.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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();