summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorPatrice Clement <monsieurp@gentoo.org>2017-10-28 23:54:25 +0200
committerPatrice Clement <monsieurp@gentoo.org>2017-10-29 00:42:54 +0200
commit445304115b838f90801f106420b2f71f8bff33ef (patch)
tree5ddabbe569aaa42403b979e376dea78dc07184cd /eclass
parentnet-vpn/tor: stable 0.3.1.7 for ppc, bug #631642 (diff)
downloadgentoo-445304115b838f90801f106420b2f71f8bff33ef.tar.gz
gentoo-445304115b838f90801f106420b2f71f8bff33ef.tar.bz2
gentoo-445304115b838f90801f106420b2f71f8bff33ef.zip
vim-plugin.eclass: rework unwanted files and directories cleanup logic.
Courtesy of Arfrever. Closes: https://bugs.gentoo.org/635420
Diffstat (limited to 'eclass')
-rw-r--r--eclass/vim-plugin.eclass23
1 files changed, 18 insertions, 5 deletions
diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index e6aaae482837..abe9c7b3661b 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: vim-plugin.eclass
@@ -11,7 +11,7 @@
# which is read automatically by vim. The only exception is
# documentation, for which we make a special case via vim-doc.eclass.
-inherit vim-doc
+inherit estack vim-doc
EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
VIM_PLUGIN_VIM_VERSION="${VIM_PLUGIN_VIM_VERSION:-7.3}"
@@ -48,11 +48,24 @@ vim-plugin_src_install() {
eend $?
fi
- # Remove unwanted files that may exist
- ebegin "Clean up unwanted files"
- rm -f .[^.] .??* Makefile* || die "unwanted files cleanup failed"
+ # 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
+ eshopts_push -s nullglob
+
+ ebegin "Cleaning up unwanted files and directories"
+ # We're looking for dotfiles, dotdirectories and Makefiles here.
+ local obj
+ eval "local matches=(@(.[^.]|.??*|Makefile*))"
+ for obj in "${matches[@]}"; do
+ rm -rv "${obj}" || die "cannot remove ${obj}"
+ done
eend $?
+ # Turn those options back off.
+ eshopts_pop
+ eshopts_pop
+
# Install non-vim-help-docs
cd "${S}" || die "couldn't cd in ${S}"
local f