[gentoo-dev] Re: Proposal for changes for the next EAPI version

2016-05-18 Thread Duncan
Ciaran McCreesh posted on Tue, 17 May 2016 12:29:36 +0100 as excerpted:

> On Tue, 17 May 2016 07:26:03 -0400 Michael Orlitzky 
> wrote:
>> We already have "emerge --config" which is expected to be run after the
>> install process has completed, so I don't think that this is too much
>> of a stretch. Maybe call the phase "pkg_test" analogous to "pkg_config"
>> and in contrast to "src_test" which runs within the working directory.
>> Then "emerge --test" could run it.
> 
> For various technical reasons to do with the spec and package manglers
> sometimes using phase function names with the src_ or pkg_ stripped off,
> calling it that would be a huge pain.

What about something like gentoo_test, or more generically, distro_test?

That would also emphasize the difference between distro-level 
functionality and integration testing (which if I'm reading correctly is 
the proposal here) and upstream-level testing, via src_test.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman




[gentoo-dev] Package up for grabs: sys-boot/gummiboot

2016-05-18 Thread Michał Górny
I'm no longer willing to maintain sys-boot/gummiboot and this makes it
maintainer-needed. The package is no longer maintained upstream,
and has been merged into systemd. It seems that there are still people
using it without systemd though, so I'm not going to lastrite it
myself, and prefer getting a new maintainer for it.

-- 
Best regards,
Michał Górny



pgpnVX_bQMad0.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] [RFC] Enable CMAKE_WARN_UNUSED_CLI by default in cmake-utils for EAPI>=6

2016-05-18 Thread Maciej Mrozowski
On Wednesday 18 of May 2016 09:22:53 Andrew Savchenko wrote:
> On Mon, 02 May 2016 18:06:44 +0200 Maciej Mrozowski wrote:
> > Hello,
> > 
> > General advise: do not convert ebuilds inheriting cmake-utils to EAPI 6
> > unless you know what you are doing (you are fully aware of eclass
> > behaviour removed with https://bugs.gentoo.org/show_bug.cgi?id=514384).
> > 
> > Background:
> > 
> > Pre EAPI-6 cmake-utils.eclass contained certain feature to mitigate CMake
> > variable case changes done by upstream.
> > This feature was explicitly removed with
> > https://bugs.gentoo.org/show_bug.cgi?id=514384 and no alternative was
> > proposed.
> > It opened new area of possible ebuild regression bugs when switching to
> > EAPI-6 for ebuilds inheriting cmake-utils.eclass.
> > 
> > Unfortunately there is common misconception, also among developers, that
> > it's sufficient to simply replace "${cmake-utils_use_with foo)" with
> > "-DWITH_foo=ON" etc.
> > This is MOST OF THE TIME not the case.
> > When converting cmake-utils ebuild to EAPI>=6, one needs to consult
> > CMakeLists.txt wrt case each variable is written with since CMake is case-
> > sensitive and WITH_FOO != WITH_foo != WITH_Foo.
> > 
> > Proposal:
> > 
> > CMake allows warning about unused CMake variables passed by CLI. Since
> > this is how Gentoo passes ebuild configuration options, it's proposed to
> > enable this feature.
> > Unfortunately it won't fail compilation but at least it gives a chance to
> > spot case mismatch when reading build output.
> > 
> > Future thoughts:
> > 
> > For better damage control it's technically possible to extend configure
> > phase of cmake-utuls eclass to check mycmakeargs against parsed package
> > buildsystem but this might not be very reliable.
> 
> For me the real confusion was from this line:
> 
> die "${FUNCNAME[1]} is banned in EAPI 6 and later: use
> -D$1${arg}=\"\$(usex $2)\" instead"
> 
> It recommends to use ${arg} without any warning about case, so when I just
> copied what it recommends: -DWITH_nls="$(usex nls)", I had a nice surprise
> and fun debugging.

Ah, there you go..

@kensington
Come on, man, you should have known better.

Invalid suggestion removed. Thanks for noticing.
I prefer to have developers figure out the right EAPI-6 migration path 
themselves rather than blindly relying on suggestions:

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 427c13f..5958230 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -161,7 +161,7 @@ _cmake_use_me_now() {
local arg=$2
[[ ! -z $3 ]] && arg=$3
 
-   [[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and 
later: use -D$1${arg}=\"\$(usex $2)\" instead"
+   [[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and 
later"
 
local uper capitalised x
[[ -z $2 ]] && die "cmake-utils_use-$1  []"
@@ -184,7 +184,7 @@ _cmake_use_me_now_inverted() {
[[ ! -z $3 ]] && arg=$3
 
if [[ ${EAPI} != [2345] && "${FUNCNAME[1]}" != cmake-
utils_use_find_package ]] ; then
-   die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -
D$1${arg}=\"\$(usex $2)\" instead"
+   die "${FUNCNAME[1]} is banned in EAPI 6 and later"
fi
 
local uper capitalised x

regards
MM

signature.asc
Description: This is a digitally signed message part.


[gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place

2016-05-18 Thread aidecoe
From: Amadeusz Żołnowski 

awk doesn't have the -i option like sed and if editing file in place is
desired, additional steps are required. eawk uses tmp file to make it
look to the caller editing happens in place.
---
 eclass/eutils.eclass | 13 +
 1 file changed, 13 insertions(+)

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index dbedffe..e331f1b 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -20,6 +20,19 @@ _EUTILS_ECLASS=1
 
 inherit multilib toolchain-funcs
 
+# @FUNCTION: eawk
+# @USAGE:  
+# @DESCRIPTION:
+# Edit file  in place with awk. Pass all arguments following  to
+# awk.
+eawk() {
+   local f="$1"; shift
+   local tmpf="$(emktemp)"
+
+   cat "${f}" >"${tmpf}" || return 1
+   awk "$@" "${tmpf}" >"${f}"
+}
+
 # @FUNCTION: eqawarn
 # @USAGE: [message]
 # @DESCRIPTION:
-- 
2.8.2




Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place

2016-05-18 Thread Göktürk Yüksek
aide...@gentoo.org:
> From: Amadeusz Żołnowski 
> 
> awk doesn't have the -i option like sed and if editing file in place is
> desired, additional steps are required. eawk uses tmp file to make it
> look to the caller editing happens in place.
> ---
>  eclass/eutils.eclass | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
> index dbedffe..e331f1b 100644
> --- a/eclass/eutils.eclass
> +++ b/eclass/eutils.eclass
> @@ -20,6 +20,19 @@ _EUTILS_ECLASS=1
>  
>  inherit multilib toolchain-funcs
>  
> +# @FUNCTION: eawk
> +# @USAGE:  
> +# @DESCRIPTION:
> +# Edit file  in place with awk. Pass all arguments following  to
> +# awk.
> +eawk() {
> + local f="$1"; shift
> + local tmpf="$(emktemp)"
> +
> + cat "${f}" >"${tmpf}" || return 1
Why shell redirection with cat instead of cp? both are in coreutils.
Also, wouldn't the absence of 'die' cause silent breakages?

> + awk "$@" "${tmpf}" >"${f}"
> +}
> +
>  # @FUNCTION: eqawarn
>  # @USAGE: [message]
>  # @DESCRIPTION:
> 




[gentoo-dev] [PATCH] rebar.eclass: Build Erlang/OTP projects using dev-util/rebar

2016-05-18 Thread aidecoe
From: Amadeusz Żołnowski 

It is an eclass providing functions to build Erlang/OTP projects using
dev-util/rebar. All packages in upcoming category dev-erlang are going
to use this eclass.
---
 eclass/rebar.eclass | 220 
 1 file changed, 220 insertions(+)
 create mode 100644 eclass/rebar.eclass

diff --git a/eclass/rebar.eclass b/eclass/rebar.eclass
new file mode 100644
index 000..e1ac52f
--- /dev/null
+++ b/eclass/rebar.eclass
@@ -0,0 +1,220 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# @ECLASS: rebar.eclass
+# @MAINTAINER:
+# Amadeusz Żołnowski 
+# @AUTHOR:
+# Amadeusz Żołnowski 
+# @BLURB: Build Erlang/OTP projects using dev-util/rebar.
+# @DESCRIPTION:
+# An eclass providing functions to build Erlang/OTP projects using
+# dev-util/rebar.
+#
+# rebar is a tool which tries to resolve dependencies itself which is by
+# cloning remote git repositories. Dependant projects are usually expected to
+# be in sub-directory 'deps' rather than looking at system Erlang lib
+# directory. Projects relying on rebar usually don't have 'install' make
+# targets. The eclass workarounds some of these problems. It handles
+# installation in a generic way for Erlang/OTP structured projects.
+
+case "${EAPI:-0}" in
+   0|1|2|3|4)
+   die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
+   ;;
+   5|6)
+   ;;
+   *)
+   die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
+   ;;
+esac
+
+[[ ${EAPI} = 5 ]] && inherit eutils
+
+EXPORT_FUNCTIONS src_prepare src_compile src_install
+
+RDEPEND="dev-lang/erlang"
+DEPEND="${RDEPEND}
+   dev-util/rebar"
+
+# @FUNCTION: get_erl_libs
+# @RETURN: the path to Erlang lib directory
+# @DESCRIPTION:
+# Get the full path without EPREFIX to Erlang lib directory.
+get_erl_libs() {
+   echo "/usr/$(get_libdir)/erlang/lib"
+}
+
+# @VARIABLE: ERL_LIBS
+# @DESCRIPTION:
+# Full path with EPREFIX to Erlang lib directory. Some rebar scripts expect it.
+export ERL_LIBS="${EPREFIX}$(get_erl_libs)"
+
+# @FUNCTION: _find_dep_version
+# @INTERNAL
+# @USAGE: 
+# @RETURN: full path with EPREFIX to a Erlang package/project
+# @DESCRIPTION:
+# Find a Erlang package/project by name in Erlang lib directory. Project
+# directory is usually suffixed with version. First match to  or
+# -* is returned.
+_find_dep_version() {
+   local pn="$1"
+   local p
+
+   pushd "${EPREFIX}$(get_erl_libs)" >/dev/null
+   for p in ${pn} ${pn}-*; do
+   if [[ -d ${p} ]]; then
+   echo "${p#${pn}-}"
+   return 0
+   fi
+   done
+   popd >/dev/null
+
+   return 1
+}
+
+# @FUNCTION: eawk
+# @USAGE:  
+# @DESCRIPTION:
+# Edit file  in place with awk. Pass all arguments following  to
+# awk.
+eawk() {
+   local f="$1"; shift
+   local tmpf="$(emktemp)"
+
+   cat "${f}" >"${tmpf}" || return 1
+   awk "$@" "${tmpf}" >"${f}"
+}
+
+# @FUNCTION: erebar
+# @USAGE: 
+# @DESCRIPTION:
+# Run rebar with verbose flag. Die on failure.
+erebar() {
+   debug-print-function ${FUNCNAME} "${@}"
+
+   rebar -v skip_deps=true "$1" || die "rebar $1 failed"
+}
+
+# @FUNCTION: rebar_fix_include_path
+# @USAGE:  []
+# @DESCRIPTION:
+# Fix path in rebar.config to 'include' directory of dependant project/package,
+# so it points to installation in system Erlang lib rather than relative 'deps'
+# directory.
+#
+#  is optional. Default is 'rebar.config'.
+#
+# The function dies on failure.
+rebar_fix_include_path() {
+   debug-print-function ${FUNCNAME} "${@}"
+
+   local pn="$1"
+   local rebar_config="${2:-rebar.config}"
+   local erl_libs="${EPREFIX}$(get_erl_libs)"
+   local pv="$(_find_dep_version "${pn}")"
+
+   eawk "${rebar_config}" \
+   -v erl_libs="${erl_libs}" -v pn="${pn}" -v pv="${pv}" \
+   '/^{[[:space:]]*erl_opts[[:space:]]*,/, /}[[:space:]]*\.$/ {
+   pattern = "\"(./)?deps/" pn "/include\"";
+   if (match($0, "{i,[[:space:]]*" pattern "[[:space:]]*}")) {
+   sub(pattern, "\"" erl_libs "/" pn "-" pv "/include\"");
+   }
+   print $0;
+   next;
+}
+1
+' || die "failed to fix include paths in ${rebar_config}"
+}
+
+# @FUNCTION: rebar_remove_deps
+# @USAGE: []
+# @DESCRIPTION:
+# Remove dependencies list from rebar.config and deceive build rules that any
+# dependencies are already fetched and built. Otherwise rebar tries to fetch
+# dependencies and compile them.
+#
+#  is optional. Default is 'rebar.config'.
+#
+# The function dies on failure.
+rebar_remove_deps() {
+   debug-print-function ${FUNCNAME} "${@}"
+
+   local rebar_config="${1:-rebar.config}"
+
+   mkdir -p "${S}/deps" && :>"${S}/deps/.got" && :>"${S}/deps/.built" || 
die
+   eawk "${rebar_config}" \
+   '/^{[[:space:]]*deps[[:space:]]*,/, /}[[:

Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place

2016-05-18 Thread Robin H. Johnson
On Wed, May 18, 2016 at 10:25:02PM +0100, aide...@gentoo.org wrote:
> From: Amadeusz Żołnowski 
> 
> awk doesn't have the -i option like sed and if editing file in place is
> desired, additional steps are required. eawk uses tmp file to make it
> look to the caller editing happens in place.
NAK.

1.
If your AWK command has an error, then this clobbers the file, a better
variant, with die, would be:
awk "$@" "$f" >"${tmpf}" || die "awk failed..."
cp -f "${tmpf}" "$f" || die "copy back failed"

> # @USAGE:  
This calling format is also a problem if they intended to pass multiple
files to the command, or if they do so accidentally. 

Eg, an unprotected glob in the first argument, eg:
eawk foo* '/foobar/{$1="x"; print $0}'

If foo1 and foo2 existed, this would be considered as:
awk foo2 /foobar/{$1="x"; print $0}' foo1

which really will NOT have the desired effect.

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Trustee & Treasurer
E-Mail   : robb...@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136



Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place

2016-05-18 Thread Amadeusz Żołnowski
Göktürk Yüksek  writes:
>> +cat "${f}" >"${tmpf}" || return 1
> Why shell redirection with cat instead of cp? both are in coreutils.

I thought cp could overwrite file mode of already existing tmp file, but
actually it doesn't, so cp can be here as well. Is there actual benefit
of using cp here?

> Also, wouldn't the absence of 'die' cause silent breakages?

I want to caller decide whether die or not and what error messge to
give.

Cheers,

-- 
Amadeusz Żołnowski


signature.asc
Description: PGP signature


Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place

2016-05-18 Thread Göktürk Yüksek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Amadeusz Żołnowski:
> Göktürk Yüksek  writes:
>>> +   cat "${f}" >"${tmpf}" || return 1
>> Why shell redirection with cat instead of cp? both are in
>> coreutils.
> 
> I thought cp could overwrite file mode of already existing tmp
> file, but actually it doesn't, so cp can be here as well. Is there
> actual benefit of using cp here?
> 
There could be some performance implications. cat will usually do
slow, buffered I/O. cp tries to be smarter with allocation, i.e. it
may take advantage of the btrfs specific clone to do a O(1) copy.

>> Also, wouldn't the absence of 'die' cause silent breakages?
> 
> I want to caller decide whether die or not and what error messge
> to give.
> 
Maybe that should be part of the documentation. People are more likely
to assume that it will die on its own, I think. Is there a case in
which you would not want to die?

> Cheers,
> 

-BEGIN PGP SIGNATURE-

iQEcBAEBCgAGBQJXPPtVAAoJEIT4AuXAiM4zhX4H+gNivSvNvQzf3tsjmbVatGWB
DLIvIxUY7h79c0YDTXnaU+4LLf7CvED26XT9QNWp297OfNpsXKWGTR5GbdG+w0ab
SR490l9Uh/qn8HBKvh1hmPTEyeRHXm0ZoQ6/jrgwlz7ehSawQlzGRUPqFOHj88Fc
qwWhKk1p2fc7TUnRO0SUY/xcRyZeEyUqEG3ueVYfPlTo10rC5+B20IFjnO09vwbT
INV27KHqjLnpRT4xGWvCyCiEfw6DDypxZ/PKfr4c7omHF8OF+5GGnf+FFZ8UJFkt
93TVIPDeUC9XeAsmqirgN5LuYWsNNUwTEdiDfjglLrTb6OgXA0eIIwXsGH/G3d4=
=J3uT
-END PGP SIGNATURE-



Re: [gentoo-dev] [PATCH] rebar.eclass: Build Erlang/OTP projects using dev-util/rebar

2016-05-18 Thread Peter Stuge
Cool!

aide...@gentoo.org wrote:
> +_find_dep_version() {
> + local pn="$1"
> + local p
> +
> + pushd "${EPREFIX}$(get_erl_libs)" >/dev/null
> + for p in ${pn} ${pn}-*; do
> + if [[ -d ${p} ]]; then
> + echo "${p#${pn}-}"
> + return 0

No popd on success?

> + fi
> + done
> + popd >/dev/null
> +
> + return 1
> +}



> +# @FUNCTION: eawk
> +# @USAGE:  
> +# @DESCRIPTION:
> +# Edit file  in place with awk. Pass all arguments following  to
> +# awk.
> +eawk() {
> + local f="$1"; shift
> + local tmpf="$(emktemp)"
> +
> + cat "${f}" >"${tmpf}" || return 1
> + awk "$@" "${tmpf}" >"${f}"
> +}

Wouldn't it be nicer to cut cat, awk > $tmpf && mv $tmpf $f ?


//Peter



Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place

2016-05-18 Thread Jeroen Roovers
On Wed, 18 May 2016 19:31:38 -0400
Göktürk Yüksek  wrote:

> There could be some performance implications. cat will usually do
> slow, buffered I/O. cp tries to be smarter with allocation, i.e. it
> may take advantage of the btrfs specific clone to do a O(1) copy.

Really? We're talking about editing streams of usually a couple of
kilobytes and performance is what you're worried about? Because of
not using one particular filesystem maybe? Really?


 jer



Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place

2016-05-18 Thread Göktürk Yüksek
Jeroen Roovers:
> On Wed, 18 May 2016 19:31:38 -0400
> Göktürk Yüksek  wrote:
> 
>> There could be some performance implications. cat will usually do
>> slow, buffered I/O. cp tries to be smarter with allocation, i.e. it
>> may take advantage of the btrfs specific clone to do a O(1) copy.
> 
> Really? We're talking about editing streams of usually a couple of
> kilobytes and performance is what you're worried about? Because of
> not using one particular filesystem maybe? Really?
> 
> 
I wasn't against the use of redirection, just wondering if there was a
reason to prefer that over cp. To me, an extra dup2() in redirection
seems useless. You can also argue that an extra syscall() has no visible
impact and I wouldn't object. cp should work as efficient as shell
redirection and potentially better in some cases. Sure, it won't make a
noticeable difference with such small files.

>  jer
> 




Re: [gentoo-dev] [PATCH] rebar.eclass: Build Erlang/OTP projects using dev-util/rebar

2016-05-18 Thread Michał Górny
On Wed, 18 May 2016 23:35:18 +0100
aide...@gentoo.org wrote:

> From: Amadeusz Żołnowski 
> 
> It is an eclass providing functions to build Erlang/OTP projects using
> dev-util/rebar. All packages in upcoming category dev-erlang are going
> to use this eclass.
> ---
>  eclass/rebar.eclass | 220 
> 
>  1 file changed, 220 insertions(+)
>  create mode 100644 eclass/rebar.eclass
> 
> diff --git a/eclass/rebar.eclass b/eclass/rebar.eclass
> new file mode 100644
> index 000..e1ac52f
> --- /dev/null
> +++ b/eclass/rebar.eclass
> @@ -0,0 +1,220 @@
> +# Copyright 1999-2016 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +# $Id$
> +
> +# @ECLASS: rebar.eclass
> +# @MAINTAINER:
> +# Amadeusz Żołnowski 
> +# @AUTHOR:
> +# Amadeusz Żołnowski 
> +# @BLURB: Build Erlang/OTP projects using dev-util/rebar.
> +# @DESCRIPTION:
> +# An eclass providing functions to build Erlang/OTP projects using
> +# dev-util/rebar.
> +#
> +# rebar is a tool which tries to resolve dependencies itself which is by
> +# cloning remote git repositories. Dependant projects are usually expected to
> +# be in sub-directory 'deps' rather than looking at system Erlang lib
> +# directory. Projects relying on rebar usually don't have 'install' make
> +# targets. The eclass workarounds some of these problems. It handles
> +# installation in a generic way for Erlang/OTP structured projects.
> +
> +case "${EAPI:-0}" in
> + 0|1|2|3|4)
> + die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
> + ;;
> + 5|6)
> + ;;
> + *)
> + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
> + ;;
> +esac
> +
> +[[ ${EAPI} = 5 ]] && inherit eutils
> +
> +EXPORT_FUNCTIONS src_prepare src_compile src_install
> +
> +RDEPEND="dev-lang/erlang"
> +DEPEND="${RDEPEND}
> + dev-util/rebar"
> +
> +# @FUNCTION: get_erl_libs
> +# @RETURN: the path to Erlang lib directory
> +# @DESCRIPTION:
> +# Get the full path without EPREFIX to Erlang lib directory.
> +get_erl_libs() {
> + echo "/usr/$(get_libdir)/erlang/lib"

Missing multilib inherit for EAPI 5.

> +}
> +
> +# @VARIABLE: ERL_LIBS
> +# @DESCRIPTION:
> +# Full path with EPREFIX to Erlang lib directory. Some rebar scripts expect 
> it.
> +export ERL_LIBS="${EPREFIX}$(get_erl_libs)"

I think calling get_libdir in global scope is forbidden. You should
really export this somewhere in phase function.

> +
> +# @FUNCTION: _find_dep_version

Namespace it, please. Just in case.

> +# @INTERNAL
> +# @USAGE: 
> +# @RETURN: full path with EPREFIX to a Erlang package/project
> +# @DESCRIPTION:
> +# Find a Erlang package/project by name in Erlang lib directory. Project
> +# directory is usually suffixed with version. First match to  
> or
> +# -* is returned.
> +_find_dep_version() {
> + local pn="$1"
> + local p
> +
> + pushd "${EPREFIX}$(get_erl_libs)" >/dev/null

|| die

> + for p in ${pn} ${pn}-*; do
> + if [[ -d ${p} ]]; then
> + echo "${p#${pn}-}"
> + return 0
> + fi
> + done
> + popd >/dev/null

|| die

> +
> + return 1
> +}
> +
> +# @FUNCTION: eawk
> +# @USAGE:  
> +# @DESCRIPTION:
> +# Edit file  in place with awk. Pass all arguments following  to
> +# awk.
> +eawk() {
> + local f="$1"; shift
> + local tmpf="$(emktemp)"

Missing eutils inherit for EAPI 6.

> +
> + cat "${f}" >"${tmpf}" || return 1
> + awk "$@" "${tmpf}" >"${f}"
> +}
> +
> +# @FUNCTION: erebar
> +# @USAGE: 
> +# @DESCRIPTION:
> +# Run rebar with verbose flag. Die on failure.
> +erebar() {
> + debug-print-function ${FUNCNAME} "${@}"
> +
> + rebar -v skip_deps=true "$1" || die "rebar $1 failed"
> +}

Any reason it doesn't pass all the parameters? This inconsistency with
emake etc. could be mildly confusing, esp. that you don't check for
wrong argc.

> +
> +# @FUNCTION: rebar_fix_include_path
> +# @USAGE:  []
> +# @DESCRIPTION:
> +# Fix path in rebar.config to 'include' directory of dependant 
> project/package,
> +# so it points to installation in system Erlang lib rather than relative 
> 'deps'
> +# directory.
> +#
> +#  is optional. Default is 'rebar.config'.

Is it likely that you would be passing different values to it? Maybe it
would be reasonable to make this an eclass variable.

> +#
> +# The function dies on failure.
> +rebar_fix_include_path() {
> + debug-print-function ${FUNCNAME} "${@}"
> +
> + local pn="$1"
> + local rebar_config="${2:-rebar.config}"
> + local erl_libs="${EPREFIX}$(get_erl_libs)"
> + local pv="$(_find_dep_version "${pn}")"
> +
> + eawk "${rebar_config}" \
> + -v erl_libs="${erl_libs}" -v pn="${pn}" -v pv="${pv}" \
> + '/^{[[:space:]]*erl_opts[[:space:]]*,/, /}[[:space:]]*\.$/ {
> + pattern = "\"(./)?deps/" pn "/include\"";
> + if (match($0, "{i,[[:space:]]*" pattern "[[:space:]]*}")) {
> +