Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

DBIx::Class::Schema::Loader catalyst helper

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


orasnita at gmail

May 29, 2009, 3:14 AM

Post #1 of 6 (578 views)
Permalink
DBIx::Class::Schema::Loader catalyst helper

Hi,

I made a Catalyst app (under Windows) and I put it run under Linux.

Under both OSes I use the same version (latest) of:

Catalyst::Runtime
Catalyst::Devel
Catalyst::Helper::Model::DBIC::Schema
DBIx::Class

If I generate the DBIC result classes using DBIC::Schema under Windows and I
upload them under Linux, then I try to re-generate them under Linux, even
though they are created by the same helper and based on the same database,
it gives an error when running the Catalyst helper:

DBIx::Class::Schema::Loader::make_schema_at(): Cannot not overwrite
'/oct/TB/script/../lib/TB/Schema.pm' without 'really_er
ase_my_files', it does not appear to have been generated by Loader at
/usr/lib/perl5/site_perl/5.8.8/Catalyst/Helper/Model/
DBIC/Schema.pm line 173

Is this way of re-generating the result classes wrong?
Can I do something to be able to use the helper for re-generate the result
classes under different platforms?

Thanks.

--
Octavian


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


ivan.wills at gmail

May 29, 2009, 3:27 AM

Post #2 of 6 (536 views)
Permalink
Re: DBIx::Class::Schema::Loader catalyst helper [In reply to]

2009/5/29 Octavian Rasnita <orasnita[at]gmail.com>

> Hi,
>
> I made a Catalyst app (under Windows) and I put it run under Linux.
>
> Under both OSes I use the same version (latest) of:
>
> Catalyst::Runtime
> Catalyst::Devel
> Catalyst::Helper::Model::DBIC::Schema
> DBIx::Class
>
> If I generate the DBIC result classes using DBIC::Schema under Windows and
> I upload them under Linux, then I try to re-generate them under Linux, even
> though they are created by the same helper and based on the same database,
> it gives an error when running the Catalyst helper:
>
> DBIx::Class::Schema::Loader::make_schema_at(): Cannot not overwrite
> '/oct/TB/script/../lib/TB/Schema.pm' without 'really_er
> ase_my_files', it does not appear to have been generated by Loader at
> /usr/lib/perl5/site_perl/5.8.8/Catalyst/Helper/Model/
> DBIC/Schema.pm line 173
>
> Is this way of re-generating the result classes wrong?
> Can I do something to be able to use the helper for re-generate the result
> classes under different platforms?
>
> Thanks.
>
> --
> Octavian
>
>
> _______________________________________________
> List: Catalyst[at]lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

At a quick guess it might be that the files generated on windows use \r\n
line endings when trying to update those files on linux it expects just \n.
You could try using dos2unix on the files and see if you still get the same
error.

Ivan

--
email/jabber: ivan.wills[at]gmail.com
/
/ _ _
/ \ / | | | |
/ \/ \_| | |


bobtfish at bobtfish

May 29, 2009, 3:46 AM

Post #3 of 6 (539 views)
Permalink
Re: DBIx::Class::Schema::Loader catalyst helper [In reply to]

Ivan Wills wrote:
> At a quick guess it might be that the files generated on windows use
> \r\n line endings when trying to update those files on linux it expects
> just \n. You could try using dos2unix on the files and see if you still
> get the same error.

I guess you'll get the same error, as the md5sum will still change.

Patches to Schema::Loader to strip \r out when calculating the md5s so
that it works cross platform, but you still get 'local' linefeeds would
probably be good.

Either way, this is a DBIC thing, not a Catalyst thing, so you should
probably be on that list :)

Cheers
t0m


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


orasnita at gmail

May 29, 2009, 3:47 AM

Post #4 of 6 (538 views)
Permalink
Re: DBIx::Class::Schema::Loader catalyst helper [In reply to]

From: Ivan Wills
2009/5/29 Octavian Rasnita <orasnita[at]gmail.com>

> Hi,
> I made a Catalyst app (under Windows) and I put it run under Linux.
>
> If I generate the DBIC result classes using DBIC::Schema under Windows and I upload them under Linux, then I try to re-generate them
> under Linux, even though they are created by the same helper and based on the same database, it gives an error when running the Catalyst
> helper:
>
> DBIx::Class::Schema::Loader::make_schema_at(): Cannot not overwrite '/oct/TB/script/../lib/TB/Schema.pm' without 'really_er
> ase_my_files', it does not appear to have been generated by Loader at /usr/lib/perl5/site_perl/5.8.8/Catalyst/Helper/Model/
> DBIC/Schema.pm line 173

At a quick guess it might be that the files generated on windows use \r\n line endings when trying to update those files on linux it expects just \n. You could try using dos2unix on the files and see if you still get the same error.

Ivan

#

Thank you! That was the problem. I have forgotten about the line endings because I use to save the perl files with Unix line endings under Windows also.

Octavian


orasnita at gmail

May 29, 2009, 3:58 AM

Post #5 of 6 (538 views)
Permalink
Re: DBIx::Class::Schema::Loader catalyst helper [In reply to]

From: "Tomas Doran" <bobtfish[at]bobtfish.net>
> Ivan Wills wrote:
>> At a quick guess it might be that the files generated on windows use \r\n
>> line endings when trying to update those files on linux it expects just
>> \n. You could try using dos2unix on the files and see if you still get
>> the same error.
>
> I guess you'll get the same error, as the md5sum will still change.
>
> Patches to Schema::Loader to strip \r out when calculating the md5s so
> that it works cross platform, but you still get 'local' linefeeds would
> probably be good.
>

After using dos2unix, I was able to re-generate the class files.

I think that the hash is created while the data is in memory having just
"\n" chars in the content, and this \n is translated to \r\n only when the
file is printed (after creating the hash).

The Catalyst helper could also change any end of line char found in "\n"
before re calculating the hash from the content of the file.

Octavian


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


bobtfish at bobtfish

May 29, 2009, 4:14 AM

Post #6 of 6 (541 views)
Permalink
Re: DBIx::Class::Schema::Loader catalyst helper [In reply to]

Octavian Rasnita wrote:
> The Catalyst helper could also change any end of line char found in "\n"
> before re calculating the hash from the content of the file.

No, it couldn't.

This is nothing to do with Catalyst, or the Catalyst helper, it's a DBIC
thing.

Cheers
t0m


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.