mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-25 11:57:36 -08:00
vim-plugin.eclass: add missing dies.
This commit is contained in:
+16
-12
@@ -49,10 +49,13 @@ vim-plugin_src_install() {
|
||||
fi
|
||||
|
||||
# Remove unwanted files that may exist
|
||||
rm -rf .[^.] .??* Makefile*
|
||||
ebegin "Clean up unwanted files"
|
||||
rm -f .[^.] .??* Makefile* || die "unwanted files cleanup failed"
|
||||
eend $?
|
||||
|
||||
# Install non-vim-help-docs
|
||||
cd "${S}"
|
||||
cd "${S}" || die "couldn't cd in ${S}"
|
||||
local f
|
||||
for f in *; do
|
||||
[[ -f "${f}" ]] || continue
|
||||
if [[ "${f}" = *.html ]]; then
|
||||
@@ -60,13 +63,14 @@ vim-plugin_src_install() {
|
||||
else
|
||||
dodoc "${f}"
|
||||
fi
|
||||
rm -f "${f}"
|
||||
rm "${f}" || die
|
||||
done
|
||||
|
||||
# Install remainder of plugin
|
||||
cd "${WORKDIR}"
|
||||
cd "${WORKDIR}" || die "couldn't cd in ${WORKDIR}"
|
||||
dodir /usr/share/vim
|
||||
mv "${S}" "${ED}"/usr/share/vim/vimfiles
|
||||
mv "${S}" "${ED}"/usr/share/vim/vimfiles || die \
|
||||
"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"
|
||||
@@ -97,7 +101,8 @@ vim-plugin_pkg_postrm() {
|
||||
|
||||
# Remove empty dirs; this allows
|
||||
# /usr/share/vim to be removed if vim-core is unmerged
|
||||
find "${EPREFIX}/usr/share/vim/vimfiles" -depth -type d -exec rmdir {} \; 2>/dev/null
|
||||
find "${EPREFIX}/usr/share/vim/vimfiles" -depth -type d -exec rmdir {} \; 2>/dev/null || \
|
||||
die "rmdir failed"
|
||||
}
|
||||
|
||||
# @FUNCTION: update_vim_afterscripts
|
||||
@@ -113,11 +118,10 @@ update_vim_afterscripts() {
|
||||
[ -d "${afterdir}" ] || return 0
|
||||
|
||||
einfo "Updating scripts in ${EPREFIX}/usr/share/vim/vimfiles/after"
|
||||
find "${afterdir}" -type d -name \*.vim.d | \
|
||||
while read d; do
|
||||
echo '" Generated by update_vim_afterscripts' > "${d%.d}"
|
||||
find "${d}" -name \*.vim -type f -maxdepth 1 -print0 | \
|
||||
sort -z | xargs -0 cat >> "${d%.d}"
|
||||
find "${afterdir}" -type d -name \*.vim.d | while read d; do
|
||||
echo '" Generated by update_vim_afterscripts' > "${d%.d}" || die
|
||||
find "${d}" -name \*.vim -type f -maxdepth 1 -print0 | sort -z | \
|
||||
xargs -0 cat >> "${d%.d}" || die "update_vim_afterscripts failed"
|
||||
done
|
||||
|
||||
einfo "Removing dead scripts in ${EPREFIX}/usr/share/vim/vimfiles/after"
|
||||
@@ -129,7 +133,7 @@ update_vim_afterscripts() {
|
||||
# if there's no corresponding .d directory, or if the
|
||||
# file's effectively empty
|
||||
if [[ ! -d "${f}.d" || -z "$(grep -v '^"' "${f}")" ]]; then
|
||||
rm -f "${f}"
|
||||
rm "${f}" || die
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user