Fix helpers module path lookup on newer Perl versions.

(cherry picked from commit 510454907a)
(cherry picked from commit 3bfd9a1cb7)
This commit is contained in:
Nick Hastings 2022-06-24 10:12:16 -04:00
parent d45dd28e15
commit 80e8ff0be3
4 changed files with 73 additions and 65 deletions

View File

@ -9,6 +9,8 @@ use File::Path;
my ($myself, $path) = fileparse($0); my ($myself, $path) = fileparse($0);
chdir($path); chdir($path);
use FindBin;
use lib $FindBin::Bin;
require 'helpers.pm'; require 'helpers.pm';
#Go back above build dir #Go back above build dir

View File

@ -26,6 +26,8 @@ chomp $ftp_path;
my ($myself, $path) = fileparse($0); my ($myself, $path) = fileparse($0);
chdir($path); chdir($path);
use FindBin;
use lib $FindBin::Bin;
require 'helpers.pm'; require 'helpers.pm';
#Switch to the output folder. #Switch to the output folder.

View File

@ -6,6 +6,8 @@ use File::Basename;
my ($myself, $path) = fileparse($0); my ($myself, $path) = fileparse($0);
chdir($path); chdir($path);
use FindBin;
use lib $FindBin::Bin;
require 'helpers.pm'; require 'helpers.pm';
chdir('../../../OUTPUT'); chdir('../../../OUTPUT');

View File

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