basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

Fixed regexp for escriptize to only special case win32. #191

Closed jonmeredith closed 9 years ago

jonmeredith commented 9 years ago

Thanks Internet http://stackoverflow.com/questions/406230/regular-expression-to-match-text-that-doesnt-contain-a-word

Rather than checking on all platforms I persuaded myself this was reasonable with this

1>  Archs = ["darwin","linux","win32", "win32weirdthing"].
["darwin","linux","win32","win32weirdthing"]
2> [{Arch, re:run(Arch, "^((?!win32).)*$", [{capture,none}])} || Arch <- Archs].
[{"darwin",match},
 {"linux",match},
 {"win32",nomatch},
 {"win32weirdthing",nomatch}]
jonmeredith commented 9 years ago

So after digging into what rebar REALLY gives you

Archs = ["R16B02_basho8-x86_64-unknown-freebsd9.2-64","R16B02-basho4-x86_64-unknown-linux-gnu-64","R16B02-win32-32", "R16B02-win32-64","R16B02_basho8-x86_64-apple-darwin14.3.0-64" ].
[{Arch, re:run(Arch, "^((?!-win32).)*$", [{capture,none}]), re:run(Arch, "-win32", [{capture,none}])} || Arch <- Archs]. 

Updating with the commit above to be more paranoid

[{"R16B02_basho8-x86_64-unknown-freebsd9.2-64",match,nomatch},
 {"R16B02-basho4-x86_64-unknown-linux-gnu-64",match,nomatch},
 {"R16B02-win32-32",nomatch,match},
 {"R16B02-win32-64",nomatch,match},
 {"R16B02_basho8-x86_64-apple-darwin14.3.0-64",match,nomatch}]
jonmeredith commented 9 years ago

@c-bik if you get a moment, please check this does not break your build. We need it fixed so we can release Riak on freebsd/smartos/solaris, and think anybody else that uses node_package will also need that.

macintux commented 9 years ago

:+1: 688209c

macintux commented 9 years ago

@borshop merge