Sunday 05 Nov 2017 00:26:33, Michał Górny wrote :
> W dniu sob, 04.11.2017 o godzinie 22∶48 +0100, użytkownik Patrice
> Clement napisał:
> > Closes: https://bugs.gentoo.org/469400
> > ---
> >  eclass/vim-plugin.eclass | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
> > index a05cdb4520b..3c809768cf8 100644
> > --- a/eclass/vim-plugin.eclass
> > +++ b/eclass/vim-plugin.eclass
> > @@ -39,11 +39,11 @@ vim-plugin_src_install() {
> >             ebegin "Fixing file permissions"
> >             # Make sure perms are good
> >             chmod -R a+rX "${S}" || die "chmod failed"
> > -           find "${S}" -user  'portage' -exec chown root '{}' \; || die 
> > "chown failed"
> > +           find "${S}" -user "${PORTAGE_USERNAME}" -exec chown root '{}' 
> > \; || die "chown failed"
> >             if use userland_BSD || [[ ${CHOST} == *-darwin* ]] ; then
> > -                   find "${S}" -group 'portage' -exec chgrp wheel '{}' \; 
> > || die "chgrp failed"
> > +                   find "${S}" -group "${PORTAGE_GRPNAME}" -exec chgrp 
> > wheel '{}' \; || die "chgrp failed"
> >             else
> > -                   find "${S}" -group 'portage' -exec chgrp root '{}' \; 
> > || die "chgrp failed"
> > +                   find "${S}" -group "${PORTAGE_GRPNAME}" -exec chgrp 
> > root '{}' \; || die "chgrp failed"
> >             fi
> >             eend $?
> >     fi
> 
> This is going to die on every non-Portage package manager.
> 
> -- 
> Best regards,
> Michał Górny
> 
> 

Michal, Ulrich,

ACK. This code has been there for ages and I also don't think it makes sense to
keep it as it seems these operations are handled by Portage already. Mike
(floppym) suggested to remove the whole if clause and call fperms instead:

diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index abe9c7b3661..46908bb73e6 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -35,19 +35,6 @@ vim-plugin_src_install() {
        has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
        local f

-       if use !prefix && [[ ${EUID} -eq 0 ]] ; then
-               ebegin "Fixing file permissions"
-               # Make sure perms are good
-               chmod -R a+rX "${S}" || die "chmod failed"
-               find "${S}" -user  'portage' -exec chown root '{}' \; || die 
"chown failed"
-               if use userland_BSD || [[ ${CHOST} == *-darwin* ]] ; then
-                       find "${S}" -group 'portage' -exec chgrp wheel '{}' \; 
|| die "chgrp failed"
-               else
-                       find "${S}" -group 'portage' -exec chgrp root '{}' \; 
|| die "chgrp failed"
-               fi
-               eend $?
-       fi
-
        # When globbing, if nothing exists, the shell literally returns the glob
        # pattern. So turn on nullglob and extglob options to avoid this.
        eshopts_push -s extglob
@@ -86,7 +73,7 @@ vim-plugin_src_install() {
                "couldn't move ${S} to ${ED}/usr/share/vim/vimfiles"

        # Fix remaining bad permissions
-       chmod -R -x+X "${ED}"/usr/share/vim/vimfiles/ || die "chmod failed"
+       fperms -R a+rX /usr/share/vim/vimfiles
 }

Please let me know what you guys think.

-- 
Patrice Clement
Gentoo Linux developer
http://www.gentoo.org


Reply via email to