Created attachment 239237 [details] add-port-to-category-makefile.sh.patch The new Mk/Scripts/add-port-to-category-makefile.sh script simplified and makes less error prone the process of adding of a new port to category's Makefile.
This should be put in Tools/scripts not in Mk, it is not used by the framework.
Created attachment 239248 [details] add-port-to-category-makefile.sh.patch Moved.
@mat Is the patch approved?
Created attachment 239292 [details] add-port-to-category-makefile.sh.patch
Created attachment 239293 [details] add-port-to-category-makefile.sh.patch
We discussed this PR tonight in the bi-weekly portmgr meeting and while the idea is nice, it could even be better if: - the script integrates with the check_category_makefile git-hook (see https://cgit.freebsd.org/ports/tree/.hooks/pre-commit.d/check_category_makefile ) - perhaps the script could propose or add a commit message
(In reply to Yuri Victorovich from comment #3) The Tools directory is not under any restriction, anyone can add anything there. You only have to respect the maintainership of other people. I wonder what became of addport, I always used it to add ports, and it did all those things.
Ah, it was removed a while back. https://cgit.freebsd.org/ports/tree/Tools/scripts/addport?id=a396e4f131341b58bf897f73d1ce1f8a6f6e5256
(In reply to Rene Ladan from comment #6) This script is a module that performs one specific action - adding a line into the category's makefile. I don't think that it should also suggest a commit message, or check that line like the git hook does. This should be done by another convenience script that I intend to add later, that would add and commit the new port. (In reply to Mathieu Arnold from comment #8) Thank you for letting me know. I will commit it then.
Committed.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=1eba137b81f9c3e322da49764244d17c5c7c59b2 commit 1eba137b81f9c3e322da49764244d17c5c7c59b2 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2023-01-16 20:56:41 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2023-01-16 21:07:27 +0000 Tools/scripts: Add add-port-to-category-makefile.sh, command that adds new port to category's Makefile PR: 268737 .../add-port-to-category-makefile.sh (new +x) | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+)
Maybe export LC_ALL=C should be added too?
'export LC_ALL=C' was added.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5a99dc0e5bcfcd8d1a61de66311764c438a0188d commit 5a99dc0e5bcfcd8d1a61de66311764c438a0188d Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2023-01-31 05:46:31 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2023-01-31 06:03:59 +0000 Tools/scripts/add-port-to-category-makefile.sh: Add export LC_ALL=C PR: 268737 Suggested by: bdrewery@ Tools/scripts/add-port-to-category-makefile.sh | 2 ++ 1 file changed, 2 insertions(+)