See http://drupalcode.org/project/drush.git/blob/8375348ead1407e729bbc3819e7....

That make_md5() function uses unix tools that are not currently unavailable in our Windows installer. Namely, find and cksum. For better portability, we could iterate over each file using PHP instead of find, and use hash_file() instead of cksum. We could still use md5() at the end to make the final ID. Anyone see a problem with this? If we change our hash algorithm, do we need to up the MAKE_API to 3? Would that require everyone to edit existing makefiles?

If the above plan is undesireable, we can try to get the Windows versions of find and cksum into the installer. There is a bit of trickiness there as Windows has its own (incompatible) version of find.

CommentFileSizeAuthor
#5 drush-make-1428480-05.patch1.32 KBjhedstrom

Comments

jhedstrom’s picture

I'd think the resulting hash would only change if we iterated over the files and directories in a different order than the find command currently does.

moshe weitzman’s picture

cksum returns two numbers (or more?) when i looked at it. so file hashes would be different and thus the overall hash will differ.

jhedstrom’s picture

The second number being output is the byte count, so presumably we could get that via php as well (it just might be a lot slower than the combination of find and cksum).

moshe weitzman’s picture

Would be great if you came up with a windows compat way of doing this. Am not attached to hash_file()

jhedstrom’s picture

Status: Active » Needs work
StatusFileSize
new1.32 KB

Here's a start at doing this change without having to change the API version (or re-write all the md5-based tests), which I'd really like to avoid until Drush 6.

Note, this is failing because the php function crc32 appears to return different checksums than the cksum command. Posting this here for now.

moshe weitzman’s picture

Is anyone concerned about speed and/or memory with that file_get_contents() on every file? I think hash_file() and cksum operate without loading file contents. I could be wrong though.

moshe weitzman’s picture

Propeople is adding find, cksum, tail, and touch? to the Windows installer so we may not need to fix this after all. We will know next week or so.

jhedstrom’s picture

Status: Needs work » Closed (duplicate)