hook: fix bug (reuse of variable) introduced in
872d49dd577a
For binary installs, the 'name' argument would be reused as a local variable,
destroying its original value. The patch fixes that, and also avoids copying
sys.path when it's not necessary.
patch: implement patch.eol=auto mode
EOLs in patched files are restored to their original value after
patching. We use the first EOL found in the file, files with
inconsistent EOLs will thus be normalized during this process.