Skip to content

Commit

Permalink
app-editors/vim: do away with symlinks and just call eselect vi update.
Browse files Browse the repository at this point in the history
This commit also updates the 9999 ebuild.

Closes: https://bugs.gentoo.org/635482
Package-Manager: Portage-2.3.8, Repoman-2.3.3
  • Loading branch information
monsieurp committed Oct 26, 2017
1 parent 50686d6 commit 0f8fefc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 70 deletions.
43 changes: 8 additions & 35 deletions app-editors/vim/vim-8.0.1188.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -261,39 +261,12 @@ src_test() {
emake -j1 -C src/testdir nongui
}

# Make convenience symlinks, hopefully without stepping on toes. Some
# of these links are "owned" by the vim ebuild when it is installed,
# but they might be good for gvim as well (see bug 45828)
update_vim_symlinks() {
local f syms
syms="vimdiff rvim rview"
# Call eselect vi update with --if-unset
# to respect user's choice (bug 187449)
eselect_vi_update() {
einfo "Calling eselect vi update..."
# Call this with --if-unset to respect user's choice (bug 187449)
eselect vi update --if-unset

# Make or remove convenience symlink, vim -> gvim
if [[ -f "${EROOT}"/usr/bin/gvim ]]; then
ln -s gvim "${EROOT}"/usr/bin/vim 2>/dev/null || die "ln failed"
elif [[ -L "${EROOT}"/usr/bin/vim && ! -f "${EROOT}"/usr/bin/vim ]]; then
rm "${EROOT}"/usr/bin/vim || die "rm vim failed"
fi

# Make or remove convenience symlinks to vim
if [[ -f "${EROOT}"/usr/bin/vim ]]; then
for f in ${syms}; do
ln -s vim "${EROOT}"/usr/bin/${f} 2>/dev/null || die
done
else
for f in ${syms}; do
if [[ -L "${EROOT}"/usr/bin/${f} && ! -f "${EROOT}"/usr/bin/${f} ]]; then
rm "${EROOT}"/usr/bin/${f} || die
fi
done
fi

# This will still break if you merge then remove the vi package,
# but there's only so much you can do, eh? Unfortunately we don't
# have triggers like are done in rpm-land.
eend $?
}

src_install() {
Expand Down Expand Up @@ -323,14 +296,14 @@ pkg_postinst() {
# Update documentation tags (from vim-doc.eclass)
update_vim_helptags

# Make convenience symlinks
update_vim_symlinks
# Call eselect vi update
eselect_vi_update
}

pkg_postrm() {
# Update documentation tags (from vim-doc.eclass)
update_vim_helptags

# Make convenience symlinks
update_vim_symlinks
# Call eselect vi update
eselect_vi_update
}
43 changes: 8 additions & 35 deletions app-editors/vim/vim-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -261,39 +261,12 @@ src_test() {
emake -j1 -C src/testdir nongui
}

# Make convenience symlinks, hopefully without stepping on toes. Some
# of these links are "owned" by the vim ebuild when it is installed,
# but they might be good for gvim as well (see bug 45828)
update_vim_symlinks() {
local f syms
syms="vimdiff rvim rview"
# Call eselect vi update with --if-unset
# to respect user's choice (bug 187449)
eselect_vi_update() {
einfo "Calling eselect vi update..."
# Call this with --if-unset to respect user's choice (bug 187449)
eselect vi update --if-unset

# Make or remove convenience symlink, vim -> gvim
if [[ -f "${EROOT}"/usr/bin/gvim ]]; then
ln -s gvim "${EROOT}"/usr/bin/vim 2>/dev/null || die "ln failed"
elif [[ -L "${EROOT}"/usr/bin/vim && ! -f "${EROOT}"/usr/bin/vim ]]; then
rm "${EROOT}"/usr/bin/vim || die "rm vim failed"
fi

# Make or remove convenience symlinks to vim
if [[ -f "${EROOT}"/usr/bin/vim ]]; then
for f in ${syms}; do
ln -s vim "${EROOT}"/usr/bin/${f} 2>/dev/null || die
done
else
for f in ${syms}; do
if [[ -L "${EROOT}"/usr/bin/${f} && ! -f "${EROOT}"/usr/bin/${f} ]]; then
rm "${EROOT}"/usr/bin/${f} || die
fi
done
fi

# This will still break if you merge then remove the vi package,
# but there's only so much you can do, eh? Unfortunately we don't
# have triggers like are done in rpm-land.
eend $?
}

src_install() {
Expand Down Expand Up @@ -323,14 +296,14 @@ pkg_postinst() {
# Update documentation tags (from vim-doc.eclass)
update_vim_helptags

# Make convenience symlinks
update_vim_symlinks
# Call eselect vi update
eselect_vi_update
}

pkg_postrm() {
# Update documentation tags (from vim-doc.eclass)
update_vim_helptags

# Make convenience symlinks
update_vim_symlinks
# Call eselect vi update
eselect_vi_update
}

0 comments on commit 0f8fefc

Please sign in to comment.