Ignore:
Timestamp:
2008-08-29T15:07:49+12:00 (16 years ago)
Author:
mdewsnip
Message:

Arrrgghhh, someone uglied up my nice tidy code...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/dbutil.pm

    r17087 r17104  
    3434    my $infodb_file_path = shift(@_);
    3535
    36     if ($infodb_type eq "sqlite") {
     36    if ($infodb_type eq "sqlite")
     37    {
    3738    return &open_infodb_write_handle_sqlite($infodb_file_path);
    3839    }
    39     elsif ($infodb_type eq "gdbm") {
     40    elsif ($infodb_type eq "gdbm")
     41    {
    4042    return &open_infodb_write_handle_gdbm($infodb_file_path);
    4143    }
    4244
    43     # Use text (gzipped) version ready for convertion to GDBM
     45    # Use text (gzipped) version ready for conversion to GDBM
    4446    # if the infodb type is empty or not one of the values above
    4547    return &open_infodb_write_handle_gdbm_txtgz($infodb_file_path);
     
    5254    my $infodb_handle = shift(@_);
    5355
    54     if ($infodb_type eq "sqlite") {
     56    if ($infodb_type eq "sqlite")
     57    {
    5558    return &close_infodb_write_handle_sqlite($infodb_handle);
    5659    }
    57     elsif ($infodb_type eq "gdbm") {
     60    elsif ($infodb_type eq "gdbm")
     61    {
    5862    return &close_infodb_write_handle_gdbm($infodb_handle);
    5963    }
    6064
    61     # Use text (gzipped) version ready for convertion to GDBM
     65    # Use text (gzipped) version ready for conversion to GDBM
    6266    # if the infodb type is empty or not one of the values above return
    63 
    64     &close_infodb_write_handle_gdbm_txtgz($infodb_handle); }
     67    &close_infodb_write_handle_gdbm_txtgz($infodb_handle);
     68}
    6569
    6670
     
    8185    return &get_infodb_file_path_sqlite($collection_name, $infodb_directory_path);
    8286    }
    83     elsif ($infodb_type eq "gdbm") {
     87    elsif ($infodb_type eq "gdbm")
     88    {
    8489    return &get_infodb_file_path_gdbm($collection_name, $infodb_directory_path);
    8590    }
    8691
    87     # Use text (gzipped) version ready for convertion to GDBM
     92    # Use text (gzipped) version ready for conversion to GDBM
    8893    # if the infodb type is empty or not one of the values above return
    89 
    9094    return &get_infodb_file_path_gdbm_txtgz($collection_name, $infodb_directory_path);
    9195}
    9296
    9397
    94 
    95 
    9698sub read_infodb_file
    9799{
     
    104106    return &read_infodb_file_sqlite($infodb_file_path, $infodb_map);
    105107    }
    106     elsif ($infodb_type eq "gdbm") {
     108    elsif ($infodb_type eq "gdbm")
     109    {
    107110    return &read_infodb_file_gdbm($infodb_file_path, $infodb_map);
    108111    }
    109112
    110     # Use text (gzipped) version ready for convertion to GDBM
     113    # Use text (gzipped) version ready for conversion to GDBM
    111114    # if the infodb type is empty or not one of the values above return
    112 
    113115    return &read_infodb_file_gdbm_txtgz($infodb_file_path, $infodb_map);
    114116}
     
    126128    return &write_infodb_entry_sqlite($infodb_handle, $infodb_key, $infodb_map);
    127129    }
    128     elsif ($infodb_type eq "gdbm") {
     130    elsif ($infodb_type eq "gdbm")
     131    {
    129132    return &write_infodb_entry_gdbm($infodb_handle, $infodb_key, $infodb_map);
    130133    }
    131134
    132     # Use text (gzipped) version ready for convertion to GDBM
     135    # Use text (gzipped) version ready for conversion to GDBM
    133136    # if the infodb type is empty or not one of the values above return
    134137    return &write_infodb_entry_gdbm_txtgz($infodb_handle, $infodb_key, $infodb_map);
     
    165168}
    166169
     170
    167171sub close_infodb_write_handle_gdbm_txtgz
    168172{
     
    281285
    282286
    283 
    284 
    285287sub read_infodb_file_gdbm
    286288{
     
    350352
    351353
    352 
    353354sub close_infodb_write_handle_sqlite
    354355{
     
    374375    return &util::filename_cat($infodb_directory_path, $infodb_file_name);
    375376}
    376 
    377377
    378378
Note: See TracChangeset for help on using the changeset viewer.