use lib File::Spec->catdir( $FindBin::Bin, '..', 'lib' );
use Getopt::Long qw( GetOptions );
-use Pod::Usage;
+use Pod::Usage 1.3;
my %headerver_to_module = (
'0' => 'DBM::Deep::09830',
- '2' => 'DBM::Deep',
+ '2' => 'DBM::Deep::10002',
+ '3' => 'DBM::Deep',
);
my %is_dev = (
my %opts = (
man => 0,
help => 0,
- version => '1.0000',
- autobless => 0,
+ version => '1.0013',
+ autobless => 1,
);
GetOptions( \%opts,
'input=s', 'output=s', 'version:s', 'autobless:i',
my $mod = $headerver_to_module{ $ver };
eval "use $mod;";
+ if ( $@ ) {
+ _exit( "Cannot load '$mod' to read header version '$ver':\n\t$@" );
+ }
$db{input} = $mod->new({
file => $opts{input},
locking => 1,
{
my $ver = $opts{version};
- if ( $ver =~ /^0\.9[1-8]/ ) {
- $ver = 0;
+ if ( $ver =~ /^1\.001[0-3]/) {
+ $ver = 3;
+ }
+ elsif ( $ver =~ /^1\.000[3-9]/) {
+ $ver = 3;
+ }
+ elsif ( $ver =~ /^1\.000?[0-2]?/) {
+ $ver = 2;
}
elsif ( $ver =~ /^0\.99/) {
$ver = 1;
}
- elsif ( $ver =~ /^1\.000?0?/) {
- $ver = 2;
+ elsif ( $ver =~ /^0\.9[1-8]/ ) {
+ $ver = 0;
}
else {
_exit( "'$ver' is an unrecognized version." );
my $mod = $headerver_to_module{ $ver };
eval "use $mod;";
+ if ( $@ ) {
+ _exit( "Cannot load '$mod' to read header version '$ver':\n\t$@" );
+ }
$db{output} = $mod->new({
file => $opts{output},
locking => 1,
=item B<-autobless>
-In pre-1.0000 versions, autoblessing was an optional setting. This defaults to
-false.
+In pre-1.0000 versions, autoblessing was an optional setting defaulting to
+false. Autobless in upgrade_db.pl defaults to true.
=item B<-help>
=item * Feature support
Not all versions support the same features. In particular, internal references
-were supported in 0.983 and support was removed in 1.000. There is no
+were supported in 0.983, removed in 1.000, and re-added in 1.0003. There is no
detection of this by upgrade_db.pl.
=back