Changeset 30265 for gs2-extensions/tdb

Show
Ignore:
Timestamp:
28.09.2015 10:54:14 (4 years ago)
Author:
jmt12
Message:

Rather than assuming something will put the TDB binaries on the main PATH, the code will now use the GEXTTDBEDIT_INSTALLED environment variable to generate the full path to the binaries. Of course, lack of this variable will raise an error

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/tdb/trunk/perllib/dbutil/tdb.pm

    r27401 r30265  
    5454sub get_tdb_executable 
    5555{ 
    56   my $program = shift(@_); 
    57   my $program_exe = &util::filename_cat($program . &util::get_os_exe()); 
    58   #if (!-x $program_exe) 
    59   #{ 
    60   #  die('Fatal Error! File doesn\'t exist or isn\'t executable: ' . $program_exe); 
    61   #} 
    62   return $program_exe; 
     56    my $program = shift(@_); 
     57    if (!defined $ENV{GEXTTDBEDIT_INSTALLED} || !-d $ENV{GEXTTDBEDIT_INSTALLED}) 
     58    { 
     59    die('Fatal Error! Path to TDB binaries not found. Have you sourced setup.bash?'); 
     60    } 
     61    my $program_exe = &util::filename_cat($ENV{GEXTTDBEDIT_INSTALLED} . '/bin/' . $program . &util::get_os_exe()); 
     62    if (!-x $program_exe) 
     63    { 
     64    die('Fatal Error! File doesn\'t exist or isn\'t executable: ' . $program_exe); 
     65    } 
     66    return $program_exe; 
    6367} 
    6468# /** get_tdb_executable() **/