2015年7月29日水曜日

FreeBSDでtexlive-full-20140525からtexlive-full-20150521へのアップグレードしようとすると失敗する

FreeBSDでtexlive-full-20140525からtexlive-full-20150521へのアップグレードしようとすると、以下のように失敗します。
# portupgrade --batch -a -n

+ print/texlive-base (texlive-base-20140525_7 -> texlive-base-20150521_2)
+ print/texlive-texmf (texlive-texmf-20140525_4 -> texlive-texmf-20150523_2)
+ print/tex-luatex (tex-luatex-0.79.1_5 -> tex-luatex-0.80.0_1)
+ print/tex-dvipdfmx (tex-dvipdfmx-20140317_2 -> tex-dvipdfmx-20150315_1)
+ print/texlive-full (texlive-full-20140525_1 -> texlive-full-20150521)
---> Packages processed: 5 done, 2 ignored, 0 skipped and 0 failed
---> Session ended at: Wed, 29 Jul 2015 11:28:55 +0900 (consumed 00:01:28)
# portupgrade --batch print/texlive-full

checking for TeX specific libraries to build...
checking for pkg-config... pkgconf
configure: error: did not find kpathsea
===> Script "configure" failed unexpectedly.

** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
! print/texlive-full (texlive-full-20140525_1) (configure error)
#
エラーメッセージをよく読むと「kpathsea」というものがないようです。portsにあるかどうか 確認してみます。
# cd /usr/ports
# ls -ld */*kpathsea*
drwxr-xr-x 3 root wheel 7 7月 28 17:56 devel/tex-kpathsea
#
確かにportsにはパッケージがあるようです。次にインストールされているかどうか調べます。
# pkg info -x texlive
texlive-base-20140525_7texlive-full-20140525_1texlive-texmf-20140525_4texlive-tlmgr-20150523_1
#
「pkg info -x パッケージ名」とすると「パッケージ名」に部分一致する、インストールされているパッケージが表示されます。上記の例では、texliveに部分一致するパッケージが表示されています。
# pkg info -x kpath
pkg: No package(s) matching kpath
#
tex-kpathseaはインストールされていないことがわかります。そこでportsからインストールします。
# cd /usr/ports/devel/tex-kpathsea/
# make

# make install

===> Installing for tex-kpathsea-6.2.1
===> tex-kpathsea-6.2.1 depends on executable: indexinfo - found
===> Checking if tex-kpathsea already installed
===> Registering installation for tex-kpathsea-6.2.1
Installing tex-kpathsea-6.2.1...
#
これでtex-kpathseaパッケージがインストールできました。
再び、texlive-fullのアップグレードをしてみます。
# portupgrade --batch print/texlive-full

checking for pkg-config... pkgconf
configure: error: did not find ptexenc
===> Script "configure" failed unexpectedly.
Please report the problem to hrs@FreeBSD.org [maintainer] and attach the
"/usr/ports/print/texlive-base/work/texlive-20150521-source/config.log"
including the output of the failure of your make command. Also, it might be
a good idea to provide an overview of all packages installed on your system
(e.g. a /usr/local/sbin/pkg-static info -g -Ea).
*** [do-configure] Error code 1
#
こんどはptexencがないようです。同様に確認してみます。
# pkg info -x ptexenc
pkg: No package(s) matching ptexenc
# ls -ld /usr/ports/*/*ptexenc*
drwxr-xr-x 3 root wheel 7 7月 28 17:56 /usr/ports/print/tex-ptexenc
#
tex-ptexencをportsからインストールします。
# cd /usr/ports/print/tex-ptexenc/
# make
# make install

===> Installing for tex-ptexenc-1.3.3_2
===> tex-ptexenc-1.3.3_2 depends on shared library: libkpathsea.so - found (/usr/local/lib/libkpathsea.so)
===> tex-ptexenc-1.3.3_2 depends on shared library: libiconv.so - found (/usr/local/lib/libiconv.so)
===> Checking if tex-ptexenc already installed
===> Registering installation for tex-ptexenc-1.3.3_2
Installing tex-ptexenc-1.3.3_2...
#
tex-ptextencがインストールできたので、試してみましょう。
# portupgrade --batch print/texlive-full

====> Compressing man pages (compress-man)
===> Installing for texlive-base-20150521_2
===> Checking if texlive-base already installed
===> An older version of texlive-base is already installed (texlive-base-20140525_7)
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 texlive-base
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** [check-already-installed] Error code 1

** Listing the failed packages (-:ignored / *:skipped / !:failed)
! print/texlive-full (texlive-full-20140525_1) (unknown build error)
#
古いtexlive-baseを削除してからインストールしなければいけないようです。
# cd /usr/ports/print/texlive-base/
# pkg info -x texlive-base
texlive-base-20140525_7
# make deinstall
===> Deinstalling for texlive-base
===> Deinstalling texlive-base-20140525_7
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:
texlive-base-20140525_7
The operation will free 12 MiB.
[1/1] Deinstalling texlive-base-20140525_7...
[1/1] Deleting files for texlive-base-20140525_7: 100%
# make reinstall
===> Installing for texlive-base-20150521_2
===> texlive-base-20150521_2 depends on executable: psbook - found
===> texlive-base-20150521_2 depends on file: /usr/local/share/texmf-dist/.texlive-tlmgr - found

mktexlsr: Updating /usr/local/share/texmf-var/ls-R...
mktexlsr: Done.
# pkg info -x texlive-base
texlive-base-20150521_2
#
確かにtexlive-baseは新しいバージョンになりました。
ふたたびtexlive-fullのアップグレードを試してみましょう。
# portupgrade --batch print/texlive-full
[Reading data from pkg(8) ... - 429 packages found - done]

===> Checking if texlive-texmf already installed
===> An older version of texlive-texmf is already installed (texlive-texmf-20140525_4)
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 texlive-texmf
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
こんどは古いtexlive-texmfを削除して再インストールする必要があるようです。
# cd /usr/ports/print/texlive-texmf
# make deinstall
===>  Deinstalling for texlive-texmf
===>   Deinstalling texlive-texmf-20140525_4
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the unive
rse):

Installed packages to be REMOVED:
        texlive-texmf-20140525_4

The operation will free 1 GiB.
[1/1] Deinstalling texlive-texmf-20140525_4...
mktexlsr: Updating /usr/local/share/texmf/ls-R... 
mktexlsr: Done.
mktexlsr: Updating /usr/local/share/texmf-dist/ls-R... 
mktexlsr: Done.
[1/1] Deleting files for texlive-texmf-20140525_4: 100%
#
# make reinstall===>  Installing for texlive-texmf-20150523_2
===>   texlive-texmf-20150523_2 depends on file: /usr/local/share/texmf-dist/.texlive-tlmgr - found
===>   texlive-texmf-20150523_2 depends on package: texlive-base>=20150521 - found
===>   Registering installation for texlive-texmf-20150523_2
Installing texlive-texmf-20150523_2...
mktexlsr: Updating /usr/local/share/texmf/ls-R...
mktexlsr: Done.

削除と再インストールがでできたので、ふたたびtexlive-fullのアップグレードです。
# portupgrade --batch print/texlive-full
[Reading data from pkg(8) ... - 429 packages found - done]
--->  Upgrading 'texlive-full-20140525_1' to 'texlive-full-201

===>   Registering installation for texlive-full-20150521
Installing texlive-full-20150521...
===>  Cleaning for texlive-full-20150521
--->  Cleaning out obsolete shared libraries
やっとアップグレードができました。

念のためにアップグレードされていないパッケージがないか、確認します。
# portupgrade --batch -n -a

        + print/tex-luatex (tex-luatex-0.79.1_5 -> tex-luatex-0.80.0_1)
        + print/tex-dvipdfmx (tex-dvipdfmx-20140317_2 -> tex-dvipdfmx-20150315_1)

#
print/tex-luatex、print/tex-dvipdfmxも新しいバージョンは2015となっているので、こちらもアップグレードします。
# portupgrade --batch print/tex-luatex print/tex-dvipdfmx

===>   Registering installation for tex-dvipdfmx-20150315_1
Installing tex-dvipdfmx-20150315_1...
mktexlsr: Updating /usr/local/share/texmf/ls-R...
mktexlsr: Done.
===>  Cleaning for tex-dvipdfmx-20150315_1
--->  Cleaning out obsolete shared libraries
ふたたびアップグレードされていないパッケージがないか確認します。
# portupgrade --batch -n -a

#
こんどはだいじょうぶでした。