#author("2024-03-07T11:00:17+09:00","default:kuji","kuji")
#author("2024-03-07T11:38:49+09:00","default:kuji","kuji")
CONTENTS
#contents
----
Lastmodified &lastmod;
----
*portversion [#m6dde27d]

Rubyのアップグレードに絡んで、portversionが動かなくなった。

 # portversion -vl'<'
 Traceback (most recent call last):
        8: from /usr/local/sbin/portversion:383:in `<main>'
        7: from /usr/local/sbin/portversion:84:in `main'
        6: from /usr/local/sbin/portversion:84:in `new'
        5: from /usr/local/lib/ruby/2.5/optparse.rb:1062:in `initialize'
        4: from /usr/local/sbin/portversion:191:in `block in main'
        3: from /usr/local/lib/ruby/site_ruby/2.5/pkgtools/pkgtools.rb:242:in `init_pkgtools_global'
        2: from /usr/local/lib/ruby/site_ruby/2.5/pkgtools/portsdb.rb:168:in `setup'
        1: from /usr/local/lib/ruby/site_ruby/2.5/pkgtools/pkgdbtools.rb:63:in `db_driver='
 /usr/local/lib/ruby/site_ruby/2.5/pkgtools/pkgdbtools.rb:104:in `rescue in db_driver=':
 uninitialized constant PkgDBTools::DBError (NameError)

だそうだ。

Ruby関連pkg は

 ruby-2.6.6,1                   Object-oriented interpreted scripting language
 ruby25-2.5.8,1                 Object-oriented interpreted scripting language
 ruby26-bdb-0.6.6_8             Ruby interface to Oracle Berkeley DB revision 2 or later
 ruby26-gems-3.0.6              Package management framework for the Ruby language
 rubygem-rdoc-6.1.2_1        

と、なっている。?? 
なので25を消すと

 # pkg info -r ruby25
 ruby25-2.5.8,1:
 # pkg delete ruby25-2.5.8,1
 Updating database digests format: 100%
 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:
        ruby25: 2.5.8,1
 
 Number of packages to be removed: 1
 
 The operation will free 35 MiB.
 
 Proceed with deinstalling packages? [y/N]: y
 [1/1] Deinstalling ruby25-2.5.8,1...
 [1/1] Deleting files for ruby25-2.5.8,1: 100%
  
 portversion -vl'<'
 portversion: Command not found.

なので、portinstall portupgrade したら、portinstallも無いと・・・

 cd /usr/ports/ports-mgmt/portupgrade
 make install
したら、すでにはいっちょる。と、

 make deinstall
 make install clean

すると、こんどは、

 3 # portversion -vl'<'
 [Reading data from pkg(8) ... - 472 packages found - done]
 [Updating the portsdb <format:bdb_btree> in /usr/ports ... - 32908 port entries found .........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000.........15000.........16000.........17000.........18000.........19000.........20000.........21000.........22000.........23000.........24000.........25000.........26000.........27000.........28000.........29000.........30000.........31000.........32000......... ..... done]

と動作しはじめた。OK?


pkg set -o lang/ruby25:lang/ruby26


** portupgrade と ruby31-gems-3.4.20 [#dc6870de]
に、バージョンアップがあるとのことで、portupgrade するも、旧バージョンがConfrict するエラー。

 ====> Compressing man pages (compress-man)
 ===>  Installing for ruby-3.2.3,1
 ===>  Checking if ruby is already installed
 ===>   An older version of ruby is already installed (ruby-3.1.4_1,1)
       You may wish to ``make deinstall'' and install this port again
       by ``make reinstall'' to upgrade it properly.
       If you really wish to overwrite the old port of ruby
       without deleting it first, set the variable "FORCE_PKG_REGISTER"
       in your environment or the "make install" command line.
 *** Error code 1
 
 Stop.
 make[1]: stopped in /usr/ports/lang/ruby32
 *** Error code 1
 
 Stop.
 make: stopped in /usr/ports/ports-mgmt/portupgrade
 egrep: empty (sub)expression
 ** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20240306-21133-l7t9ir env UPGRADE_TOOL=portupgrade UPGRADE_PORT=portupgrade-2.4.16_1,2 UPGRADE_PORT_VER=2.4.16_1,2 make BATCH=yes
 ** Fix the problem and try again.
 --->  Upgrading 'Imath-3.1.10' to 'Imath-3.1.11' (math/Imath)
 --->  Building '/usr/ports/math/Imath'
 ===>  Cleaning for Imath-3.1.11
 ===>  License BSD3CLAUSE accepted by the user
 ===>   Imath-3.1.11 depends on file: /usr/local/sbin/pkg - found
 => AcademySoftwareFoundation-Imath-v3.1.11_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
 => Attempting to fetch https://codeload.github.com/AcademySoft
 

あれこれやって、結局以下で解決

   738  10:52   cd /usr/ports/lang/ruby32
   739  10:52   make reinstall
   740  10:52   /root/bin/check.sh
   741  10:53   portversion -vl'<'
   742  10:53   locate portupgrade
   743  10:53   cd /usr/ports/ports-mgmt/portupgrade
   744  10:54   make reinstall
   745  10:59   portversion -vl'<'
   746  11:02   history


  1116  16:10   cd /usr/ports/devel/ruby-gems
  1117  16:10   make reinstall  ==> error
  1118  16:11   make deinstall  ==> error
  1119  16:11   make install clean  ==> error
  1120  16:11   pkg delete ruby31-gems-3.4.20
  1121  16:12   make deinstall  ==> error
  1122  16:13   pkg delete ruby31-gems
  1123  16:13   make install clean
  1124  16:14   portversion -vl'<'  ==> OK
  1125  16:14   cd /usr/ports/ports-mgmt/portupgrade
  1126  16:14   make install clean  ==> error
  1127  16:17   make reinstall  ==> OK
  1128  16:17   portversion -vl'<'  ==> OK

portupgrade のmake 中に、ruby32-bdb でエラーが出る場合は、/usr/ports/databases/ruby-bdb のmake configで

&ref(ruby32-bdb.PNG);

DOCSのチェックを外すと、 /usr/ports/databases/ruby-bdb のmake が通ります。
DOCSのチェックを外すと、 /usr/ports/databases/ruby-bdb のmake が通りがちですw?
   209  10:51   cd /usr/ports/databases/ruby-bdb
   210  10:51   make config
   211  10:52   make install clean
   212  10:52   cd /usr/ports/ports-mgmt/portupgrade
   213  10:52   make reinstall clean
   214  10:52   /root/bin/check.sh
   215  10:58   history


* portupgrade が動かない 【Solved?】 2024/03/07 [#d9583034]
【参考URL】http://finaldqn.0am.jp/tdiary/?date=20240302
 /usr/ports/UPDATING (www/redmine50) のエントリ 20240228: には次のことが記載されています。
 Ruby のデフォルトのバージョンが 3.1 から 3.2 に切り替わりました。

portupgrade のバージョンアップの時、ruby が 3.1 から 3.2 となった様で、portupgrade がエラーして動作しなくなった。

 (undefined method `exists?' for File:Class)



同じ症状が出ている人のサイトがあって http://finaldqn.0am.jp/tdiary/?date=20240302 回避策が示されていた。曰く

 /usr/local/lib/ruby/site_ruby/3.2/pkgtools/pkgtools.rb の
 
 if File.exists?(custom_script) を
 
 if File.exist?(custom_script) に書き換える。

というもの。
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277410

----
Total access &counter(total);:本日 &counter(today);:昨日 &counter(yesterday);
#counter([total|today|yesterday]);

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS