ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/BDB/BDB.pm
(Generate patch)

Comparing BDB/BDB.pm (file contents):
Revision 1.45 by root, Wed Jul 9 21:16:14 2008 UTC vs.
Revision 1.48 by root, Tue Jul 29 03:33:16 2008 UTC

108no warnings; 108no warnings;
109use strict 'vars'; 109use strict 'vars';
110 110
111use base 'Exporter'; 111use base 'Exporter';
112 112
113our $VERSION;
114
113BEGIN { 115BEGIN {
114 our $VERSION = '1.7'; 116 $VERSION = '1.71';
115 117
116 our @BDB_REQ = qw( 118 our @BDB_REQ = qw(
117 db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect 119 db_env_open db_env_close db_env_txn_checkpoint db_env_lock_detect
118 db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove 120 db_env_memp_sync db_env_memp_trickle db_env_dbrename db_env_dbremove
119 db_open db_close db_compact db_sync db_upgrade 121 db_open db_close db_compact db_sync db_upgrade
570 572
571BerkeleyDB comes in various versions, many of them have minor 573BerkeleyDB comes in various versions, many of them have minor
572incompatibilities. This means that traditional "at least version x.x" 574incompatibilities. This means that traditional "at least version x.x"
573checks are often not sufficient. 575checks are often not sufficient.
574 576
575Example: set the log_autoremove option in a way compatible with <v.47 and 577Example: set the log_autoremove option in a way compatible with <v4.7 and
576v4.7. Note the use of & on the constants to avoid triggering a compiletime 578v4.7. Note the use of & on the constants to avoid triggering a compiletime
577bug when the symbol isn't available. 579bug when the symbol isn't available.
578 580
579 $DB_ENV->set_flags (&BDB::LOG_AUTOREMOVE ) if BDB::VERSION v0, v4.7; 581 $DB_ENV->set_flags (&BDB::LOG_AUTOREMOVE ) if BDB::VERSION v0, v4.7;
580 $DB_ENV->log_set_config (&BDB::LOG_AUTO_REMOVE) if BDB::VERSION v4.7; 582 $DB_ENV->log_set_config (&BDB::LOG_AUTO_REMOVE) if BDB::VERSION v4.7;
613=back 615=back
614 616
615=cut 617=cut
616 618
617sub VERSION { 619sub VERSION {
620 # I was dumb enough to override the VERSION method here, so let's try
621 # to fix it up.
622
623 if ($_[0] eq __PACKAGE__) {
624 $VERSION
625 } else {
618 if (@_ > 0) { 626 if (@_ > 0) {
619 return undef if VERSION_v lt $_[0]; 627 return undef if VERSION_v lt $_[0];
620 if (@_ > 1) { 628 if (@_ > 1) {
621 return undef if VERSION_v ge $_[1]; 629 return undef if VERSION_v ge $_[1];
630 }
622 } 631 }
632
633 VERSION_v
623 } 634 }
624
625 VERSION_v
626} 635}
627 636
628=head3 CONTROLLING THE NUMBER OF THREADS 637=head3 CONTROLLING THE NUMBER OF THREADS
629 638
630=over 4 639=over 4

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines