Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/dash/files/, app-shells/dash/
Date: Wed, 13 Sep 2017 00:21:05
Message-Id: 1505262046.900e6203d4015711887137bcd03c913361dbf41f.whissi@gentoo
1 commit: 900e6203d4015711887137bcd03c913361dbf41f
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 13 00:20:46 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 13 00:20:46 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=900e6203
7
8 app-shells/dash: fix build with format-security
9
10 Package-Manager: Portage-2.3.8, Repoman-2.3.3
11
12 app-shells/dash/dash-0.5.9.1-r3.ebuild | 76 ++++++++++++++++++++++
13 .../dash/files/dash-0.5.9.1-format-security.patch | 13 ++++
14 2 files changed, 89 insertions(+)
15
16 diff --git a/app-shells/dash/dash-0.5.9.1-r3.ebuild b/app-shells/dash/dash-0.5.9.1-r3.ebuild
17 new file mode 100644
18 index 00000000000..2074bf271f9
19 --- /dev/null
20 +++ b/app-shells/dash/dash-0.5.9.1-r3.ebuild
21 @@ -0,0 +1,76 @@
22 +# Copyright 1999-2017 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +
27 +inherit flag-o-matic toolchain-funcs versionator
28 +
29 +#MY_PV="$(get_version_component_range 1-3)"
30 +DEB_PATCH="" #$(get_version_component_range 4)
31 +#MY_P="${PN}-${MY_PV}"
32 +
33 +DESCRIPTION="Debian Almquist Shell"
34 +HOMEPAGE="http://gondor.apana.org.au/~herbert/dash/"
35 +SRC_URI="http://gondor.apana.org.au/~herbert/dash/files/${P}.tar.gz"
36 +if [[ -n "${DEB_PATCH}" ]] ; then
37 + DEB_PF="${PN}_${MY_PV}-${DEB_PATCH}"
38 + SRC_URI+=" mirror://debian/pool/main/d/dash/${DEB_PF}.diff.gz"
39 +fi
40 +
41 +LICENSE="BSD"
42 +SLOT="0"
43 +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"
44 +IUSE="libedit static vanilla"
45 +
46 +RDEPEND="!static? ( libedit? ( dev-libs/libedit ) )"
47 +DEPEND="${RDEPEND}
48 + virtual/pkgconfig
49 + libedit? ( static? ( dev-libs/libedit[static-libs] ) )"
50 +
51 +PATCHES=( "${FILESDIR}"/${PN}-0.5.9.1-format-security.patch )
52 +
53 +src_prepare() {
54 + if [[ -n "${DEB_PATCH}" ]] ; then
55 + eapply "${WORKDIR}"/${DEB_PF}.diff
56 + eapply */debian/diff/*
57 + fi
58 +
59 + #337329 #527848
60 + use vanilla || eapply "${FILESDIR}"/${PN}-0.5.9.1-dumb-echo.patch
61 +
62 + default
63 +
64 + # Fix the invalid sort
65 + sed -i -e 's/LC_COLLATE=C/LC_ALL=C/g' src/mkbuiltins
66 +
67 + # Use pkg-config for libedit linkage
68 + sed -i \
69 + -e "/LIBS/s:-ledit:\`$(tc-getPKG_CONFIG) --libs libedit $(usex static --static '')\`:" \
70 + configure || die
71 +}
72 +
73 +src_configure() {
74 + # don't redefine stat on Solaris
75 + if [[ ${CHOST} == *-solaris* ]] ; then
76 + export ac_cv_func_stat64=yes
77 + fi
78 + append-cppflags -DJOBS=$(usex libedit 1 0)
79 + use static && append-ldflags -static
80 + # Do not pass --enable-glob due to #443552.
81 + # Autotools use $LINENO as a proxy for extended debug support
82 + # (i.e. they're running bash), so disable that. #527644
83 + local myeconfargs=(
84 + --bindir="${EPREFIX}"/bin
85 + --enable-fnmatch
86 + --disable-lineno
87 + $(use_with libedit)
88 + )
89 + econf "${myeconfargs[@]}"
90 +}
91 +
92 +src_install() {
93 + default
94 + if [[ -n "${DEB_PATCH}" ]] ; then
95 + dodoc */debian/changelog
96 + fi
97 +}
98
99 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
100 new file mode 100644
101 index 00000000000..ea2114f392b
102 --- /dev/null
103 +++ b/app-shells/dash/files/dash-0.5.9.1-format-security.patch
104 @@ -0,0 +1,13 @@
105 +Origin: https://bugzilla.redhat.com/show_bug.cgi?id=1037030#c2
106 +
107 +--- a/src/jobs.c
108 ++++ a/src/jobs.c
109 +@@ -427,7 +427,7 @@ sprint_status(char *s, int status, int sigonly)
110 + goto out;
111 + #endif
112 + }
113 +- col = fmtstr(s, 32, strsignal(st));
114 ++ col = fmtstr(s, 32, "%s", strsignal(st));
115 + #ifdef WCOREDUMP
116 + if (WCOREDUMP(status)) {
117 + col += fmtstr(s + col, 16, " (core dumped)");