Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670468 - No ebuild helpers for patch, find, xargs under BSD
Summary: No ebuild helpers for patch, find, xargs under BSD
Status: RESOLVED OBSOLETE
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All FreeBSD
: Normal normal (vote)
Assignee: Portage team
URL: https://projects.gentoo.org/pms/7/pms...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-06 09:48 UTC by Ulrich Müller
Modified: 2019-10-12 12:17 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 Ulrich Müller gentoo-dev 2018-11-06 09:48:38 UTC
PMS says in section 12.1.1 (see URL):

* sed must be available, and must support all forms of invocations valid for GNU sed version 4 or later.
* patch must be available, and must support all inputs valid for GNU patch, version as listed in table 12.1.
* find and xargs must be available, and must support all forms of invocations valid for GNU findutils version 4.4 or later. Only for EAPIs listed in table 12.1 as requiring GNU find.

This implies that in BSD the commands should be mapped to the gsed, gpatch, gfind and gxargs versions. However, ebuild-helpers/bsd/ contains only a wrapper for sed but not for the other commands.
Comment 1 Zac Medico gentoo-dev 2018-11-06 18:04:39 UTC
This could potentially cause problems for build systems that assume a BSD userland. In the context of ebuild/eclass code, it's handled in gentoo/profiles/default/bsd/fbsd/profile.bashrc by these aliases:

> type -P gmake  > /dev/null && alias make=gmake
> type -P gpatch > /dev/null && alias patch=gpatch
> type -P gsed   > /dev/null && alias sed=gsed
> type -P gawk   > /dev/null && alias awk=gawk
> type -P gfind  > /dev/null && alias find=gfind
> type -P gxargs > /dev/null && alias xargs=gxargs
Comment 2 Zac Medico gentoo-dev 2018-11-06 19:36:58 UTC
Maybe PMS should allow for sed, patch, find, and xargs bash aliases? That will be the safest approach, I suppose.
Comment 3 Ulrich Müller gentoo-dev 2018-11-07 08:03:48 UTC
PMS does not even guarantee that aliases are expanded. Also from the wording it is clear that the package manager (and not profiles) must make sure that the commands are the GNU versions.

(In reply to Zac Medico from comment #1)
> > type -P gmake  > /dev/null && alias make=gmake
> > type -P gpatch > /dev/null && alias patch=gpatch
> > type -P gsed   > /dev/null && alias sed=gsed
> > type -P gawk   > /dev/null && alias awk=gawk
> > type -P gfind  > /dev/null && alias find=gfind
> > type -P gxargs > /dev/null && alias xargs=gxargs

This is very unreliable, as aliases won't be exported to subshells. (For example, bug 574626 shows that it doesn't work.)
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-10-12 12:17:36 UTC
G/FBSD is dead.