Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 208483 - Ebuild.sh has issue with BSD Sed vs GNU sed
Summary: Ebuild.sh has issue with BSD Sed vs GNU sed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
: 215547 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-01 19:49 UTC by Mark
Modified: 2008-07-04 16:30 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 Mark 2008-02-01 19:49:28 UTC
Line 1440 in /usr/lib/portage/bin/ebuild.sh:
  "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${var_grep}" | sed -r \

BSD sed has no -r option, whilst GNU sed has. This particular issue showed when I was installing freebsd-share (notice the slot error too!):

===> zoneinfo (all)
Warning: Object directory not changed from original /var/tmp/portage/sys-freebsd/freebsd-share-6.2/work/share/zoneinfo
>>> Source compiled.
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
Traceback (most recent call last):
  File "/usr/lib/portage/bin/filter-bash-environment.py", line 51, in <module>
    compile_egrep_pattern(args[0]), file_in, file_out)
  File "/usr/lib/portage/bin/filter-bash-environment.py", line 34, in filter_bash_environment
    file_out.write(line)
IOError: [Errno 32] Broken pipe
>>> Test phase [not enabled]: sys-freebsd/freebsd-share-6.2
 
>>> Install freebsd-share-6.2 into /var/tmp/portage/sys-freebsd/freebsd-share-6.2/image/ category sys-freebsd
>>> Completed installing freebsd-share-6.2 into /var/tmp/portage/sys-freebsd/freebsd-share-6.2/image/
 
!!! WARNING: Expected SLOT='0', got ''
* checking 0 files for package collisions
>>> Merging sys-freebsd/freebsd-share-6.2 to /
>>> Safely unmerging already-installed instance...
SLOT is undefined
No package files given... Grabbing a set.
SLOT is undefined
SLOT is undefined
>>> Original instance of package unmerged safely.
>>> sys-freebsd/freebsd-share-6.2 merged.
 
>>> No packages selected for removal by clean
>>> Auto-cleaning packages...
 
>>> No outdated packages were found on your system.
 * GNU info directory index is up-to-date.

Is there any way we can switch sed to something like ${SED} allowing it to be switched to gsed on gfbsd?
Comment 1 Mark 2008-02-01 20:05:39 UTC
I just now switched out /usr/bin/sed with /usr/bin/gsed .. and it turns out that freebsd-share build will fail because it expects -E (bsd sed not gnu sed) .. joy!
Comment 2 Raúl Porcel (RETIRED) gentoo-dev 2008-04-01 22:42:58 UTC
*** Bug 215547 has been marked as a duplicate of this bug. ***
Comment 3 Nicola 2008-04-03 21:30:55 UTC
(In reply to comment #0)
> 
> Is there any way we can switch sed to something like ${SED} allowing it to be
> switched to gsed on gfbsd?
> 

or just use the right options for BSD or GNU?
Comment 4 Javier Villavicencio (RETIRED) gentoo-dev 2008-07-02 19:11:29 UTC
Does this still happens? Portage includes a sed wrapper (on /usr/lib/portage/bin/sed, picked by portage's PATH env) that uses gsed for ebuild stuff. 
However, sys-freebsd makefiles (not ebuilds) should be using the proper /usr/bin/sed (which, iirc, is taken with full path from /usr/share/mk/ .mk files)
Comment 5 Mark 2008-07-04 16:30:36 UTC
Works now .. no issues, thanks!