Skip Menu |

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

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

People
Owner: blblack [...] gmail.com
Requestors: tokuhirom+cpan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: add dump_dont_add_dumpdate
DBIC::Schema::Loader updates dumpdate when re-run then Loader. But this feature makes difference from before version at svn for all packages, when I want to update only one schema.This feature daub the svn repos. please the one more option for to avoid this feature. --- lib/DBIx/Class/Schema/Loader/Base.pm.org 2007-07-27 14:24:40.044282418 +0900 +++ lib/DBIx/Class/Schema/Loader/Base.pm 2007-07-27 14:25:31.254484992 +0900 @@ -33,6 +33,7 @@ inflect_plural debug dump_directory + dump_dont_add_dumpdate dump_overwrite really_erase_my_files @@ -480,14 +481,14 @@ $text .= qq|\n\n# Created by DBIx::Class::Schema::Loader| . qq| v| . $DBIx::Class::Schema::Loader::VERSION - . q| @ | . POSIX::strftime('%Y-%m-%d %H:%M:%S', localtime) + . ($self->dump_dont_add_dumpdate ? '' : q| @ | . POSIX::strftime('%Y-%m-%d %H:%M:%S', localtime)) . qq|\n# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:|; open(my $fh, '>', $filename) or croak "Cannot open '$filename' for writing: $!"; # Write the top half and its MD5 sum - print $fh $text . Digest::MD5::md5_base64($text) . "\n\n"; + print $fh $text . Digest::MD5::md5_base64($text) . "\n"; # Write out anything loaded via external partial class file in @INC print $fh qq|$_\n|
I believe imlari is working on the same problem right now, but with a better solution (leaving the date and loader version in the output, but with an option to not update them if the actual output code has not changed), but I don't think he's committed it yet.
From: Sadrak
On Fr. 27. Jul. 2007, 08:29:57, BLBLACK wrote: Show quoted text
> > I believe imlari is working on the same problem right now, but with a > better solution (leaving the date and loader version in the output, but > with an option to not update them if the actual output code has not > changed), but I don't think he's committed it yet.
still interesting ... currently i must make a svn revert when nothing is changed ... perhaps you can read the datetime and check first the new md5 with old date is equal the old md5 ... and dont change the file then.
CC: viorels+cpan [...] gmail.com
Subject: [rt.cpan.org #28501] add dump_dont_add_dumpdate
Date: Sun, 11 Jan 2009 22:20:53 +0200
To: bug-DBIx-Class-Schema-Loader [...] rt.cpan.org
From: Viorel Stirbu <viorels [...] gmail.com>
Hello, One more vote and patch (attached) for this one. The patch compares the auto generated part (until the "Created by ..." line) of the old file and the new generated text. If they match (eq) then skip the file creation part completely (all lines between open and close file). Patch is for file lib/DBIx/Class/Schema/Loader/Base.pm version 0.04005 Please check and apply this patch for next version. Thank you.

Message body is not shown because sender requested not to inline it.

plz add this feature soon! is not very handy with this date in the generated code :-/ On So. 11. Jan. 2009, 15:21:19, viorels@stirbu.name wrote: Show quoted text
> Hello, > > One more vote and patch (attached) for this one. The patch compares the > auto generated part (until the "Created by ..." line) of the old file > and the new generated text. If they match (eq) then skip the file > creation part completely (all lines between open and close file). > > Patch is for file lib/DBIx/Class/Schema/Loader/Base.pm version 0.04005 > > Please check and apply this patch for next version. > Thank you.
As of 0.05000 we do not modify files if there are no changes.