Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 709322 - mount-boot.eclass: failure in mount-boot_pkg_pretend when sys-apps/mawk is used: awk: line 3: function gensub never defined
Summary: mount-boot.eclass: failure in mount-boot_pkg_pretend when sys-apps/mawk is us...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-11 20:03 UTC by Red
Modified: 2020-02-13 04:33 UTC (History)
2 users (show)

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


Attachments
Build log (intel-microcode-with-mawk-build.log,1.75 KB, text/plain)
2020-02-11 20:03 UTC, Red
Details
mount-boot.eclass: Make awk expression work with mawk. (0001-mount-boot.eclass-Make-awk-expression-work-with-mawk.patch,1.22 KB, patch)
2020-02-12 02:13 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Red 2020-02-11 20:03:04 UTC
=sys-firmware/intel-microcode-20191115_p20200209 does not build when awk is set to mawk with eselect. It builds fine with gawk.

Build log attached.

Reproducible: Always

Steps to Reproduce:
1. emerge sys-apps/mawk (if not already installed)
2. emerge app-eselect/eselect-awk
3. eselect awk set mawk
4. emerge sys-firmware/intel-microcode
5. (build fails)
6. eselect awk set gawk
7. emerge sys-firmware/intel-microcode
8. (build completes successfully)
Actual Results:  
Build fails when the default awk is set to mawk.

Expected Results:  
Build should complete with mawk as in the past, or the ebuild should be changed to force use of gawk.
Comment 1 Red 2020-02-11 20:03:35 UTC
Created attachment 613412 [details]
Build log
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2020-02-11 23:50:51 UTC
ulm: Could you please have a look? gensub is coming from your change, https://gitweb.gentoo.org/repo/gentoo.git/commit/eclass/mount-boot.eclass?id=2d90570e81469bf75b2d4a4275151e282632c18e
Comment 3 Ulrich Müller gentoo-dev 2020-02-12 02:13:20 UTC
Created attachment 613420 [details, diff]
mount-boot.eclass: Make awk expression work with mawk.

Does attached patch fix the problem for you?

I have tested it with gawk, mawk and nawk.
Comment 4 Red 2020-02-12 02:31:28 UTC
(In reply to Ulrich Müller from comment #3)
> Created attachment 613420 [details, diff] [details, diff]
> mount-boot.eclass: Make awk expression work with mawk.
> 
> Does attached patch fix the problem for you?
> 
> I have tested it with gawk, mawk and nawk.

I tried putting the patch portion of the email in /etc/portage/patches/sys-firmware/intel-microcode and it didn't detect it.
Comment 5 Ulrich Müller gentoo-dev 2020-02-12 10:58:52 UTC
(In reply to Red from comment #4)
> I tried putting the patch portion of the email in
> /etc/portage/patches/sys-firmware/intel-microcode and it didn't detect it.

No, that won't work. /etc/portage/patches/ is only intended for patching the package, not patching ebuilds or eclasses.

Anyway, I've posted it to gentoo-dev for review:
https://archives.gentoo.org/gentoo-dev/message/94de9ef07d776e1fcd92dc11ff4cde28
Comment 6 Larry the Git Cow gentoo-dev 2020-02-13 04:31:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53c9011002e037ee2b8d97a5ee5657be6f4dd275

commit 53c9011002e037ee2b8d97a5ee5657be6f4dd275
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2020-02-12 02:08:37 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2020-02-13 04:31:04 +0000

    mount-boot.eclass: Make awk expression work with mawk.
    
    gensub() is a GNUism and doesn't exist in all awk variants. Use a loop
    instead.
    
    Tested with gawk, nawk, mawk, and busybox awk.
    
    Closes: https://bugs.gentoo.org/709322
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 eclass/mount-boot.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Comment 7 Ulrich Müller gentoo-dev 2020-02-13 04:33:14 UTC
Should be fixed now, please test.

Thanks for reporting!