support/buildbot/symstore.pl
author Nicholas Hastings <skamonkey@gmail.com>
Wed May 21 17:26:09 2014 -0400 (2014-05-21)
changeset 917 95639ee45d3d
parent 900 d0dc7d55ade4
permissions -rwxr-xr-x
Trigger build for hl2sdk-l4d changes.
     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 open(PDBLOG, '../OUTPUT/pdblog.txt') or die "Could not open pdblog.txt: $!\n";
    14 
    15 #Get version info
    16 my ($version);
    17 $version = Build::ProductVersion(Build::PathFormat('product.version'));
    18 $version =~ s/-dev//g;
    19 $version .= '-hg' . Build::HgRevNum('.');
    20 
    21 my ($build_type);
    22 $build_type = Build::GetBuildType(Build::PathFormat('support/buildbot/build_type'));
    23 
    24 if ($build_type eq "dev")
    25 {
    26 	$build_type = "buildbot";
    27 }
    28 elsif ($build_type eq "rel")
    29 {
    30 	$build_type = "release";
    31 }
    32 
    33 my ($line);
    34 while (<PDBLOG>)
    35 {
    36 	$line = $_;
    37 	$line =~ s/\.pdb/\*/;
    38 	chomp $line;
    39 	Build::Command("symstore add /r /f \"..\\OUTPUT\\$line\" /s \"S:\\mmsource\" /t \"Metamod:Source\" /v \"$version\" /c \"$build_type\"");
    40 }
    41 
    42 close(PDBLOG);
    43 
    44 #Lowercase DLLs.  Sigh.
    45 my (@files);
    46 opendir(DIR, "S:\\mmsource") or die "Could not open mmsource symbol folder: $!\n";
    47 @files = readdir(DIR);
    48 closedir(DIR);
    49 
    50 my ($i, $j, $file, @subdirs);
    51 for ($i = 0; $i <= $#files; $i++)
    52 {
    53 	$file = $files[$i];
    54 	next unless ($file =~ /\.dll$/);
    55 	next unless (-d "S:\\mmsource\\$file");
    56 	opendir(DIR, "S:\\mmsource\\$file") or die "Could not open S:\\mmsource\\$file: $!\n";
    57 	@subdirs = readdir(DIR);
    58 	closedir(DIR);
    59 	for ($j = 0; $j <= $#subdirs; $j++)
    60 	{
    61 		next unless ($subdirs[$j] =~ /[A-Z]/);
    62 		Build::Command("rename S:\\mmsource\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
    63 	}	
    64 }
    65