Bug 1192655 - view,ex,rvim,etc broken by libalternatives update to the vim package
Summary: view,ex,rvim,etc broken by libalternatives update to the vim package
Status: RESOLVED DUPLICATE of bug 1192631
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-13 00:18 UTC by Clark Boylan
Modified: 2021-11-13 10:45 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clark Boylan 2021-11-13 00:18:38 UTC
https://build.opensuse.org/request/show/929735 updated the vim package to use libalternatives:

$ ls -l /usr/bin/vim
lrwxrwxrwx 1 root root 4 Nov  9 15:39 /usr/bin/vim -> alts
$ alts -l

snip

---
Binary: vi
Alternatives: 1
  Priority: 20*  Target: /usr/bin/vim-nox11
                 Group: vi, vim
---
Binary: vim
Alternatives: 1
  Priority: 20*  Target: /usr/bin/vim-nox11
                 Group: vi, vim

view is a symlink to /usr/bin/vim:
$ ls -l /usr/bin/view
lrwxrwxrwx 1 root root 3 Nov  9 15:39 /usr/bin/view -> vim

Running `view` against a file exits 255:
$ ls foobar
foobar
$ cat foobar
viewing view
$ view foobar
$ echo $?
255

I suspect that the lack of an alts entry is causing this and these other vim executables are also affected:
$ ls -l /usr/bin | grep -- '-> vim'
lrwxrwxrwx 1 root root           3 Nov  9 15:39 edit -> vim
lrwxrwxrwx 1 root root           3 Nov  9 15:39 ex -> vim
lrwxrwxrwx 1 root root           3 Nov  9 15:39 rview -> vim
lrwxrwxrwx 1 root root           3 Nov  9 15:39 rvim -> vim
lrwxrwxrwx 1 root root           3 Nov  9 15:39 view -> vim
lrwxrwxrwx 1 root root           3 Nov  9 15:39 vimdiff -> vim

As a side note `man alts` does not really provide sufficient info on how to use this system. I would attempt to set up a user config to confirm this is the issue, but the manpage doesn't say what config files are used or how to map one name to another program using `alt -u`.
Comment 1 Clark Boylan 2021-11-13 00:41:23 UTC
I managed to find the libalternatives configs via the spec diff in the previously mentioned package update. Mimicking those updates locally:

$ ls -l /usr/share/libalternatives/view
total 4
-rw-r--r-- 1 root root 58 Nov 12 16:38 20.conf
$ cat /usr/share/libalternatives/view/20.conf
binary=/usr/bin/vim-nox11
group=vim, vi
options=KeepArgv0

I can now run `view foobar` and get the file to open. This seems to confirm the issue is a lack of appropriate libalternatives configuration.
Comment 2 Ondřej Súkup 2021-11-13 10:45:19 UTC
duplicate

*** This bug has been marked as a duplicate of bug 1192631 ***