1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-11-29 11:24:19 +01:00
HLMetaModOfficial/support/buildbot/symstore.pl
2014-05-25 12:09:30 -07:00

66 lines
1.4 KiB
Perl
Executable File

#!/usr/bin/perl
use File::Basename;
my ($myself, $path) = fileparse($0);
chdir($path);
require 'helpers.pm';
chdir('..');
chdir('..');
open(PDBLOG, '../OUTPUT/pdblog.txt') or die "Could not open pdblog.txt: $!\n";
#Get version info
my ($version);
$version = Build::ProductVersion(Build::PathFormat('product.version'));
$version =~ s/-dev//g;
$version .= '-git' . Build::GitRevNum('.');
my ($build_type);
$build_type = Build::GetBuildType(Build::PathFormat('support/buildbot/build_type'));
if ($build_type eq "dev")
{
$build_type = "buildbot";
}
elsif ($build_type eq "rel")
{
$build_type = "release";
}
my ($line);
while (<PDBLOG>)
{
$line = $_;
$line =~ s/\.pdb/\*/;
chomp $line;
Build::Command("symstore add /r /f \"..\\OUTPUT\\$line\" /s \"S:\\mmsource\" /t \"Metamod:Source\" /v \"$version\" /c \"$build_type\"");
}
close(PDBLOG);
#Lowercase DLLs. Sigh.
my (@files);
opendir(DIR, "S:\\mmsource") or die "Could not open mmsource symbol folder: $!\n";
@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 "S:\\mmsource\\$file");
opendir(DIR, "S:\\mmsource\\$file") or die "Could not open S:\\mmsource\\$file: $!\n";
@subdirs = readdir(DIR);
closedir(DIR);
for ($j = 0; $j <= $#subdirs; $j++)
{
next unless ($subdirs[$j] =~ /[A-Z]/);
Build::Command("rename S:\\mmsource\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
}
}