Upgraded packages to latest upstream

Upgraded app-shells/dash to v0.5.12

BUG=None
TEST=presubmit
RELEASE_NOTE=Upgraded app-shells/dash to v0.5.12.

Change-Id: I1cf340debee1c21d319c383178be58fd5d9dc55d
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/portage-stable/+/44511
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Chenglong Tang <chenglongtang@google.com>
diff --git a/app-shells/dash/Manifest b/app-shells/dash/Manifest
index b0230c8..0bcb6fd 100644
--- a/app-shells/dash/Manifest
+++ b/app-shells/dash/Manifest
@@ -1 +1,2 @@
-DIST dash-0.5.9.1.tar.gz 225217 SHA256 5ecd5bea72a93ed10eb15a1be9951dd51b52e5da1d4a7ae020efd9826b49e659 SHA512 d56a043b8fab4693d3f70cceb531c37174e7ded4acd5549e53048d7ce29125ff21d7e758f51a4a73e06250d051e246467039989275838c19a2579edea3f72b7d WHIRLPOOL 233ced314d1091a7a27fc9a0f86a3d87f9a08d067a8b171ead7294a12b573071e9d63a5607424eb6d4f7a0c193f374a461cd94b205412928b93341d4b75a9095
+DIST dash-0.5.11.5.tar.gz 240681 BLAKE2B 71c5e0acc127a01c75233b6d0a563979e5d856f16e3d108a68eb54d0b4b00f527f382e3e6aa963f9cff71bfaea2f524ba204ed04b7d006bd781784b2351e38c4 SHA512 5387e213820eeb44d812bb4697543023fd4662b51a9ffd52a702810fed8b28d23fbe35a7f371e6686107de9f81902eff109458964b4622f4c5412d60190a66bf
+DIST dash-0.5.12.tar.gz 246054 BLAKE2B f4c5e7088d7b591e0890a0e1363ef4f70074f4033ae34d3f82d71379cee78876e1e89b5d8e4afa3ce9380f8d94c3e8970c480a21257f87706112dd883667893e SHA512 13bd262be0089260cbd13530a9cf34690c0abeb2f1920eb5e61be7951b716f9f335b86279d425dbfae56cbd49231a8fdffdff70601a5177da3d543be6fc5eb17
diff --git a/app-shells/dash/dash-0.5.12.ebuild b/app-shells/dash/dash-0.5.12.ebuild
new file mode 100644
index 0000000..696fb0b
--- /dev/null
+++ b/app-shells/dash/dash-0.5.12.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Debian Almquist Shell"
+HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/"
+SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="*"
+IUSE="libedit static"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="!static? ( libedit? ( dev-libs/libedit ) )"
+DEPEND="
+	${RDEPEND}
+	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 || die
+
+	# Use pkg-config for libedit linkage
+	sed -i \
+		-e "/LIBS/s:-ledit:\`$(tc-getPKG_CONFIG) --libs libedit $(usex static --static '')\`:" \
+		configure || die
+}
+
+src_configure() {
+	if [[ ${CHOST} == *-solaris* ]] ; then
+		# don't redefine stat, open, dirent, etc. on Solaris
+		export ac_cv_func_stat64=yes
+		export ac_cv_func_open64=yes
+
+		# if your headers strictly adhere to POSIX, you'll need this too
+		[[ ${CHOST##*solaris2.} -le 10 ]] && append-cppflags -DNAME_MAX=255
+	fi
+
+	if [[ ${CHOST} == powerpc-*-darwin* ]] ; then
+		sed -i -e 's/= stpncpy(s, \([^,]\+\), \([0-9]\+\))/+= snprintf(s, \2, "%s", \1)/' \
+			src/jobs.c || die
+	fi
+
+	use static && append-ldflags -static
+
+	append-cppflags -DJOBS=$(usex libedit 1 0)
+
+	# Do not pass --enable-glob due to #443552.
+	local myeconfargs=(
+		CC_FOR_BUILD="$(tc-getBUILD_CC)"
+		--bindir="${EPREFIX}"/bin
+		--enable-fnmatch
+		$(use_with libedit)
+	)
+
+	econf "${myeconfargs[@]}"
+}
diff --git a/app-shells/dash/dash-0.5.9.1-r3.ebuild b/app-shells/dash/dash-0.5.9.1-r3.ebuild
deleted file mode 100644
index bbd6253..0000000
--- a/app-shells/dash/dash-0.5.9.1-r3.ebuild
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit flag-o-matic toolchain-funcs versionator
-
-#MY_PV="$(get_version_component_range 1-3)"
-DEB_PATCH="" #$(get_version_component_range 4)
-#MY_P="${PN}-${MY_PV}"
-
-DESCRIPTION="Debian Almquist Shell"
-HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/"
-SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${P}.tar.gz"
-if [[ -n "${DEB_PATCH}" ]] ; then
-	DEB_PF="${PN}_${MY_PV}-${DEB_PATCH}"
-	SRC_URI+=" mirror://debian/pool/main/d/dash/${DEB_PF}.diff.gz"
-fi
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="*"
-IUSE="libedit static vanilla"
-
-RDEPEND="!static? ( libedit? ( dev-libs/libedit ) )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig
-	libedit? ( static? ( dev-libs/libedit[static-libs] ) )"
-
-PATCHES=( "${FILESDIR}"/${PN}-0.5.9.1-format-security.patch )
-
-src_prepare() {
-	if [[ -n "${DEB_PATCH}" ]] ; then
-		eapply "${WORKDIR}"/${DEB_PF}.diff
-		eapply */debian/diff/*
-	fi
-
-	#337329 #527848
-	use vanilla ||  epatch "${FILESDIR}"/${PN}-0.5.9.1-dumb-echo.patch
-
-	epatch "${PATCHES[@]}"
-
-	# 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
-	fi
-	append-cppflags -DJOBS=$(usex libedit 1 0)
-	use static && append-ldflags -static
-	# Do not pass --enable-glob due to #443552.
-	# Autotools use $LINENO as a proxy for extended debug support
-	# (i.e. they're running bash), so disable that. #527644
-	local myeconfargs=(
-		CC_FOR_BUILD="$(tc-getBUILD_CC)"
-		--bindir="${EPREFIX}"/bin
-		--enable-fnmatch
-		--disable-lineno
-		$(use_with libedit)
-	)
-	econf "${myeconfargs[@]}"
-}
-
-src_install() {
-	default
-	if [[ -n "${DEB_PATCH}" ]] ; then
-		dodoc */debian/changelog
-	fi
-}
diff --git a/app-shells/dash/dash-0.5.9.1-r7.ebuild b/app-shells/dash/dash-0.5.9.1-r7.ebuild
deleted file mode 120000
index 378f059..0000000
--- a/app-shells/dash/dash-0.5.9.1-r7.ebuild
+++ /dev/null
@@ -1 +0,0 @@
-dash-0.5.9.1-r3.ebuild
\ No newline at end of file
diff --git a/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch b/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch
new file mode 100644
index 0000000..9474022
--- /dev/null
+++ b/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch
@@ -0,0 +1,46 @@
+From 29d6f2148f10213de4e904d515e792d2cf8c968e Mon Sep 17 00:00:00 2001
+From: Herbert Xu <herbert@gondor.apana.org.au>
+Date: Thu, 4 Jun 2020 21:53:55 +1000
+Subject: eval: Check nflag in evaltree instead of cmdloop
+
+This patch moves the nflag check from cmdloop into evaltree.  This
+is so that nflag will be in force even if we enter the shell via a
+path other than cmdloop, e.g., through sh -c.
+
+Reported-by: Joey Hess <id@joeyh.name>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ src/eval.c | 3 +++
+ src/main.c | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/eval.c b/src/eval.c
+index d10be38..9476fbb 100644
+--- a/src/eval.c
++++ b/src/eval.c
+@@ -213,6 +213,9 @@ evaltree(union node *n, int flags)
+ 
+ 	setstackmark(&smark);
+ 
++	if (nflag)
++		goto out;
++
+ 	if (n == NULL) {
+ 		TRACE(("evaltree(NULL) called\n"));
+ 		goto out;
+diff --git a/src/main.c b/src/main.c
+index 7a28534..5c49fdc 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -233,7 +233,7 @@ cmdloop(int top)
+ 				out2str("\nUse \"exit\" to leave shell.\n");
+ 			}
+ 			numeof++;
+-		} else if (nflag == 0) {
++		} else {
+ 			int i;
+ 
+ 			job_warning = (job_warning == 2) ? 1 : 0;
+-- 
+cgit 1.2.3-1.el7
+
diff --git a/app-shells/dash/files/dash-0.5.9.1-dumb-echo.patch b/app-shells/dash/files/dash-0.5.9.1-dumb-echo.patch
deleted file mode 100644
index cbf5feb..0000000
--- a/app-shells/dash/files/dash-0.5.9.1-dumb-echo.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-http://bugs.gentoo.org/337329
-http://bugs.gentoo.org/527848
-
-there's no requirement for `echo` to support escape sequences. bash, by default,
-does not, while dash always does.  POSIX permits either behavior:
-http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
-
-however, since the behavior is not portable, no one should be relying on echo
-having any specific behavior.  they should use `printf` when they want an escape
-sequence.  it also makes dash smaller & faster to disable this logic entirely.
-
---- dash-0.5.9.1/src/bltin/printf.c
-+++ dash-0.5.9.1/src/bltin/printf.c
-@@ -449,21 +449,12 @@
- int
- echocmd(int argc, char **argv)
- {
--	int nonl;
--
--	nonl = *++argv ? equal(*argv, "-n") : 0;
--	argv += nonl;
--
--	do {
--		int c;
--
--		if (likely(*argv))
--			nonl += print_escape_str("%s", NULL, NULL, *argv++);
--		if (likely((nonl + !*argv) > 1))
--			break;
--
--		c = *argv ? ' ' : '\n';
--		out1c(c);
--	} while (*argv);
-+	int i;
-+	for (i = 1; i < argc; ++i) {
-+		outstr(argv[i], out1);
-+		if (i < argc - 1)
-+			outc(' ', out1);
-+	}
-+	outc('\n', out1);
- 	return 0;
- }
---- dash-0.5.9.1/src/dash.1
-+++ dash-0.5.9.1/src/dash.1
-@@ -1182,43 +1182,15 @@
- option turns off the effect of any preceding
- .Fl P
- options.
--.It Xo echo Op Fl n
-+.It Xo echo
- .Ar args... 
- .Xc
- Print the arguments on the standard output, separated by spaces.
--Unless the
--.Fl n
--option is present, a newline is output following the arguments.
- .Pp
--If any of the following sequences of characters is encountered during
--output, the sequence is not output.  Instead, the specified action is
--performed:
--.Bl -tag -width indent
--.It Li \eb
--A backspace character is output.
--.It Li \ec
--Subsequent output is suppressed.  This is normally used at the end of the
--last argument to suppress the trailing newline that
--.Ic echo
--would otherwise output.
--.It Li \ef
--Output a form feed.
--.It Li \en
--Output a newline character.
--.It Li \er
--Output a carriage return.
--.It Li \et
--Output a (horizontal) tab character.
--.It Li \ev
--Output a vertical tab.
--.It Li \e0 Ns Ar digits
--Output the character whose value is given by zero to three octal digits.
--If there are zero digits, a nul character is output.
--.It Li \e\e
--Output a backslash.
--.El
-+No arguments or backslash sequences are supported as they are not portable.
-+They will be printed out exactly as passed in.
- .Pp
--All other backslash sequences elicit undefined behaviour.
-+You can replace `echo -n ...` with the portable `printf %s ...` construct.
- .It eval Ar string ...
- Concatenate all the arguments with spaces.
- Then re-parse and execute the command.
diff --git a/app-shells/dash/files/dash-0.5.9.1-format-security.patch b/app-shells/dash/files/dash-0.5.9.1-format-security.patch
deleted file mode 100644
index ea2114f..0000000
--- a/app-shells/dash/files/dash-0.5.9.1-format-security.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Origin: https://bugzilla.redhat.com/show_bug.cgi?id=1037030#c2
-
---- a/src/jobs.c
-+++ a/src/jobs.c
-@@ -427,7 +427,7 @@ sprint_status(char *s, int status, int sigonly)
- 				goto out;
- #endif
- 		}
--		col = fmtstr(s, 32, strsignal(st));
-+		col = fmtstr(s, 32, "%s", strsignal(st));
- #ifdef WCOREDUMP
- 		if (WCOREDUMP(status)) {
- 			col += fmtstr(s + col, 16, " (core dumped)");
diff --git a/app-shells/dash/metadata.xml b/app-shells/dash/metadata.xml
index 0d01a34..1e65c6d 100644
--- a/app-shells/dash/metadata.xml
+++ b/app-shells/dash/metadata.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 	<maintainer type="project">
 		<email>base-system@gentoo.org</email>
@@ -8,9 +8,6 @@
 	<upstream>
 		<remote-id type="cpe">cpe:/a:dash:dash</remote-id>
 	</upstream>
-	<use>
-		<flag name="vanilla">Support echo -n, and enable echo -e all the time (unsupported)</flag>
-	</use>
 	<longdescription lang="en">
 		DASH is a direct descendant of the NetBSD version of ash (the Almquist SHell)
 		and is POSIX compliant.