commit:     5e9a3926fd3e0e573f529fd6aefebba53e082f4a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 27 21:48:31 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 27 21:57:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e9a3926

app-editors/vim-core: fix incorrect conditional use of extglob

bash-5.2 is stricter with this and upstream say this was never
supposed to work (and indeed may have done odd things at runtime
anyway).

We're going to have to avoid any conditional use of extglob
like this as the parser has no idea if we've enabled extglob
or not at the point it runs.

Fixes a sourcing error:
```
vim-core-9999.ebuild: line 195: syntax error near unexpected token `('
vim-core-9999.ebuild: line 195: `               ignore=$(rm -fr 
"${ED}${vimfiles}"/colors/!(${keep_colors}).vim )'
```

Thanks-to: tirnanog (mangled his suggestion in this commit)
Thanks-to: Ionen Wolkens <ionen <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-editors/vim-core/vim-core-8.2.4586.ebuild    | 34 +++++++++++------------
 app-editors/vim-core/vim-core-8.2.5066-r2.ebuild | 35 +++++++++++-------------
 app-editors/vim-core/vim-core-9.0.0049-r1.ebuild | 35 +++++++++++-------------
 app-editors/vim-core/vim-core-9999.ebuild        | 35 +++++++++++-------------
 4 files changed, 65 insertions(+), 74 deletions(-)

diff --git a/app-editors/vim-core/vim-core-8.2.4586.ebuild 
b/app-editors/vim-core/vim-core-8.2.4586.ebuild
index 0d7a502efa63..ab6f035d555a 100644
--- a/app-editors/vim-core/vim-core-8.2.4586.ebuild
+++ b/app-editors/vim-core/vim-core-8.2.4586.ebuild
@@ -6,7 +6,7 @@ EAPI=7
 # Please bump with app-editors/vim and app-editors/gvim
 
 VIM_VERSION="8.2"
-inherit estack vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
+inherit vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
 
 if [[ ${PV} == 9999* ]] ; then
        inherit git-r3
@@ -188,24 +188,24 @@ src_install() {
        if use minimal; then
                # To save space, install only a subset of the files.
                # Helps minimalize the livecd, bug 65144.
-               eshopts_push -s extglob
-
-               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die 
"rm failed"
-               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die "rm 
failed"
-               rm -v "${ED}"/usr/bin/vimtutor || die "rm failed"
-
-               local keep_colors="default"
-               ignore=$(rm -fr "${ED}${vimfiles}"/colors/!(${keep_colors}).vim 
)
-
-               local keep_syntax="conf|crontab|fstab|inittab|resolv|sshdconfig"
-               # tinkering with the next line might make bad things happen ...
-               keep_syntax="${keep_syntax}|syntax|nosyntax|synload"
-               ignore=$(rm -fr "${ED}${vimfiles}"/syntax/!(${keep_syntax}).vim 
)
+               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die
+               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die
+               rm -v "${ED}"/usr/bin/vimtutor || die
+
+               for f in "${ED}${vimfiles}"/colors/*.vim; do
+                       if [[ ${f} != */@(default).vim ]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
+
+               for f in "${ED}${vimfiles}"/syntax/*.vim; do
+                       if [[ ${f} != 
*/@(conf|crontab|fstab|inittab|resolv|sshdconfig|syntax|nosyntax|synload).vim 
]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
 
                # Delete skip_defaults_vim config not supported by vim[minimal]
-               sed -i '/skip_defaults_vim/d' "${ED}"/etc/vim/vimrc || die "sed 
failed"
-
-               eshopts_pop
+               sed -i '/skip_defaults_vim/d' "${ED}"/etc/vim/vimrc || die
        fi
 
        newbashcomp "${FILESDIR}"/xxd-completion xxd

diff --git a/app-editors/vim-core/vim-core-8.2.5066-r2.ebuild 
b/app-editors/vim-core/vim-core-8.2.5066-r2.ebuild
index a9c02a3dfc36..c11d467f2a5a 100644
--- a/app-editors/vim-core/vim-core-8.2.5066-r2.ebuild
+++ b/app-editors/vim-core/vim-core-8.2.5066-r2.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 # Please bump with app-editors/vim and app-editors/gvim
 
 VIM_VERSION="8.2"
-inherit estack vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
+inherit vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
 
 if [[ ${PV} == 9999* ]] ; then
        inherit git-r3
@@ -189,24 +189,21 @@ src_install() {
        if use minimal; then
                # To save space, install only a subset of the files.
                # Helps minimalize the livecd, bug 65144.
-               eshopts_push -s extglob
-
-               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die 
"rm failed"
-               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die "rm 
failed"
-               rm -v "${ED}"/usr/bin/vimtutor || die "rm failed"
-
-               local keep_colors="default"
-               ignore=$(rm -fr "${ED}${vimfiles}"/colors/!(${keep_colors}).vim 
)
-
-               local keep_syntax="conf|crontab|fstab|inittab|resolv|sshdconfig"
-               # tinkering with the next line might make bad things happen ...
-               keep_syntax="${keep_syntax}|syntax|nosyntax|synload"
-               ignore=$(rm -fr "${ED}${vimfiles}"/syntax/!(${keep_syntax}).vim 
)
-
-               # Delete skip_defaults_vim config not supported by vim[minimal]
-               sed -i '/skip_defaults_vim/d' "${ED}"/etc/vim/vimrc || die "sed 
failed"
-
-               eshopts_pop
+               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die
+               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die
+               rm -v "${ED}"/usr/bin/vimtutor || die
+
+               for f in "${ED}${vimfiles}"/colors/*.vim; do
+                       if [[ ${f} != */@(default).vim ]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
+
+               for f in "${ED}${vimfiles}"/syntax/*.vim; do
+                       if [[ ${f} != 
*/@(conf|crontab|fstab|inittab|resolv|sshdconfig|syntax|nosyntax|synload).vim 
]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
        fi
 
        newbashcomp "${FILESDIR}"/xxd-completion xxd

diff --git a/app-editors/vim-core/vim-core-9.0.0049-r1.ebuild 
b/app-editors/vim-core/vim-core-9.0.0049-r1.ebuild
index e808fd2a2495..555b9e91b8db 100644
--- a/app-editors/vim-core/vim-core-9.0.0049-r1.ebuild
+++ b/app-editors/vim-core/vim-core-9.0.0049-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 # Please bump with app-editors/vim and app-editors/gvim
 
 VIM_VERSION="9.0"
-inherit estack vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
+inherit vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
 
 if [[ ${PV} == 9999* ]] ; then
        inherit git-r3
@@ -185,24 +185,21 @@ src_install() {
        if use minimal; then
                # To save space, install only a subset of the files.
                # Helps minimalize the livecd, bug 65144.
-               eshopts_push -s extglob
-
-               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die 
"rm failed"
-               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die "rm 
failed"
-               rm -v "${ED}"/usr/bin/vimtutor || die "rm failed"
-
-               local keep_colors="default"
-               ignore=$(rm -fr "${ED}${vimfiles}"/colors/!(${keep_colors}).vim 
)
-
-               local keep_syntax="conf|crontab|fstab|inittab|resolv|sshdconfig"
-               # tinkering with the next line might make bad things happen ...
-               keep_syntax="${keep_syntax}|syntax|nosyntax|synload"
-               ignore=$(rm -fr "${ED}${vimfiles}"/syntax/!(${keep_syntax}).vim 
)
-
-               # Delete skip_defaults_vim config not supported by vim[minimal]
-               sed -i '/skip_defaults_vim/d' "${ED}"/etc/vim/vimrc || die "sed 
failed"
-
-               eshopts_pop
+               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die
+               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die
+               rm -v "${ED}"/usr/bin/vimtutor || die
+
+               for f in "${ED}${vimfiles}"/colors/*.vim; do
+                       if [[ ${f} != */@(default).vim ]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
+
+               for f in "${ED}${vimfiles}"/syntax/*.vim; do
+                       if [[ ${f} != 
*/@(conf|crontab|fstab|inittab|resolv|sshdconfig|syntax|nosyntax|synload).vim 
]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
        fi
 
        newbashcomp "${FILESDIR}"/xxd-completion xxd

diff --git a/app-editors/vim-core/vim-core-9999.ebuild 
b/app-editors/vim-core/vim-core-9999.ebuild
index e808fd2a2495..555b9e91b8db 100644
--- a/app-editors/vim-core/vim-core-9999.ebuild
+++ b/app-editors/vim-core/vim-core-9999.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 # Please bump with app-editors/vim and app-editors/gvim
 
 VIM_VERSION="9.0"
-inherit estack vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
+inherit vim-doc flag-o-matic bash-completion-r1 prefix desktop xdg-utils
 
 if [[ ${PV} == 9999* ]] ; then
        inherit git-r3
@@ -185,24 +185,21 @@ src_install() {
        if use minimal; then
                # To save space, install only a subset of the files.
                # Helps minimalize the livecd, bug 65144.
-               eshopts_push -s extglob
-
-               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die 
"rm failed"
-               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die "rm 
failed"
-               rm -v "${ED}"/usr/bin/vimtutor || die "rm failed"
-
-               local keep_colors="default"
-               ignore=$(rm -fr "${ED}${vimfiles}"/colors/!(${keep_colors}).vim 
)
-
-               local keep_syntax="conf|crontab|fstab|inittab|resolv|sshdconfig"
-               # tinkering with the next line might make bad things happen ...
-               keep_syntax="${keep_syntax}|syntax|nosyntax|synload"
-               ignore=$(rm -fr "${ED}${vimfiles}"/syntax/!(${keep_syntax}).vim 
)
-
-               # Delete skip_defaults_vim config not supported by vim[minimal]
-               sed -i '/skip_defaults_vim/d' "${ED}"/etc/vim/vimrc || die "sed 
failed"
-
-               eshopts_pop
+               rm -rv "${ED}${vimfiles}"/{compiler,doc,ftplugin,indent} || die
+               rm -rv "${ED}${vimfiles}"/{macros,print,tools,tutor} || die
+               rm -v "${ED}"/usr/bin/vimtutor || die
+
+               for f in "${ED}${vimfiles}"/colors/*.vim; do
+                       if [[ ${f} != */@(default).vim ]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
+
+               for f in "${ED}${vimfiles}"/syntax/*.vim; do
+                       if [[ ${f} != 
*/@(conf|crontab|fstab|inittab|resolv|sshdconfig|syntax|nosyntax|synload).vim 
]] ; then
+                               printf '%s\0' "${f}"
+                       fi
+               done | xargs -0 rm -f || die
        fi
 
        newbashcomp "${FILESDIR}"/xxd-completion xxd

Reply via email to