From beba03292a3b03d2ce7920763f24c2ec9cc59e0d Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Mon, 26 Oct 2015 11:10:27 -0700 Subject: [PATCH] Upload sourcemod-latest- text file when packaging. --- tools/buildbot/package.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/buildbot/package.pl b/tools/buildbot/package.pl index f07b81f9..a8d20c55 100755 --- a/tools/buildbot/package.pl +++ b/tools/buildbot/package.pl @@ -4,6 +4,7 @@ use strict; use Cwd; use File::Basename; use File::stat; +use File::Temp qw/ tempfile :seekable/; use Net::FTP; use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; use Time::localtime; @@ -131,6 +132,20 @@ else system("zip -r $filename addons cfg"); } +my ($tmpfh, $tmpfile) = tempfile(); +print $tmpfh $filename; +$tmpfh->seek( 0, SEEK_END ); +my $latest = "sourcemod-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"; @@ -151,6 +166,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();