パッケージのアップグレード(upgrade)

広告

インストール済みのパッケージに関してアップグレード出来るものがあるか確認することが出来ます。「list-upgrades」コマンドを使います。

D:¥php>pear help list-upgrades
pear list-upgrades [options] [preferred_state]
List releases on the server of packages you have installed where
a newer version is available with the same release state (stable etc.)
or the state passed as the second parameter.
Options:
  -i, --channelinfo
        output fully channel-aware data, even on failure

D:¥php>

ではコマンドプロンプトから「pear list-upgrades」と入力しEnterキーを押します。

pear list-upgrades

アップグレード可能なパッケージの確認

「PEAR」パッケージがインストールされているバージョンが1.7.1であるのに対して最新版では1.7.2となっていることが確認できます。

「upgrade」コマンドによるパッケージのアップグレード

ではパッケージのアップグレードを行ってみましょう。「upgrade」コマンドを使います。

D:¥php>pear help upgrade
pear upgrade [options] <package> ...
Upgrades one or more PEAR packages.  See documentation for the
"install" command for ways to specify a package.

When upgrading, your package will be updated if the provided new
package has a higher version number (use the -f option if you need to
upgrade anyway).

More than one package may be specified at once.

Options:
  -f, --force
        overwrite newer installed packages
  -l, --loose
        do not check for recommended dependency version
  -n, --nodeps
        ignore dependencies, upgrade anyway
  -r, --register-only
        do not install files, only register the package as upgraded
  -B, --nobuild
        don't build C extensions
  -Z, --nocompress
        request uncompressed files when downloading
  -R DIR, --installroot=DIR
        root directory used when installing files (ala PHP's INSTALL_ROOT)
  --ignore-errors
        force install even if there were errors
  -a, --alldeps
        install all required and optional dependencies
  -o, --onlyreqdeps
        install all required dependencies
  -O, --offline
        do not attempt to download any urls or contact channels
  -p, --pretend
        Only list the packages that would be downloaded


D:¥php>

書式は次の通りです。

pear upgrade [options] <package> ...

今回はPEARパッケージのアップグレードですので次のように実行します。

pear upgrade PEAR

アップグレード可能なパッケージの確認

アップグレードは無事完了しました。では「list」コマンドで確認してみます。

アップグレード可能なパッケージの確認

「PEAR」パッケージのバージョンが「1.7.2」になっていることが確認できます。また「list-upgrades」コマンドを実行します。

アップグレード可能なパッケージの確認

アップグレード可能なパッケージが無くなっていることも確認できます。

( Written by Tatsuo Ikura )