mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-27 23:35:36 +03:00
Upload amxmodx-latest-<package>-<os> text file when packaging. (#585)
This commit is contained in:
parent
7e23047c53
commit
ac64ef041b
@ -5,6 +5,7 @@ use strict;
|
|||||||
use Cwd;
|
use Cwd;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use File::stat;
|
use File::stat;
|
||||||
|
use File::Temp qw/ tempfile :seekable/;
|
||||||
use Net::FTP;
|
use Net::FTP;
|
||||||
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
|
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
|
||||||
use Time::localtime;
|
use Time::localtime;
|
||||||
@ -126,17 +127,30 @@ if ($ftp_path ne '')
|
|||||||
$ftp->binary();
|
$ftp->binary();
|
||||||
for ($i = 0; $i <= $#packages; $i++) {
|
for ($i = 0; $i <= $#packages; $i++) {
|
||||||
my ($filename);
|
my ($filename);
|
||||||
|
my ($latest);
|
||||||
if ($^O eq "linux") {
|
if ($^O eq "linux") {
|
||||||
$filename = "amxmodx-$version-" . $packages[$i] . "-linux.tar.gz";
|
$filename = "amxmodx-$version-" . $packages[$i] . "-linux.tar.gz";
|
||||||
|
$latest = "amxmodx-latest-" . $packages[$i] . "-linux";
|
||||||
} elsif ($^O eq "darwin") {
|
} elsif ($^O eq "darwin") {
|
||||||
next if ($packages[$i] ~~ @mac_exclude);
|
next if ($packages[$i] ~~ @mac_exclude);
|
||||||
$filename = "amxmodx-$version-" . $packages[$i] . "-mac.zip";
|
$filename = "amxmodx-$version-" . $packages[$i] . "-mac.zip";
|
||||||
|
$latest = "amxmodx-latest-" . $packages[$i] . "-mac";
|
||||||
} else {
|
} else {
|
||||||
$filename = "amxmodx-$version-" . $packages[$i] . "-windows.zip";
|
$filename = "amxmodx-$version-" . $packages[$i] . "-windows.zip";
|
||||||
|
$latest = "amxmodx-latest-" . $packages[$i] . "-windows";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my ($tmpfh, $tmpfile) = tempfile();
|
||||||
|
print $tmpfh $filename;
|
||||||
|
$tmpfh->seek( 0, SEEK_END );
|
||||||
|
|
||||||
print "Uploading $filename...\n";
|
print "Uploading $filename...\n";
|
||||||
$ftp->put($filename)
|
$ftp->put($filename)
|
||||||
or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n";
|
or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n";
|
||||||
|
|
||||||
|
print "Uploading $latest...\n";
|
||||||
|
$ftp->put($tmpfile, $latest)
|
||||||
|
or die "Cannot drop file $latest ($ftp_path): " . $ftp->message . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$ftp->close();
|
$ftp->close();
|
||||||
|
Loading…
Reference in New Issue
Block a user