Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Cc: vim@g.o
Subject: Re: [gentoo-dev] [PATCH 2/3] vim-plugin.eclass: use Portage internal variables.
Date: Sun, 05 Nov 2017 17:25:11
Message-Id: 23039.18794.645357.498976@a1i15.kph.uni-mainz.de
In Reply to: Re: [gentoo-dev] [PATCH 2/3] vim-plugin.eclass: use Portage internal variables. by Patrice Clement
1 >>>>> On Sun, 5 Nov 2017, Patrice Clement wrote:
2
3 > ACK. This code has been there for ages and I also don't think it makes sense to
4 > keep it as it seems these operations are handled by Portage already. Mike
5 > (floppym) suggested to remove the whole if clause and call fperms instead:
6
7 > diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
8 > index abe9c7b3661..46908bb73e6 100644
9 > --- a/eclass/vim-plugin.eclass
10 > +++ b/eclass/vim-plugin.eclass
11 > @@ -35,19 +35,6 @@ vim-plugin_src_install() {
12 > has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
13 > local f
14
15 > - if use !prefix && [[ ${EUID} -eq 0 ]] ; then
16 > - ebegin "Fixing file permissions"
17 > - # Make sure perms are good
18 > - chmod -R a+rX "${S}" || die "chmod failed"
19 > - find "${S}" -user 'portage' -exec chown root '{}' \; || die "chown failed"
20 > - if use userland_BSD || [[ ${CHOST} == *-darwin* ]] ; then
21 > - find "${S}" -group 'portage' -exec chgrp wheel '{}' \; || die "chgrp failed"
22 > - else
23 > - find "${S}" -group 'portage' -exec chgrp root '{}' \; || die "chgrp failed"
24 > - fi
25 > - eend $?
26 > - fi
27 > -
28 > # When globbing, if nothing exists, the shell literally returns the glob
29 > # pattern. So turn on nullglob and extglob options to avoid this.
30 > eshopts_push -s extglob
31 > @@ -86,7 +73,7 @@ vim-plugin_src_install() {
32 > "couldn't move ${S} to ${ED}/usr/share/vim/vimfiles"
33
34 > # Fix remaining bad permissions
35 > - chmod -R -x+X "${ED}"/usr/share/vim/vimfiles/ || die "chmod failed"
36 > + fperms -R a+rX /usr/share/vim/vimfiles
37 > }
38
39 LGTM (assuming that a+rX are the intended permissions).
40
41 Ulrich