Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 487952

Summary: app-shells/ksh-93.20120801
Product: Gentoo Linux Reporter: Daniel Douglas <ormaaj>
Component: New packagesAssignee: Mike Gilbert <floppym>
Status: RESOLVED OBSOLETE    
Severity: normal CC: ormaaj
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ksh-93.ebuild
backport fix from ksh93-v
Patch to apply @GENTOO_PORTAGE_EPREFIX@
simplify, remove some debug output

Description Daniel Douglas 2013-10-14 02:05:36 UTC
Created attachment 360840 [details]
ksh-93.ebuild

ebuild attached, which supports later alpha and beta snapshots. I've back-ported one fix from the current alpha series as well.
Comment 1 Daniel Douglas 2013-10-14 02:07:00 UTC
Created attachment 360842 [details, diff]
backport fix from ksh93-v
Comment 2 Daniel Douglas 2013-10-14 02:08:10 UTC
Created attachment 360844 [details, diff]
Patch to apply @GENTOO_PORTAGE_EPREFIX@
Comment 3 Mike Gilbert gentoo-dev 2013-10-14 02:34:26 UTC
That's a pretty weird looking ebuild. A few problems?

1. PMS says we support bash-3.2, so associative arrays are not going to fly.

2. Why replace the 1-line sed program with that weird ed loop?

3. I don't understand the FUNCNAME conditional in src_compile.
Comment 4 Daniel Douglas 2013-10-14 03:09:02 UTC
Created attachment 360846 [details]
simplify, remove some debug output
Comment 5 Daniel Douglas 2013-10-14 03:10:07 UTC
1. PMS says we support bash-3.2, so associative arrays are not going to fly.

Oops. That could be replaced by an indexed array, though a hash map would be preferable. Changed in new upload.

2. Why replace the 1-line sed program with that weird ed loop?

I typically use ed or ex for in-place file edits. You can use GNU sed if you wish. If you want one line then «ed -s <<<$'...\nw'». The /dev/fd/0 only serves to recycle the existing FD.

3. I don't understand the FUNCNAME conditional in src_compile.

IIRC That was attempting to work around the fact that bin/package doesn't appear to return a meaningful exit status. If the build failed, then the ultimate failure would occur during the install phase when portage can't find the binary. I don't think I found a workaround that's any better than checking for existence of the binary.

This FUNCNAME logic I usually use to detect direct recursion. Since portage ignores ebuild phase return status, «"$FUNCNAME" || die» allows things like returning from multiple points with nonzero status and catching the return. Here I was using that in conjunction with the RETURN trap.

I see there's some other debug stuff I forgot to delete as well. I'll upload a simpler version. The only difference is it will no longer print «sh bin/package results» output.