Revision 3728

Date:
2019-10-09 23:59:36
Author:
dsb
Revision Log:
- Small tweaks for varying beta directory naming schemes.
- On the other hand, why are we going to all that effort to find a beta
candidate directory when one is already specified?
Files:

Legend:

 
Added
 
Removed
 
Modified
  • tome2/trunk/unpack-base.pl

     
    28 28 $data{prev}{dir} = $data{prev}{ver};
    29 29 }
    30 30 @ver = T4::all_versions(beta => 1);
    31 if (scalar @ver > 0 && $ver[$#ver] =~ /^(\d+\.\d+\.\d+)b\d+/) {
    31 if (scalar @ver > 0 && $ver[$#ver] =~ /^(\d+\.\d+\.\d+)(?:b|-beta)\d+/) {
    32 32 $data{beta}{ver} = $1;
    33 33 $data{beta}{dir} = $ver[$#ver];
    34 34 }
     
    78 78 my ($tag, $tmpl) = @_;
    79 79 die "??? $tag\n" unless exists $data{$tag};
    80 80 $tmpl =~ s/VER/$data{$tag}{ver}/g;
    81 # First try the provided directory, since we actually went to the trouble
    82 # of finding and/or specifying it.
    83 for my $base (qw(src linux64 linux)) {
    84 my $dir = "$ENV{HOME}/t-engine4-$base-$data{$tag}{dir}/game/";
    85 return $dir . $tmpl if -f $dir . $tmpl;
    86 }
    87 # Then try other stuff.
    81 88 my @cands = ();
    82 89 if (opendir DIR, "$ENV{HOME}") {
    83 90 for (readdir DIR) {
     
    90 97 closedir DIR;
    91 98 }
    92 99 @cands = reverse sort { lc($a) cmp lc($b) } @cands;
    93 unshift @cands, $data{$tag}{dir}, $data{$tag}{ver};
    94 100 for my $dir (@cands) {
    95 101 return $dir . $tmpl if -f $dir . $tmpl;
    96 102 }