Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/zsh/files/, app-shells/zsh/
Date: Tue, 05 Jun 2018 20:39:13
Message-Id: 1528230933.d09566dc69f7806142d67955f8d05383d60d0622.williamh@gentoo
1 commit: d09566dc69f7806142d67955f8d05383d60d0622
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 24 19:27:50 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 5 20:35:33 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d09566dc
7
8 app-shells/zsh: check for /usr/sbin in ROOTPATH before using it
9
10 The maintainer, radhermit <AT> gentoo.org, authorized me to fix this bug
11 (williamh).
12
13 Closes: https://bugs.gentoo.org/656400
14 Closes: https://github.com/gentoo/gentoo/pull/8550
15 Closes: https://github.com/gentoo/gentoo/pull/8566
16
17 app-shells/zsh/files/zprofile-4 | 42 ++++++++++++++++++++++
18 .../zsh/{zsh-5.5.1.ebuild => zsh-5.5.1-r1.ebuild} | 2 +-
19 app-shells/zsh/zsh-9999.ebuild | 11 ++----
20 3 files changed, 45 insertions(+), 10 deletions(-)
21
22 diff --git a/app-shells/zsh/files/zprofile-4 b/app-shells/zsh/files/zprofile-4
23 new file mode 100644
24 index 00000000000..6402ca718d3
25 --- /dev/null
26 +++ b/app-shells/zsh/files/zprofile-4
27 @@ -0,0 +1,42 @@
28 +# /etc/zsh/zprofile
29 +
30 +# Load environment settings from profile.env, which is created by
31 +# env-update from the files in /etc/env.d
32 +if [ -e /etc/profile.env ] ; then
33 + . /etc/profile.env
34 +fi
35 +
36 +# You should override these in your ~/.zprofile (or equivalent) for per-user
37 +# settings. For system defaults, you can add a new file in /etc/profile.d/.
38 +export EDITOR=${EDITOR:-/bin/nano}
39 +export PAGER=${PAGER:-/usr/bin/less}
40 +
41 +# 077 would be more secure, but 022 is generally quite realistic
42 +umask 022
43 +
44 +# Set up PATH depending on whether we're root or a normal user.
45 +# There's no real reason to exclude sbin paths from the normal user,
46 +# but it can make tab-completion easier when they aren't in the
47 +# user's PATH to pollute the executable namespace.
48 +#
49 +# It is intentional in the following line to use || instead of -o.
50 +# This way the evaluation can be short-circuited and calling whoami is
51 +# avoided.
52 +if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
53 + # Check to make sure ROOTPATH is sane before we use it.
54 + # https://bugs.gentoo.org/656400
55 + if [[ :${ROOTPATH}: == *:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:* ]]; then
56 + PATH="${ROOTPATH}"
57 + fi
58 +fi
59 +export PATH
60 +unset ROOTPATH
61 +
62 +shopts=$-
63 +setopt nullglob
64 +for sh in /etc/profile.d/*.sh ; do
65 + [ -r "$sh" ] && . "$sh"
66 +done
67 +unsetopt nullglob
68 +set -$shopts
69 +unset sh shopts
70
71 diff --git a/app-shells/zsh/zsh-5.5.1.ebuild b/app-shells/zsh/zsh-5.5.1-r1.ebuild
72 similarity index 98%
73 rename from app-shells/zsh/zsh-5.5.1.ebuild
74 rename to app-shells/zsh/zsh-5.5.1-r1.ebuild
75 index 4c17da09db4..9f6dc303d88 100644
76 --- a/app-shells/zsh/zsh-5.5.1.ebuild
77 +++ b/app-shells/zsh/zsh-5.5.1-r1.ebuild
78 @@ -139,7 +139,7 @@ src_install() {
79
80 insinto /etc/zsh
81 export PREFIX_QUOTE_CHAR='"' PREFIX_EXTRA_REGEX="/EUID/s,0,${EUID},"
82 - newins "$(prefixify_ro "${FILESDIR}"/zprofile-3)" zprofile
83 + newins "$(prefixify_ro "${FILESDIR}"/zprofile-4)" zprofile
84
85 keepdir /usr/share/zsh/site-functions
86 insinto /usr/share/zsh/${PV%_*}/functions/Prompts
87
88 diff --git a/app-shells/zsh/zsh-9999.ebuild b/app-shells/zsh/zsh-9999.ebuild
89 index f53a6be7a4d..9f6dc303d88 100644
90 --- a/app-shells/zsh/zsh-9999.ebuild
91 +++ b/app-shells/zsh/zsh-9999.ebuild
92 @@ -57,14 +57,6 @@ src_prepare() {
93 eapply "${FILESDIR}"/${PN}-5.3-init.d-gentoo.diff
94 fi
95
96 - cp "${FILESDIR}"/zprofile-2 "${T}"/zprofile || die
97 - eprefixify "${T}"/zprofile || die
98 - if use prefix ; then
99 - sed -i -e 's|@ZSH_PREFIX@||' -e '/@ZSH_NOPREFIX@/d' "${T}"/zprofile || die
100 - else
101 - sed -i -e 's|@ZSH_NOPREFIX@||' -e '/@ZSH_PREFIX@/d' -e 's|""||' "${T}"/zprofile || die
102 - fi
103 -
104 eapply_user
105
106 if [[ ${PV} == 9999* ]] ; then
107 @@ -146,7 +138,8 @@ src_install() {
108 emake DESTDIR="${D}" install $(usex doc "install.info" "")
109
110 insinto /etc/zsh
111 - doins "${T}"/zprofile
112 + export PREFIX_QUOTE_CHAR='"' PREFIX_EXTRA_REGEX="/EUID/s,0,${EUID},"
113 + newins "$(prefixify_ro "${FILESDIR}"/zprofile-4)" zprofile
114
115 keepdir /usr/share/zsh/site-functions
116 insinto /usr/share/zsh/${PV%_*}/functions/Prompts