support/buildbot/symstore.pl
author Scott Ehlert <ds@alliedmods.net>
Sat May 22 00:45:44 2010 -0500 (2010-05-22)
changeset 716 6925fbd2b9fa
parent 704 6055e296b807
child 742 f38fc2289fa5
permissions -rwxr-xr-x
Added Mac OS X build support to stub/sample plugin makefiles (bug 4391, r=dvander).
     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 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 =~ s/-dev//g;
    24 $version .= '-hg' . Build::HgRevNum('.');
    25 
    26 my ($build_type);
    27 $build_type = Build::GetBuildType(Build::PathFormat('support/buildbot/build_type'));
    28 
    29 if ($build_type eq "dev")
    30 {
    31 	$build_type = "buildbot";
    32 }
    33 elsif ($build_type eq "rel")
    34 {
    35 	$build_type = "release";
    36 }
    37 
    38 my ($line);
    39 while (<PDBLOG>)
    40 {
    41 	$line = $_;
    42 	$line =~ s/\.pdb/\*/;
    43 	chomp $line;
    44 	Build::Command("symstore add /r /f \"..\\OUTPUT\\$line\" /s ..\\..\\symstore /t \"Metamod:Source\" /v \"$version\" /c \"$build_type\"");
    45 }
    46 
    47 close(PDBLOG);
    48 
    49 #Lowercase DLLs.  Sigh.
    50 my (@files);
    51 opendir(DIR, "..\\..\\symstore");
    52 @files = readdir(DIR);
    53 closedir(DIR);
    54 
    55 my ($i, $j, $file, @subdirs);
    56 for ($i = 0; $i <= $#files; $i++)
    57 {
    58 	$file = $files[$i];
    59 	next unless ($file =~ /\.dll$/);
    60 	next unless (-d "..\\..\\symstore\\$file");
    61 	opendir(DIR, "..\\..\\symstore\\$file");
    62 	@subdirs = readdir(DIR);
    63 	closedir(DIR);
    64 	for ($j = 0; $j <= $#subdirs; $j++)
    65 	{
    66 		next unless ($subdirs[$j] =~ /[A-Z]/);
    67 		Build::Command("rename ..\\..\\symstore\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
    68 	}	
    69 }
    70 
    71 #Now that we're done, rsync back.
    72 rsync('../../symstore/', '[email protected]:~/public_html/symbols');
    73 
    74 sub rsync
    75 {
    76 	my ($from, $to) = (@_);
    77 	
    78 	Build::Command('rsync -av --delete -e="' . $SSH . '" ' . $from . ' ' . $to);
    79 }