pkg・ports アップデート関連 - その他一般 - vim 8.2.3273_1 → 8.2.3394

クラウディア 
1. 概要
2. 対策
3. 一時しのぎ
4. 解決編

1. 概要

 発生は、2021年9月3日。

$ pkg version -vl "<"
vim-8.2.3273_1                     <   needs updating (index has 8.2.3394)
 てなことになっておるのでアップグレードしようとしましたら。

$ portupgrade -Rr vim
[Reading data from pkg(8) ... - 386 packages found - done]
[Gathering depends for editors/vim ............................................................................... done]
[Exclude up-to-date packages ........................... done]
--->  Upgrading 'vim-8.2.3273_1' to 'vim-8.2.3394' (editors/vim)

・・・	略	・・・

/bin/mkdir -p /usr/ports/editors/vim/work-console/stage/usr/local/etc/vim
install  -m 0644 /usr/ports/editors/vim/files/vimrc /usr/ports/editors/vim/work-console/stage/usr/local/etc/vim/vimrc.sample
====> Compressing man pages (compress-man)
--->  Backing up the old version
pkg: unknown format pkg, using the default
--->  Uninstalling the old version
[Reading data from pkg(8) ... - 386 packages found - done]
--->  Deinstalling 'vim-8.2.3273_1'
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        vim: 8.2.3273_1

Number of packages to be removed: 1

The operation will free 34 MiB.
[1/1] Deinstalling vim-8.2.3273_1...
[1/1] Deleting files for vim-8.2.3273_1: 100%
You may need to manually remove /usr/local/etc/vim/vimrc if it is no longer needed.
[Reading data from pkg(8) ... - 385 packages found - done]
--->  Installing the new version via the port
===>  Deinstalling for vim
===>   vim not installed, skipping
===>  Installing for vim-8.2.3394
===>  Checking if vim is already installed
===>   Registering installation for vim-8.2.3394
pkg-static: Unable to access file /usr/ports/editors/vim/work-console/stage/usr/local/%%GUI%%bin/eview:No such file or directory

・・・	略	・・・

pkg-static: Unable to access file /usr/ports/editors/vim/work-console/stage/usr/local/%%DESKTOP%%share/icons/locolor/32x32/apps/gvim.png:No such file or directory
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/editors/vim
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/editors/vim
*** Error code 1

Stop.
make: stopped in /usr/ports/editors/vim
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20210903-73382-1ldnnw7 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=vim-8.2.3273_1 UPGRADE_PORT_VER=8.2.3273_1 make reinstall
--->  Restoring the old version
Installing vim-8.2.3273_1...
Extracting vim-8.2.3273_1: 100%
** Fix the installation problem and try again.

2. 対策

 仕方ないので

cd /usr/ports/editors/vim
make deinstall clean
make
make install
 しますが。  最後の「make install」で必ず、失敗します。  どうも

/usr/ports/editors/vim/work-console/stage/usr/local/%%GUI%%bin/*
/usr/ports/editors/vim/work-console/stage/usr/local/%%DESKTOP%%share/icons/locolor/32x32/apps/*
 の類がないんですな。  どうも「GUI」とか「DESKTOP」的な環境変数か何かが必要らしいのですが、これ、発生しているマシンは、サーバ専用でありまして、あえて、グラフィカルな環境は設定していません。  オプションをさわってなんとかならんかとも思いましたが、オプションも変わっているようで、どうにもならない。

3. 一時しのぎ

 こうなれば、一時しのぎです。  どうも、上記のものは、「gvim」やらグラフィカルな「vim」までインストールしようとしているらしい。  欲しいのは、コンソール版だけです。

$ pkg install vim-console
Updating FreeBSD repository catalogue...
pkg: http://pkgmir.geo.freebsd.org/FreeBSD:12:amd64/quarterly/packagesite.pkg: Not Found
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        vim-console: 8.2.3081

Number of packages to be installed: 1

The process will require 27 MiB more space.
6 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching vim-console-8.2.3081.txz: 100%    6 MiB   6.4MB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Installing vim-console-8.2.3081...
[1/1] Extracting vim-console-8.2.3081: 100%
 「pkg」コマンドでインストールすると、依存するものまで変更しようとして、「ports」に追い付いていないものがあれば、ダウングレードするのが怖いのですが。  「vim-console」をインストールすることで、依存なしで単独でインストールすることができました。

4. 解決編

 前項の手段は、あくまでも一時しのぎに過ぎません。  他のマシンで、うまくインストールできているものがあったので、違いがないか見比べて、発見。

cd /usr/ports/editors/vim
make config
「/usr/ports/editors/vim」-「make config」

 上記が、「make install」まで成功しているものです。
 失敗しているものと見比べると、「CTAGS」が失敗している方は、「CTAGS_BASE」になっている。
 こんなものが影響しているのかしらと思いつつ・・・。
 失敗している方のコンパイルオプションを変更して


cd /usr/ports/editors/vim
make deinstall clean
make
make install
 すんなり、通っちゃいました。
ハイスピードプラン