Bug 268737 - Add Mk/Scripts/add-port-to-category-makefile.sh, command that adds port to category's Makefile
Summary: Add Mk/Scripts/add-port-to-category-makefile.sh, command that adds port to ca...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-03 19:14 UTC by Yuri Victorovich
Modified: 2023-01-31 06:04 UTC (History)
4 users (show)

See Also:


Attachments
add-port-to-category-makefile.sh.patch (1.45 KB, patch)
2023-01-03 19:14 UTC, Yuri Victorovich
no flags Details | Diff
add-port-to-category-makefile.sh.patch (1.46 KB, patch)
2023-01-04 08:33 UTC, Yuri Victorovich
no flags Details | Diff
add-port-to-category-makefile.sh.patch (1.54 KB, patch)
2023-01-06 02:01 UTC, Yuri Victorovich
no flags Details | Diff
add-port-to-category-makefile.sh.patch (1.54 KB, patch)
2023-01-06 02:04 UTC, Yuri Victorovich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2023-01-03 19:14:17 UTC
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.
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2023-01-04 08:14:08 UTC
This should be put in Tools/scripts not in Mk, it is not used by the framework.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-04 08:33:56 UTC
Created attachment 239248 [details]
add-port-to-category-makefile.sh.patch

Moved.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-04 20:55:57 UTC
@mat Is the patch approved?
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-06 02:01:42 UTC
Created attachment 239292 [details]
add-port-to-category-makefile.sh.patch
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-06 02:04:01 UTC
Created attachment 239293 [details]
add-port-to-category-makefile.sh.patch
Comment 6 Rene Ladan freebsd_committer freebsd_triage 2023-01-10 21:44:11 UTC
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
Comment 7 Mathieu Arnold freebsd_committer freebsd_triage 2023-01-14 15:55:19 UTC
(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.
Comment 8 Mathieu Arnold freebsd_committer freebsd_triage 2023-01-14 15:57:29 UTC
Ah, it was removed a while back.

https://cgit.freebsd.org/ports/tree/Tools/scripts/addport?id=a396e4f131341b58bf897f73d1ce1f8a6f6e5256
Comment 9 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-16 20:56:24 UTC
(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.
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-16 20:58:15 UTC
Committed.
Comment 11 commit-hook freebsd_committer freebsd_triage 2023-01-16 21:07:40 UTC
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(+)
Comment 12 Bryan Drewery freebsd_committer freebsd_triage 2023-01-30 18:53:46 UTC
Maybe export LC_ALL=C should be added too?
Comment 13 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-31 06:04:07 UTC
'export LC_ALL=C' was added.
Comment 14 commit-hook freebsd_committer freebsd_triage 2023-01-31 06:04:16 UTC
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(+)