1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-12-01 13:24:25 +01:00

Added symstore script.

This commit is contained in:
David Anderson 2008-11-18 05:23:58 -06:00
parent b77a352f7e
commit a08dc6056a

64
support/buildbot/symstore.pl Executable file
View File

@ -0,0 +1,64 @@
#!/usr/bin/perl
use File::Basename;
my ($myself, $path) = fileparse($0);
chdir($path);
require 'helpers.pm';
chdir('..');
chdir('..');
our $SSH = 'ssh -i ../../mmspvkey';
#Sync us up with the main symbol store
rsync('sourcemm@alliedmods.net:~/public_html/symbols/', '..\\..\\symstore');
#Get version info
my ($version);
$version = Build::ProductVersion(Build::PathFormat('product.version'));
$version .= '-hg' . Build::HgRevNum('.');
symstore("loader\\msvc9\\server.*", $version);
symstore("core-legacy\\msvc9\\Release\\metamod.1.ep1.*", $version);
symstore("core\\msvc9\\Release - Orange Box\\metamod.2.ep2.*", $version);
symstore("core\\msvc9\\Release - Left 4 Dead\\metamod.2.l4d.*", $version);
#Lowercase DLLs. Sigh.
my (@files);
opendir(DIR, "..\\..\\symstore");
@files = readdir(DIR);
closedir(DIR);
my ($i, $j, $file, @subdirs);
for ($i = 0; $i <= $#files; $i++)
{
$file = $files[$i];
next unless ($file =~ /\.dll$/);
next unless (-d "..\\..\\symstore\\$file");
opendir(DIR, "..\\..\\symstore\\$file");
@subdirs = readdir(DIR);
closedir(DIR);
for ($j = 0; $j <= $#subdirs; $j++)
{
next unless ($subdirs[$j] =~ /[A-Z]/);
Build::Command("rename ..\\..\\symstore\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
}
}
#Now that we're done, rsync back.
rsync('../../symstore/', 'sourcemm@alliedmods.net:~/public_html/symbols');
sub symstore
{
my ($line, $version) = (@_);
Build::Command("symstore add /r /f \"$line\" /s ..\\..\\symstore /t \"Metamod:Source\" /v \"$version\" /c \"buildbot\"");
}
sub rsync
{
my ($from, $to) = (@_);
Build::Command('rsync -av --delete -e="' . $SSH . '" ' . $from . ' ' . $to);
}