Page MenuHomeFreeBSD

[NEW FEATURE] print-gh-tuple: Print GH_TUPLE corresponding to submodules of a GitHub repository ${GH_ACCOUNT}/${GH_PROJECT}
Needs ReviewPublic

Authored by yuri on Mar 30 2020, 8:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 8:02 PM
Unknown Object (File)
Wed, Apr 17, 5:36 PM
Unknown Object (File)
Tue, Apr 16, 6:24 PM
Unknown Object (File)
Fri, Apr 12, 7:02 AM
Unknown Object (File)
Sun, Mar 31, 6:31 AM
Unknown Object (File)
Fri, Mar 29, 2:16 PM
Unknown Object (File)
Fri, Mar 29, 9:16 AM
Unknown Object (File)
Mar 5 2024, 4:51 AM

Details

Reviewers
None
Group Reviewers
portmgr
O5: Ports Framework(Owns No Changed Paths)
Summary

The attached patch defines the new target make print-gh-tuple that prints GH_TUPLE for all git submodules of the default Git repository ${GH_ACCOUNT}/${GH_PROJECT} when USE_GITHUB=yes is set.

Purpose: Simplify creation of the GH_TARGET tag when the repository has a lot of submodules.

It traverses and returns all submodules hierarchically.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

yuri retitled this revision from [NEW FEATURE] print-gh-tuple: Print GH_TUPLE corresponding to the submodules in a GitHub repository ${GH_ACCOUNT}/${GH_PROJECT} to [NEW FEATURE] print-gh-tuple: Print GH_TUPLE corresponding to submodules of a GitHub repository ${GH_ACCOUNT}/${GH_PROJECT}.
yuri removed 1 blocking reviewer(s): portmgr.

Could you use devel/arcanist, or at least generate a diff with full context like it does, with svn diff -x -U9999 or git diff -U9999.

Also, can you extract the awk script to is own file?

yuri edited the summary of this revision. (Show Details)
yuri edited the test plan for this revision. (Show Details)

Update the patch with arcanist.

In D24231#538538, @mat wrote:

Also, can you extract the awk script to is own file?

Currently no extra files are created by this feature, except for the git repository being cloned, which is necessary.
The feature works in a stream fashion, and there would be no benefit in saving the intermediate output into extra files. For debugging | tee /tmp/awk-input.txt can be added.

Why do you want to save the output into a file?

audio/surge-synthesizer-lv2 can be used as a testcase.

In D24231#538638, @yuri wrote:

Why do you want to save the output into a file?

Something got lost in translation.

Also, can you extract the awk script to is own file?

The Mk/Scripts/print-submodule-gh_tuple.sh file is about 15 lines of shell and 60 lines of awk, please put the awk script into its own file.

Move the awk code into a separate file.

Anything else needs to be changed?

I used print-gh-tuple on multiple ports and it worked as expected.

Are you still using this to work on your ports?

Mk/Scripts/print-submodule-gh_tuple.awk
2 ↗(On Diff #70789)

No needed anymore.

Mk/Scripts/print-submodule-gh_tuple.sh
16

Should we set set -o pipefail here for consistency with other scripts?

In D24231#669073, @0mp wrote:

Are you still using this to work on your ports?

Yes, I used it on many ports. I am going to update the patch with bugfixes, and will incorporate your suggestions.

In D24231#669073, @0mp wrote:

Are you still using this to work on your ports?

I haven't been involved in the development of this, but I find the FreeBSD porter handbook confusing when detailing how to craft GH_TUPLE lines.

So I've used the commands inside the .sh by hand and a copy of the awk file to build GH_TUPLE for two ports. So I have found this invaluable to me.