> I believe that the default behavior should be changed to preserve
> all permissions, with the possible exception of setting u+w.
> Even that might be unnecessary; AFAIK to delete a file you need
> write permissions only to its parent directory, not to the
> file itself.
The u+w setting could also be done on the fly by copy_file at
installation time. e.g. when overwriting a read-only file.
> In my case, some
> executable files ceased to be executable after installation.
what is your use case of having executable file here ?
I'd use the 'scripts' metadata for that ?
> Even if the current behavior is deemed correct, at the very least
> the code should be refactored to allow easy overriding.
> Currently build_module and build_package_data pass
> preserve_mode=False in their
> body, so I had to copy and paste the whole methods
> just to set preserve_mode=True.
But How do you handle the overwrite of a read-only file in your code then ?