1 |
commit: ed7230d4486049fdd155ac6b86e07578d624aeb0 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 3 14:37:33 2018 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 3 14:39:51 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed7230d4 |
7 |
|
8 |
dev-libs/openssl: fix race condition in install phase |
9 |
|
10 |
Closes: https://bugs.gentoo.org/665130 |
11 |
Package-Manager: Portage-2.3.48, Repoman-2.3.10 |
12 |
|
13 |
dev-libs/openssl/openssl-1.0.2p.ebuild | 18 ++++++++++++------ |
14 |
dev-libs/openssl/openssl-1.1.1_pre9.ebuild | 16 +++++++++++----- |
15 |
2 files changed, 23 insertions(+), 11 deletions(-) |
16 |
|
17 |
diff --git a/dev-libs/openssl/openssl-1.0.2p.ebuild b/dev-libs/openssl/openssl-1.0.2p.ebuild |
18 |
index 74788708e98..ddc45aa8700 100644 |
19 |
--- a/dev-libs/openssl/openssl-1.0.2p.ebuild |
20 |
+++ b/dev-libs/openssl/openssl-1.0.2p.ebuild |
21 |
@@ -106,7 +106,7 @@ src_prepare() { |
22 |
-e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
23 |
-e $(has noman FEATURES \ |
24 |
&& echo '/^install:/s:install_docs::' \ |
25 |
- || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
26 |
+ || echo '/^MANDIR=/s:=.*:='${EPREFIX%/}'/usr/share/man:') \ |
27 |
Makefile.org \ |
28 |
|| die |
29 |
# show the actual commands in the log |
30 |
@@ -131,7 +131,7 @@ src_prepare() { |
31 |
append-flags $(test-flags-CC -Wa,--noexecstack) |
32 |
append-cppflags -DOPENSSL_NO_BUF_FREELISTS |
33 |
|
34 |
- sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906 |
35 |
+ sed -i '1s,^:$,#!'${EPREFIX%/}'/usr/bin/perl,' Configure #141906 |
36 |
# The config script does stupid stuff to prompt the user. Kill it. |
37 |
sed -i '/stty -icanon min 0 time 50; read waste/d' config || die |
38 |
./config --test-sanity || die "I AM NOT SANE" |
39 |
@@ -203,8 +203,8 @@ multilib_src_configure() { |
40 |
$(use_ssl sslv3 ssl3) \ |
41 |
$(use_ssl tls-heartbeat heartbeats) \ |
42 |
$(use_ssl zlib) \ |
43 |
- --prefix="${EPREFIX}"/usr \ |
44 |
- --openssldir="${EPREFIX}"${SSL_CNF_DIR} \ |
45 |
+ --prefix="${EPREFIX%/}"/usr \ |
46 |
+ --openssldir="${EPREFIX%/}"${SSL_CNF_DIR} \ |
47 |
--libdir=$(get_libdir) \ |
48 |
shared threads \ |
49 |
|| die |
50 |
@@ -239,13 +239,19 @@ multilib_src_test() { |
51 |
} |
52 |
|
53 |
multilib_src_install() { |
54 |
- emake INSTALL_PREFIX="${D}" install |
55 |
+ # We need to create $D/usr on our own to avoid a race condition #665130 |
56 |
+ if [[ ! -d "${D%/}/usr" ]]; then |
57 |
+ # We can only create this directory once |
58 |
+ mkdir "${D%/}"/usr || die |
59 |
+ fi |
60 |
+ |
61 |
+ emake INSTALL_PREFIX="${D%/}" install |
62 |
} |
63 |
|
64 |
multilib_src_install_all() { |
65 |
# openssl installs perl version of c_rehash by default, but |
66 |
# we provide a shell version via app-misc/c_rehash |
67 |
- rm "${ED}"/usr/bin/c_rehash || die |
68 |
+ rm "${ED%/}"/usr/bin/c_rehash || die |
69 |
|
70 |
local -a DOCS=( CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el ) |
71 |
einstalldocs |
72 |
|
73 |
diff --git a/dev-libs/openssl/openssl-1.1.1_pre9.ebuild b/dev-libs/openssl/openssl-1.1.1_pre9.ebuild |
74 |
index e16b92f76ff..e694ab91d16 100644 |
75 |
--- a/dev-libs/openssl/openssl-1.1.1_pre9.ebuild |
76 |
+++ b/dev-libs/openssl/openssl-1.1.1_pre9.ebuild |
77 |
@@ -58,7 +58,7 @@ src_prepare() { |
78 |
-e '/^MAKEDEPPROG/s:=.*:=$(CC):' \ |
79 |
-e $(has noman FEATURES \ |
80 |
&& echo '/^install:/s:install_docs::' \ |
81 |
- || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
82 |
+ || echo '/^MANDIR=/s:=.*:='${EPREFIX%/}'/usr/share/man:') \ |
83 |
-e "/^DOCDIR/s@\$(BASENAME)@&-${PF}@" \ |
84 |
Configurations/unix-Makefile.tmpl \ |
85 |
|| die |
86 |
@@ -78,7 +78,7 @@ src_prepare() { |
87 |
|
88 |
# Prefixify Configure shebang (#141906) |
89 |
sed \ |
90 |
- -e "1s,/usr/bin/env,${EPREFIX}&," \ |
91 |
+ -e "1s,/usr/bin/env,${EPREFIX%/}&," \ |
92 |
-i Configure || die |
93 |
# Remove test target when FEATURES=test isn't set |
94 |
if ! use test ; then |
95 |
@@ -150,8 +150,8 @@ multilib_src_configure() { |
96 |
$(use_ssl sctp) \ |
97 |
$(use_ssl tls-heartbeat heartbeats) \ |
98 |
$(use_ssl zlib) \ |
99 |
- --prefix="${EPREFIX}"/usr \ |
100 |
- --openssldir="${EPREFIX}"${SSL_CNF_DIR} \ |
101 |
+ --prefix="${EPREFIX%/}"/usr \ |
102 |
+ --openssldir="${EPREFIX%/}"${SSL_CNF_DIR} \ |
103 |
--libdir=$(get_libdir) \ |
104 |
shared threads \ |
105 |
|| die |
106 |
@@ -185,7 +185,13 @@ multilib_src_test() { |
107 |
} |
108 |
|
109 |
multilib_src_install() { |
110 |
- emake DESTDIR="${D}" install |
111 |
+ # We need to create $D/usr on our own to avoid a race condition #665130 |
112 |
+ if [[ ! -d "${D%/}/usr" ]]; then |
113 |
+ # We can only create this directory once |
114 |
+ mkdir "${D%/}"/usr || die |
115 |
+ fi |
116 |
+ |
117 |
+ emake DESTDIR="${D%}" install |
118 |
} |
119 |
|
120 |
multilib_src_install_all() { |