Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24208 - Usage of sed -i in ebuilds
Summary: Usage of sed -i in ebuilds
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
: 24237 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-09 17:01 UTC by Derk-Jan Hartman
Modified: 2003-07-10 13:36 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 Derk-Jan Hartman 2003-07-09 17:01:16 UTC
I was walking trough some ebuilds and suddenly came accross one that was using sed -i 
to do a substitution on a file.

-i option is not very portable. This is gonna create some problems with at least the 
upcoming macosx porting effort, since Darwin's sed doesn't support -i.
Grepping trough my portage dir i found hundreds of occurences of this syntax. All these 
occurences ought to be replace with something like the following:

sed "s:tosub:thesub:" configure.orig > configure

Reproducible: Always
Steps to Reproduce:
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2003-07-09 23:07:32 UTC
If the ebuild didn't DEPEND on >=sys-apps/sed-4 it should be reported as a bug.
However, the use of sed -i will only increase in portage as I, as well as others
are adding it as fast as we can because it's much better than the old
cp x x.orig; sed blah x.orig > x thing.

sed -i in general is not a bug so I'm closing this as WONTFIX.  But as I
mentioned above, please report individual ebuilds that don't DEPEND correctly.
Comment 2 SpanKY gentoo-dev 2003-07-09 23:14:48 UTC
the answer in terms of porting is 'we will patch to add support' :) 
Comment 3 Brad Laue (RETIRED) gentoo-dev 2003-07-09 23:17:14 UTC
It's notable that FreeBSD added -i functionality to its sed for compatibility reasons. This means a future release of MacOS X may well import this change and support it. Flag compatibility tends to bleed across UNIX flavors.

And if not, GNU sed can be installed and used. 
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2003-07-10 13:36:57 UTC
*** Bug 24237 has been marked as a duplicate of this bug. ***