{
throws_ok {
- DBM::Deep->new( 't/old_versions/db.0.983' );
+ DBM::Deep->new( 't/old_versions/db-0-983' );
} qr/DBM::Deep: Pre-1.00 file version found/, "Fail if opening a pre-1.00 file";
}
{
throws_ok {
- DBM::Deep->new( 't/old_versions/db.0.99_04' );
+ DBM::Deep->new( 't/old_versions/db-0-99_04' );
} qr/DBM::Deep: Wrong file version found - 1 - expected 2/, "Fail if opening a file version 1";
}
my $mod = $headerver_to_module{ $ver };
require $mod;
$db{input} = $mod->new({
- file => $opts{input},
- locking => 1,
+ file => $opts{input},
+ locking => 1,
autobless => $opts{autobless},
});
$db{input}->lock;
{
my $ver = $opts{version};
- #if ( $ver =~ /^0\.98/ ) {
+ if ( $ver =~ /^0\.98/ ) {
+ $ver = 0;
+ }
+ elsif ( $ver =~ /^0\.99/) {
+ $ver = 1;
+ }
+ elsif ( $ver =~ /^1\.00/) {
+ $ver = 2;
+ }
+ else {
+ _exit( "'$ver' is an unrecognized version." );
+ }
+
if ( $is_dev{ $ver } ) {
_exit( "'$opts{version}' is a dev release and not supported." );
}
my $mod = $headerver_to_module{ $ver };
require $mod;
- $db{input} = $mod->new({
- file => $opts{input},
- locking => 1,
+ $db{output} = $mod->new({
+ file => $opts{output},
+ locking => 1,
autobless => $opts{autobless},
});
- $db{input}->lock;
+ $db{output}->lock;
}
# Do the actual conversion