forked from techtonik/python-patch
-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
If a patch creates new file, the file mode is ignored and default permissions (0644) are applied for the created file.
This results in loosing the executable permission for the generated file even though that permission was present in the patch file.
The issue was spotted when using conan's apply_conandata_patches() function which uses patch-ng to implement the patching functionality.
When a patch creates new file, it is generated in this part of the implementation:
Line 914 in 2354804
| if old == b'/dev/null': |
The 'new file mode' in the patch file is only referenced here in the source, while detecting the patch type:
Line 765 in 2354804
| and re.match(b'(?:index \\w{7}..\\w{7} \\d{6}|new file mode \\d*)', p.header[idx+1])): |
but it is not referenced or consumed further to set the correct file mode of a new generated file.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working