tools/buildbot/symstore.pl
author David Anderson <dvander@alliedmods.net>
Wed Feb 25 19:22:36 2009 -0500 (2009-02-25)
changeset 2603 fa286305bd3f
parent 2395 5f0dcfc72e44
child 2723 d8cde305bb14
permissions -rwxr-xr-x
Allow for second private chat trigger (bug 3667, r,a11=pred).
     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 ../../smpvkey';
    14 
    15 open(PDBLOG, 'OUTPUT/pdblog.txt') or die "Could not open pdblog.txt: $!\n";
    16 
    17 #Sync us up with the main symbol store
    18 rsync('[email protected]:~/public_html/symbols/', '..\\..\\symstore');
    19 
    20 #Get version info
    21 my ($version);
    22 $version = Build::ProductVersion(Build::PathFormat('product.version'));
    23 $version .= '-hg' . Build::HgRevNum('.');
    24 
    25 my ($line);
    26 while (<PDBLOG>)
    27 {
    28 	$line = $_;
    29 	$line =~ s/\.pdb/\*/;
    30 	chomp $line;
    31 	Build::Command("symstore add /r /f \"$line\" /s ..\\..\\symstore /t \"SourceMod\" /v \"$version\" /c \"buildbot\"");
    32 }
    33 
    34 close(PDBLOG);
    35 
    36 #Lowercase DLLs.  Sigh.
    37 my (@files);
    38 opendir(DIR, "..\\..\\symstore");
    39 @files = readdir(DIR);
    40 closedir(DIR);
    41 
    42 my ($i, $j, $file, @subdirs);
    43 for ($i = 0; $i <= $#files; $i++)
    44 {
    45 	$file = $files[$i];
    46 	next unless ($file =~ /\.dll$/);
    47 	next unless (-d "..\\..\\symstore\\$file");
    48 	opendir(DIR, "..\\..\\symstore\\$file");
    49 	@subdirs = readdir(DIR);
    50 	closedir(DIR);
    51 	for ($j = 0; $j <= $#subdirs; $j++)
    52 	{
    53 		next unless ($subdirs[$j] =~ /[A-Z]/);
    54 		Build::Command("rename ..\\..\\symstore\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
    55 	}	
    56 }
    57 
    58 #Now that we're done, rsync back.
    59 rsync('../../symstore/', '[email protected]:~/public_html/symbols');
    60 
    61 sub rsync
    62 {
    63 	my ($from, $to) = (@_);
    64 	
    65 	Build::Command('rsync -av --delete -e="' . $SSH . '" ' . $from . ' ' . $to);
    66 }