Changeset 30370


Ignore:
Timestamp:
2016-01-12T11:00:53+13:00 (8 years ago)
Author:
jmt12
Message:

Reverting these back to the older but better supported ISA approach to declaring inheritance. Not even sure why I used the new parent mechanism (aside from possibly copying from tutorial)... can I still blame baby brain after 10 months?

Location:
main/trunk/greenstone2/perllib/DBDrivers
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/DBDrivers/70HyphenFormat.pm

    r30355 r30370  
    4646use util;
    4747use FileUtils;
    48 use parent 'DBDrivers::BaseDBDriver';
     48
     49use DBDrivers::BaseDBDriver;
     50
     51BEGIN {
     52    @DBDrivers::70HyphenFormat::ISA = ('DBDrivers::BaseDBDriver');
     53}
    4954
    5055use constant {
  • main/trunk/greenstone2/perllib/DBDrivers/BaseDBDriver.pm

    r30355 r30370  
    528528
    529529
    530 ## @function
    531 #
    532 sub mergeDatabases
    533 {
    534     my $self = shift(@_);
    535     gsprintf(STDERR, (caller(0))[3] . " {common.must_be_implemented}\n");
    536     die("\n");
    537 }
    538 ## mergeDatabase(string, string) => integer ##
    539 
    5405301;
  • main/trunk/greenstone2/perllib/DBDrivers/GDBM.pm

    r30355 r30370  
    2929use strict;
    3030
     31# Libraries
     32use util;
     33use FileUtils;
     34use DBDrivers::70HyphenFormat;
     35
     36
    3137BEGIN
    3238{
     
    3440        die("Error! Environment not prepared. Have you sourced setup.bash?\n");
    3541    }
     42    @DBDrivers::GDBM::ISA = ('DBDrivers::70HyphenFormat');
    3643}
    37 
    38 # Libraries
    39 use util;
    40 use FileUtils;
    41 use parent 'DBDrivers::70HyphenFormat';
    4244
    4345
     
    5052    $self->{'default_file_extension'} = 'gdb';
    5153    # note: file separator agnostic
    52     $self->{'executable_path'} = $ENV{'GSDLHOME'} . '/bin/' . $ENV{'GSDLOS'};
     54    $self->{'executable_path'} = FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, 'bin', $ENV{'GSDLOS'});
    5355    $self->{'read_executable'} = 'db2txt';
    5456    $self->{'keyread_executable'} = 'gdbmkeys';
  • main/trunk/greenstone2/perllib/DBDrivers/GDBMTXTGZ.pm

    r30355 r30370  
    3232use util;
    3333use FileUtils;
    34 # - OO inheritence
    35 use parent 'DBDrivers::70HyphenFormat';
     34use DBDrivers::70HyphenFormat;
     35
     36BEGIN
     37{
     38    @DBDrivers::GDBMTXTGZ::ISA = ('DBDrivers::70HyphenFormat');
     39}
    3640
    3741
     42## Constructor
    3843sub new
    3944{
     
    4348    $self->{'default_file_extension'} = 'txt.gz';
    4449    # note: file separator agnostic
    45     $self->{'executable_path'} = $ENV{'GSDLHOME'} . '/bin/' . $ENV{'GSDLOS'};
     50    $self->{'executable_path'} = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, 'bin', $ENV{'GSDLOS'});
    4651    $self->{'read_executable'} = 'gzip --decompress --to-stdout';
    4752    $self->{'keyread_executable'} = $self->{'read_executable'};
  • main/trunk/greenstone2/perllib/DBDrivers/JDBM.pm

    r30355 r30370  
    3232use util;
    3333use FileUtils;
    34 # - OO inheritence
    35 use parent 'DBDrivers::70HyphenFormat';
     34use DBDrivers::70HyphenFormat;
    3635
    3736sub BEGIN
     
    4039        die("Error! Environment must be prepared by sourcing setup.bash\n");
    4140    }
     41    @DBDrivers::JDBM::ISA = ('DBDrivers::70HyphenFormat');
    4242}
    4343
     
    5858    # Massage paths for Cygwin. Away to run a java program, using a binary that
    5959    # is native to Windows, so need Windows directory and path separators
     60    # Note: this is done after the util::pathname_cat as that fuction can also
     61    # (incorrectly) change file separators.
    6062    if ($^O eq "cygwin") {
    6163    $classpath = `cygpath -wp "$classpath"`;
Note: See TracChangeset for help on using the changeset viewer.