1 |
commit: c93bef065a6f21f9833bfcd249e53481684574ef |
2 |
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 22 15:55:50 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 23 08:13:56 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c93bef06 |
7 |
|
8 |
vim-plugin.eclass: add missing dies. |
9 |
|
10 |
eclass/vim-plugin.eclass | 28 ++++++++++++++++------------ |
11 |
1 file changed, 16 insertions(+), 12 deletions(-) |
12 |
|
13 |
diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass |
14 |
index cbf71e2917a..1bfcde9d580 100644 |
15 |
--- a/eclass/vim-plugin.eclass |
16 |
+++ b/eclass/vim-plugin.eclass |
17 |
@@ -49,10 +49,13 @@ vim-plugin_src_install() { |
18 |
fi |
19 |
|
20 |
# Remove unwanted files that may exist |
21 |
- rm -rf .[^.] .??* Makefile* |
22 |
+ ebegin "Clean up unwanted files" |
23 |
+ rm -f .[^.] .??* Makefile* || die "unwanted files cleanup failed" |
24 |
+ eend $? |
25 |
|
26 |
# Install non-vim-help-docs |
27 |
- cd "${S}" |
28 |
+ cd "${S}" || die "couldn't cd in ${S}" |
29 |
+ local f |
30 |
for f in *; do |
31 |
[[ -f "${f}" ]] || continue |
32 |
if [[ "${f}" = *.html ]]; then |
33 |
@@ -60,13 +63,14 @@ vim-plugin_src_install() { |
34 |
else |
35 |
dodoc "${f}" |
36 |
fi |
37 |
- rm -f "${f}" |
38 |
+ rm "${f}" || die |
39 |
done |
40 |
|
41 |
# Install remainder of plugin |
42 |
- cd "${WORKDIR}" |
43 |
+ cd "${WORKDIR}" || die "couldn't cd in ${WORKDIR}" |
44 |
dodir /usr/share/vim |
45 |
- mv "${S}" "${ED}"/usr/share/vim/vimfiles |
46 |
+ mv "${S}" "${ED}"/usr/share/vim/vimfiles || die \ |
47 |
+ "couldn't move ${S} to ${ED}/usr/share/vim/vimfiles" |
48 |
|
49 |
# Fix remaining bad permissions |
50 |
chmod -R -x+X "${ED}"/usr/share/vim/vimfiles/ || die "chmod failed" |
51 |
@@ -97,7 +101,8 @@ vim-plugin_pkg_postrm() { |
52 |
|
53 |
# Remove empty dirs; this allows |
54 |
# /usr/share/vim to be removed if vim-core is unmerged |
55 |
- find "${EPREFIX}/usr/share/vim/vimfiles" -depth -type d -exec rmdir {} \; 2>/dev/null |
56 |
+ find "${EPREFIX}/usr/share/vim/vimfiles" -depth -type d -exec rmdir {} \; 2>/dev/null || \ |
57 |
+ die "rmdir failed" |
58 |
} |
59 |
|
60 |
# @FUNCTION: update_vim_afterscripts |
61 |
@@ -113,11 +118,10 @@ update_vim_afterscripts() { |
62 |
[ -d "${afterdir}" ] || return 0 |
63 |
|
64 |
einfo "Updating scripts in ${EPREFIX}/usr/share/vim/vimfiles/after" |
65 |
- find "${afterdir}" -type d -name \*.vim.d | \ |
66 |
- while read d; do |
67 |
- echo '" Generated by update_vim_afterscripts' > "${d%.d}" |
68 |
- find "${d}" -name \*.vim -type f -maxdepth 1 -print0 | \ |
69 |
- sort -z | xargs -0 cat >> "${d%.d}" |
70 |
+ find "${afterdir}" -type d -name \*.vim.d | while read d; do |
71 |
+ echo '" Generated by update_vim_afterscripts' > "${d%.d}" || die |
72 |
+ find "${d}" -name \*.vim -type f -maxdepth 1 -print0 | sort -z | \ |
73 |
+ xargs -0 cat >> "${d%.d}" || die "update_vim_afterscripts failed" |
74 |
done |
75 |
|
76 |
einfo "Removing dead scripts in ${EPREFIX}/usr/share/vim/vimfiles/after" |
77 |
@@ -129,7 +133,7 @@ update_vim_afterscripts() { |
78 |
# if there's no corresponding .d directory, or if the |
79 |
# file's effectively empty |
80 |
if [[ ! -d "${f}.d" || -z "$(grep -v '^"' "${f}")" ]]; then |
81 |
- rm -f "${f}" |
82 |
+ rm "${f}" || die |
83 |
fi |
84 |
done |
85 |
} |