Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 487952 - app-shells/ksh-93.20120801
Summary: app-shells/ksh-93.20120801
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-14 02:05 UTC by Daniel Douglas
Modified: 2014-09-29 01:56 UTC (History)
1 user (show)

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


Attachments
ksh-93.ebuild (ksh-93.ebuild,2.47 KB, text/plain)
2013-10-14 02:05 UTC, Daniel Douglas
Details
backport fix from ksh93-v (ksh-fix-command-builtin.patch,424 bytes, patch)
2013-10-14 02:07 UTC, Daniel Douglas
Details | Diff
Patch to apply @GENTOO_PORTAGE_EPREFIX@ (ksh-prefix.patch,1.74 KB, patch)
2013-10-14 02:08 UTC, Daniel Douglas
Details | Diff
simplify, remove some debug output (ksh-93.ebuild,2.26 KB, text/plain)
2013-10-14 03:09 UTC, Daniel Douglas
Details

Note You need to log in before you can comment on or make changes to this bug.
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.