diff options
authorMichael Orlitzky <>2020-03-15 11:34:34 -0400
committerMichael Orlitzky <>2020-03-15 11:56:02 -0400
commit808dded4f103becf7929562b1ed58046aa63f3f6 (patch)
tree064217def806ec1590a27d7d72e8d9736b9168f1 /app-shells/dash/dash-
parentkde-frameworks/kdoctools: Fix patch name (diff)
app-shells/dash: new revision that more-closely matches upstream.
Our dash ebuilds differed from upstream in two ways in the past: we disabled LINENO support with --disable-lineno, and we patched the "echo" command to ignore certain arguments and escape sequences. Disabling LINENO tricks configure scripts into re-executing themselves with bash, which can hide errors for users (good?), but also hides them from developers (bad). The LINENO variable is covered by POSIX, and it's counterintuitive to silently force bash on users who have explicitly set /bin/sh to dash. This new revision therefore re-enables LINENO. This same change (in the context of Debian) was discussed on the autoconf mailing list. The "dumb echo" patch reflects a similar situation. Dash's upstream "echo" implementation differs from the bash implementation, but is correct according to POSIX. This can shed light upon some portability bugs, particularly in autoconf scripts, and the "dumb echo" patch hides some of those bugs from end users. But again, it hides them from the authors as well and thereby perpetuates the portability issues. Since this patch is Gentoo-specific, and hides problems that are better addressed elsewhere, this new revision eliminates it. Closes: Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Michael Orlitzky <>
Diffstat (limited to 'app-shells/dash/dash-')
1 files changed, 53 insertions, 0 deletions
diff --git a/app-shells/dash/dash- b/app-shells/dash/dash-
new file mode 100644
index 00000000000..877c0771557
--- /dev/null
+++ b/app-shells/dash/dash-
@@ -0,0 +1,53 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+inherit flag-o-matic toolchain-funcs
+DESCRIPTION="Debian Almquist Shell"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit static"
+RDEPEND="!static? ( libedit? ( dev-libs/libedit ) )"
+ libedit? ( static? ( dev-libs/libedit[static-libs] ) )"
+src_prepare() {
+ default
+ # Fix the invalid sort
+ sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins
+ # Use pkg-config for libedit linkage
+ sed -i \
+ -e "/LIBS/s:-ledit:\`$(tc-getPKG_CONFIG) --libs libedit $(usex static --static '')\`:" \
+ configure || die
+src_configure() {
+ # don't redefine stat on Solaris
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ export ac_cv_func_stat64=yes
+ # if your headers strictly adhere to POSIX, you'll need this too
+ [[ ${CHOST##*solaris2.} -le 10 ]] && append-cppflags -DNAME_MAX=255
+ fi
+ append-cppflags -DJOBS=$(usex libedit 1 0)
+ use static && append-ldflags -static
+ # Do not pass --enable-glob due to #443552.
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/bin
+ --enable-fnmatch
+ $(use_with libedit)
+ )
+ econf "${myeconfargs[@]}"