Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 21084
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: blblack [...] gmail.com
Requestors: schwigon [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.03007
Fixed in: 0.03008



Subject: dump_overwrite enlarges file instead of replace
Perl v5.8.7 on Ubuntu 5.10. Repeatedly executing the following script includes already existing file content with the hint # These lines loaded from user-supplied external file: [... previous file contents ...] # End of lines loaded from user-supplied external file instead of overwriting/replacing the files. So the files always grows: -------------------------------- #!/usr/bin/perl -w use strict; use lib "lib"; use DPW::Schema::Dpw; use DBIx::Class::Schema::Loader qw/ make_schema_at /; make_schema_at ( 'DPW::Schema::Dpw', { relationships => 1, debug => 0, dump_directory => './lib', dump_overwrite => 1, # <------ with this }, [ 'dbi:mysql:dpw_dev','login', 'passwd' ], ); --------------------------------
The gist of the issue is that Loader always layers on any external definitions it finds in @INC, and the debug or dump_to_dir output will reflect those contents. Therefore if dump_overwrite is set, and your output directory is in @INC, multiple runs will recurse their outputs as you describe. I'm leaning towards not loading the prior contents in this specific instance (where "this specific instance" means dump_overwrite is set, the output directory is in @INC, and a potential output filename already exists), but the impact on other use cases needs to be considered carefully.
Fixed in 0.03008