Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(make): Use awk to extract target names #1069

Merged
merged 4 commits into from Nov 27, 2023

Conversation

akinomyoga
Copy link
Collaborator

@akinomyoga akinomyoga commented Nov 18, 2023

This is the last piece of #TODO:API.

This is also the refactoring mentioned in #546 (comment). As mentioned there, we might separate the awk script to another file in helpers/.

@akinomyoga akinomyoga added this to In progress in 2.12 release Nov 18, 2023
completions/make Outdated Show resolved Hide resolved
completions/make Outdated Show resolved Hide resolved
bash_completion Outdated Show resolved Hide resolved
bash_completion Outdated Show resolved Hide resolved
helpers/make-extract-targets.awk Outdated Show resolved Hide resolved
@akinomyoga akinomyoga force-pushed the use-awk-for-make branch 2 times, most recently from 1a22105 to 10d1ec2 Compare November 23, 2023 01:29
@akinomyoga
Copy link
Collaborator Author

amend 1a221053..10d1ec2a: I added more cases where XPG awk is needed in Solaris.

akinomyoga and others added 2 commits November 28, 2023 06:19
Solaris awk lacks many POSIX features as listed below.  When any of
them is used, we use XPG4 awk at /usr/xpg4/bin/awk instead of Solaris
awk at /usr/bin/awk.

- Solaris awk does not support ENVIRON.
- Solaris awk does not support the function `tolower`.
- Solaris awk does not support user-defined functions.
- Solaris awk does not support `-F ERE' but only supports -F<char>.
- Solaris awk does not accept an option argument for `-F` in a
  separate word.  The option argument needs to be specified in the
  same command-line word as `-F<char>`.
- Solaris awk does not support the command-line option `-v var=value`

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
The condition `$NF=2` in the awk script actually assigns a value `2`
to the last field instead of comparing it to `2` and always evaluates
to true.  I suspect it to be `NF >= 2`.

This could possibly be intended as `NF == 2` or `$NF == 2`, but
neither seems to work correctly.  The input contains the names of man
entries of the form ` perlxx <description>`, but the description is
usually given by more than one words, so restricting them by `NF == 2`
would be unreasonable.  On the other hand, there are no entries ending
with the word `2` so `$NF == 2` would produce no results.  This
condition was introduced from the beginning when the related code was
introduced in commit 4254f3a.  There does not seem to be any hints on
the background of `$NF=2`.
@akinomyoga akinomyoga merged commit 63dbf2b into scop:master Nov 27, 2023
7 checks passed
@akinomyoga akinomyoga deleted the use-awk-for-make branch November 27, 2023 21:43
@akinomyoga akinomyoga moved this from In progress to Done in 2.12 release Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants