Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 584254 - autotools.eclass: autotools_check_macro_val: rewrite gawk script in POSIX awk
Summary: autotools.eclass: autotools_check_macro_val: rewrite gawk script in POSIX awk
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal trivial
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-26 19:45 UTC by Coacher
Modified: 2021-04-12 11:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Coacher 2016-05-26 19:45:28 UTC
Hello.

Currently autotools_check_macro_val() function calls gawk directly.

Could you please call implementation-neutral awk if possible or add gawk to DEPEND otherwise?

This makes autotools eclass unusable when gawk is replaced with busybox or mawk.
Comment 1 SpanKY gentoo-dev 2016-05-26 20:58:04 UTC
it is correctly hardcoding `gawk` because the script is using a gawk extension.  POSIX does not have a 3rd arg to the match func.
  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html

feel free to suggest a POSIX compliant alternative.
Comment 2 Coacher 2016-05-26 21:02:20 UTC
(In reply to SpanKY from comment #1)
> it is correctly hardcoding `gawk` because the script is using a gawk
> extension.  POSIX does not have a 3rd arg to the match func.
>   http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
> 
> feel free to suggest a POSIX compliant alternative.

It's fine by me that it requires gawk and not plain awk. The problem is that gawk dependency isn't explicit via DEPEND inside the eclass.
Comment 3 SpanKY gentoo-dev 2016-05-27 04:10:58 UTC
(In reply to Coacher from comment #2)

meh.  gawk is in @system already.
Comment 4 Coacher 2016-05-27 11:43:57 UTC
Isn't gawk in @system because we need some awk in @system and gawk just happens to be the best supported of them all?
Comment 5 SpanKY gentoo-dev 2016-05-27 17:15:53 UTC
(In reply to Coacher from comment #4)

i'm not sure what your point is -- gawk is guaranteed to be in the @system.

if you want to rewrite to use POSIX awk, feel free.  i don't see value in spending time on this.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-25 16:42:49 UTC
We should probably add it explicitly for people who use --implicit-system-deps=n.
Comment 7 Larry the Git Cow gentoo-dev 2021-04-11 21:00:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=307c855dc6d7842098fae8738a7a5228670a71f6

commit 307c855dc6d7842098fae8738a7a5228670a71f6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-03-31 23:51:35 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-04-11 20:59:54 +0000

    autotools.eclass: add explicit GNU awk dependency
    
    autotools_check_macro_val specifically requires
    GNU awk (sys-apps/gawk) rather than any awk (virtual/awk).
    
    Closes: https://bugs.gentoo.org/584254
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/autotools.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 8 Arfrever Frehtes Taifersar Arahesis 2021-04-12 11:08:04 UTC
(In reply to Sam James from comment #6)
> We should probably add it explicitly for people who use
> --implicit-system-deps=n.

--implicit-system-deps option affects possible order of builds performed by `emerge`.

--implicit-system-deps=n does NOT allow to uninstall @system packages.