support/buildbot/symstore.pl
author David Anderson <dvander@alliedmods.net>
Wed Apr 28 23:44:56 2010 -0700 (2010-04-28)
changeset 700 a4f2bccd3ac0
parent 674 c4ed595f6248
child 704 6055e296b807
permissions -rwxr-xr-x
Triggering the build.
     1 #!/usr/bin/perl
     2 
     3 use File::Basename;
     4 
     5 my ($myself, $path) = fileparse($0);
     6 chdir($path);
     7 
     8 require 'helpers.pm';
     9 
    10 chdir('..');
    11 chdir('..');
    12 
    13 our $SSH = 'ssh -i ../../mmspvkey';
    14 
    15 #Sync us up with the main symbol store
    16 rsync('[email protected]:~/public_html/symbols/', '..\\..\\symstore');
    17 
    18 #Get version info
    19 my ($version);
    20 $version = Build::ProductVersion(Build::PathFormat('product.version'));
    21 $version .= '-hg' . Build::HgRevNum('.');
    22 
    23 symstore("loader\\msvc9\\server.*", $version);
    24 symstore("core-legacy\\msvc9\\Release\\metamod.1.ep1.*", $version);
    25 symstore("core\\msvc9\\Release - Dark Messiah\\metamod.2.darkm.*", $version);
    26 symstore("core\\msvc9\\Release - Orange Box\\metamod.2.ep2.*", $version);
    27 symstore("core\\msvc9\\Release - Orange Box Valve\\metamod.2.ep2v.*", $version);
    28 symstore("core\\msvc9\\Release - Left 4 Dead\\metamod.2.l4d.*", $version);
    29 symstore("core\\msvc9\\Release - Left 4 Dead 2\\metamod.2.l4d2.*", $version);
    30 
    31 #Lowercase DLLs.  Sigh.
    32 my (@files);
    33 opendir(DIR, "..\\..\\symstore");
    34 @files = readdir(DIR);
    35 closedir(DIR);
    36 
    37 my ($i, $j, $file, @subdirs);
    38 for ($i = 0; $i <= $#files; $i++)
    39 {
    40 	$file = $files[$i];
    41 	next unless ($file =~ /\.dll$/);
    42 	next unless (-d "..\\..\\symstore\\$file");
    43 	opendir(DIR, "..\\..\\symstore\\$file");
    44 	@subdirs = readdir(DIR);
    45 	closedir(DIR);
    46 	for ($j = 0; $j <= $#subdirs; $j++)
    47 	{
    48 		next unless ($subdirs[$j] =~ /[A-Z]/);
    49 		Build::Command("rename ..\\..\\symstore\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
    50 	}	
    51 }
    52 
    53 #Now that we're done, rsync back.
    54 rsync('../../symstore/', '[email protected]:~/public_html/symbols');
    55 
    56 sub symstore
    57 {
    58 	my ($line, $version) = (@_);
    59 	Build::Command("symstore add /r /f \"$line\" /s ..\\..\\symstore /t \"Metamod:Source\" /v \"$version\" /c \"buildbot\"");
    60 }
    61 
    62 sub rsync
    63 {
    64 	my ($from, $to) = (@_);
    65 	
    66 	Build::Command('rsync -av --delete -e="' . $SSH . '" ' . $from . ' ' . $to);
    67 }