Fix helpers module path lookup on newer Perl versions.

This commit is contained in:
Nick Hastings 2021-12-13 13:16:14 -05:00
parent 7328ce657b
commit 547ac5b026
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 to tree root. #Go back to tree root.

View File

@ -29,6 +29,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('tools/buildbot/build_type'));
my ($build_type);
if ($build_type eq "dev") $build_type = Build::GetBuildType(Build::PathFormat('tools/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:\\sourcemod\" /t \"SourceMod\" /v \"$version\" /c \"$build_type\""); $line =~ s/\.pdb/\*/;
} chomp $line;
Build::Command("symstore add /r /f \"..\\OUTPUT\\$line\" /s \"S:\\sourcemod\" /t \"SourceMod\" /v \"$version\" /c \"$build_type\"");
close(PDBLOG); }
#Lowercase DLLs. Sigh. close(PDBLOG);
my (@files);
opendir(DIR, "S:\\sourcemod") or die "Could not open sourcemod symbol folder: $!\n"; #Lowercase DLLs. Sigh.
@files = readdir(DIR); my (@files);
closedir(DIR); opendir(DIR, "S:\\sourcemod") or die "Could not open sourcemod 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:\\sourcemod\\$file"); $file = $files[$i];
opendir(DIR, "S:\\sourcemod\\$file") or die "Could not open S:\\sourcemod\\$file: $!\n"; next unless ($file =~ /\.dll$/);
@subdirs = readdir(DIR); next unless (-d "S:\\sourcemod\\$file");
closedir(DIR); opendir(DIR, "S:\\sourcemod\\$file") or die "Could not open S:\\sourcemod\\$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:\\sourcemod\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j])); {
} next unless ($subdirs[$j] =~ /[A-Z]/);
} Build::Command("rename S:\\sourcemod\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
}
}