Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40819 - ebuild.sh's reliance on sed
Summary: ebuild.sh's reliance on sed
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 40786
  Show dependency tree
 
Reported: 2004-02-08 03:10 UTC by Brian Harring (RETIRED)
Modified: 2004-05-24 23:44 UTC (History)
1 user (show)

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


Attachments
ebuild.sh patch to replace sed usage w/ appropriate bash (ebuild.sh-sedless.patch,2.11 KB, patch)
2004-02-08 03:16 UTC, Brian Harring (RETIRED)
Details | Diff
ebuild.sh-sedless.patch v2 (ebuild.sh-sedless.patch,2.12 KB, patch)
2004-02-08 11:40 UTC, Brian Harring (RETIRED)
Details | Diff
ebuild.sh sedless patch v3 (ebuild.sh-sedless.patch,2.27 KB, patch)
2004-02-09 13:17 UTC, Brian Harring (RETIRED)
Details | Diff
ebuild.sh-sedless.patch v4 (ebuild.sh-sedless.patch,2.78 KB, patch)
2004-02-25 19:48 UTC, Brian Harring (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Harring (RETIRED) gentoo-dev 2004-02-08 03:10:28 UTC
Brifely, ebuild.sh relies on sed for a couple of non-trivial usages- removing directories from the PATH statement (ccache and diistcc), and unpacking files.  If sed is ever broken, this break portage- it's unable to even unpack it's src if it's a tar.{bz2,gz}.

This isn't hard to modify however, I've gone through and converted the sed usage over to bash.
I'm also filing a bug w/ base-system enabling sed to bootstrap itself, since our current version requires sed (configure scripts use sed), and is unwilling to use the bootstrap script to build a temporary sed if one is lacking.

The modifications to ebuild.sh are minor, and cover the final cleanup for enabling sed to build w/out an initial sed binary.  Removing unpack's reliance on sed is fairly use imo.

Adding the 'sed requires sed' bug as being blocked by this- the sed modification is worthless if the ebuild is unable to unpack it's src.
Comment 1 Brian Harring (RETIRED) gentoo-dev 2004-02-08 03:16:01 UTC
Created attachment 25177 [details, diff]
ebuild.sh patch to replace sed usage w/ appropriate bash

I've been using it for the last few hours, and have used it to emerge sed when
I'd previously blown it away (intentionally :).

Only thing that's mildly questionable in my books is the function
remove_path_entry ; it's usage is rather limited currently, might be better
just to incorporate the tweaks directly into the relevant sections.
That and it might wise to store the previous contents of IFS, not sure on that
one though.
Comment 2 Brian Harring (RETIRED) gentoo-dev 2004-02-08 11:40:13 UTC
Created attachment 25205 [details, diff]
ebuild.sh-sedless.patch v2

Fixed ls_ret assignment, and corrected an extra newline coming through for the
echo statement.
Comment 3 Brian Harring (RETIRED) gentoo-dev 2004-02-09 13:17:58 UTC
Created attachment 25291 [details, diff]
ebuild.sh sedless patch v3

Fixed remove_path_entry function setting PATH w/ a lead :
Thanks to nakano and genone for pointing out this and the previous issues.
remove_path_entry was made a bit more useful also, it can now be passed
multiple anchor's to search for, and remove.
Comment 4 Masatomo Nakano (RETIRED) gentoo-dev 2004-02-23 00:24:53 UTC
In "if has suidctl $FEATURES > /dev/null ; then", it doesn't work properly.

It should be like this: 
-           ls -ldh "${i}" | awk '{print "## "$0}' | sed s:"${IMAGE}"::g >> ${sfconf}
-           echo "#${i/${IMAGE}/}" >> ${sfconf}
+           ls_ret=`ls -ldh "${i}"`
+           echo "## ${ls_ret%${IMAGE}*}${ls_ret#*${IMAGE}}" >> ${sfconf}
+           echo "#${i/${IMAGE}/}" >> ${sfconf}

What do you think?
Comment 5 Brian Harring (RETIRED) gentoo-dev 2004-02-25 19:48:57 UTC
Created attachment 26371 [details, diff]
ebuild.sh-sedless.patch v4

Hmm.  I really managed to bork portions of this, didn't I?
heh. gah...
Added the missing echo statement, I also adjusted the beeping order of the
suidctl complaints- no point in having the terminal beep at the user w/out
having a relevant message displayed (originally it beeped, then would display
the suid complaint and continue on).

Straying from the topic of this bug slightly, I wonder about the use of -s for
testing if the suidctrl.conf exists.  Wouldn't that be better server by a -f?
Comment 6 Masatomo Nakano (RETIRED) gentoo-dev 2004-02-26 18:24:30 UTC
'chmod ugo-s "${i}"' should be after the timer...
Comment 7 Masatomo Nakano (RETIRED) gentoo-dev 2004-03-17 12:31:22 UTC
It's in CVS.
Thanks.
Comment 8 Brian Harring (RETIRED) gentoo-dev 2004-05-24 23:44:25 UTC
Closing, it's in portage-2.0.51_pre9 (it appeared earlier, just don't recall the version :)