Bug 223126

Summary: 'make makepatch' may remove all patches under certain condition
Product: Ports & Packages Reporter: Motomichi Matsuzaki <mzaki>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: mzaki, ports-bugs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
diff for Mk/Scripts/smart_makepatch.sh none

Description Motomichi Matsuzaki 2017-10-20 09:50:44 UTC
Created attachment 187325 [details]
diff for Mk/Scripts/smart_makepatch.sh

In the case that file(s) with name beginning with '-' exists in ${PATCH_WRKSRC},
'make makepatch' removes all existing patches in ${PATCHDIR} rather than
regenerating them.

This is caused by 'find -s * -type f...' in regenerate_patches() in Mk/Scripts/smart_makepatch.sh
The glob expanded to (for example) '-m Makefile ...' causes 'find' an illegal option error, making new_list null.

Suggested workaround is adding -f before * (patch attached).
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2021-11-08 14:42:46 UTC
The patch does not apply anymore and I believe the issue is fixed considering a very quick review of the script