Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 384861 - app-editors/vile unconditionally sets /usr/bin/vi symlink (needs --if-unset in eselect call)
Summary: app-editors/vile unconditionally sets /usr/bin/vi symlink (needs --if-unset i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 00:10 UTC by Roger
Modified: 2011-10-18 02:53 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roger 2011-09-29 00:10:22 UTC
As a happy VI/VIM'er here for the past 10+ years, I use 'vi' as a shortcut to starting most editing sessions.

During reading the O'Reilly VIM book, noticed something called Vile (Emacs with VI key mapping) and installed it.  I just noticed some oddities today when trying to use the usual vi and found vile forces itself on the user by using 'eselect vi set vile' after installing!

Technically, it probably should not do this unless a user specifically requests it done because when most issue 'vi', they expect VI (or VIM).

A more proper solution would be to merrily recommend a user that they can link vile to vi by using eselect.

Reproducible: Always




On further research, this behavior started during and after vile-9.5-r1 and was instituted by Mike Kelly.

>9.5 versions are not marked as stable, so VI/VIM users probably won't complain until they do go stable, but when they do, expect a lot of complaining if not fixed? ;-)

/usr/portage/app-editors/vile/vile-9.8e.ebuild
  pkg_postrm() {
--    einfo "Updating /usr/bin/vi symlink"
--    eselect vi update
++    einfo "If you want vile for the /usr/bin/vi symlink:"
++    einfo "eselect vi set vim"
  }
Comment 1 Ulrich Müller gentoo-dev 2011-09-29 11:06:11 UTC
See bug 187449. The ebuild should call "eselect vi update --if-unset" both in pkg_postinst() and pkg_postrm().
Comment 2 Roger 2011-09-29 12:32:24 UTC
Using the latest nvi ebuild as a template...

/usr/portage/app-editors/vile/vile-9.8e.ebuild

pkg_postinst() {
--    einfo "Setting /usr/bin/vi symlink"
--    eselect vi set "${PN}"
++    einfo "If unset, setting /usr/bin/vi symlink"
++    eselect vi update --if-unset

++    einfo "You can manage the vi symlink using:"
++    einfo "eselect vi [gvim, vile, vim, ...]"
}

pkg_postrm() {
      einfo "Updating /usr/bin/vi symlink"
--    eselect vi update
++    eselect vi update --if-unset
}


I think the nvi (& vim ebuilds) could also use the additional "You can manage the vi symlink using: eselect vi" einfo notice too.

(FYI: vim & gvim ebuilds is absent of the above pkg_postinst() & pkg_postrm() functions.)
Comment 3 Roger 2011-09-30 19:17:32 UTC
Let me know if this is a viable solution and I'll submit a formal patch.

(Ping the gvim/vim & nvi maintainers with this suggestion too so that we can get some feedback?  It's likely possible they'll get their own ideas, too.)
Comment 4 Roger 2011-10-17 00:46:32 UTC
Ran into this problem again.

Think I'll just uninstall the VIM alternatives to prevent this nasty bug from biting me in the tushy again.

Second time I ran into it, and couldn't figure out why filetype and keys were acting funky!   Wish I had write access, as even I would have fixed this dumb bug by now.
Comment 5 Ulrich Müller gentoo-dev 2011-10-17 07:04:14 UTC
@VIM herd: If you don't have objections, I can commit the fix for you.
Comment 6 Tim Harder gentoo-dev 2011-10-17 07:24:44 UTC
Fixed in CVS.

As for the extra info, I'd rather only add that to eselect-vi rather than adding it to every single vi compatible editor.
Comment 7 Roger 2011-10-18 02:53:19 UTC
Thanks.

(Thought I'd see more feedback, since VIM is so popular.)