[DBIx-Class-Devel] [dbix-class-schema-loader] Overwrite if the md5sum in a file is wrong but the content has not changed (#8)

Dave Rolsky notifications at github.com
Tue Jan 12 19:16:21 GMT 2016


The code was reading the file, then generating an md5sum for the content and
comparing it to the md5sum in the file itself. If these didn't match then it
would return the _generated_ MD5 rather than what was actually in the file. It
would then compare this generated MD5 to the MD5 for a regen of the same
file. If they matched it would not bother writing the file.

This works fine if it's the _content_ that has changed, but if the md5sum
itself is wrong but the content has not changed, then returning the generated
MD5 based on the content we just read is wrong.

Instead, we now simply return a non-MD5 string. This will force the file to be
written again whether it was the file's content that had changed or just its
md5sum.
You can view, comment on, or merge this pull request online at:

  https://github.com/dbsrgits/dbix-class-schema-loader/pull/8

-- Commit Summary --

  * Overwrite if the md5sum in a file is wrong but the content has not changed

-- File Changes --

    M Changes (3)
    M lib/DBIx/Class/Schema/Loader/Base.pm (13)
    M t/40overwrite_modifications.t (60)

-- Patch Links --

https://github.com/dbsrgits/dbix-class-schema-loader/pull/8.patch
https://github.com/dbsrgits/dbix-class-schema-loader/pull/8.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class-schema-loader/pull/8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20160112/b3e00f61/attachment.htm>


More information about the DBIx-Class-Devel mailing list