まずは、MacPorts自身のアップデートを行います。
$ sudo port selfupdate Password: MacPorts base version 1.710 installed Downloaded MacPorts base version 1.710 The MacPorts installation is not outdated so it was not updated
今回はすでに最新版になっていたようですので、MacPorts自身のアップデートは行われませんでした。しかしながら、このコマンドで sync という作業が実行されており、Portsのツリーが更新されます。
次に、アップデートが必要なパッケージがあるかを確認します。
$ port outdated The following installed ports are outdated: automake 1.10.2_0 < 1.11_0 git-core 1.6.2.4_0 < 1.6.3.1_0 glib2 2.20.1_0 < 2.20.1_1 gsed 4.1.5_4 < 4.2_0 ImageMagick 6.5.1-0_0 < 6.5.2-4_1 libtheora 1.0_0 < 1.0_0 mysql5 5.0.77_2 < 5.0.81_0 pcre 7.8_3 < 7.9_0 rsync 3.0.5_0 < 3.0.6_0 sqlite3 3.6.13_0 < 3.6.14.1_0 subversion 1.6.1_0 < 1.6.2_0 subversion-perlbindings 1.6.1_0 < 1.6.2_0 vim 7.2.160_0 < 7.2.182_0
ここではautomakeやgit-coreなどが古いパッケージという事になります。
通常のアップデートでは一つもしくは複数のパッケージを選択して行います。
$ sudo port upgrade automake git-core
ですが、以下のコマンドで古いパッケージを一括してアップデートを行う事ができます。
$ sudo port upgrade outdated Password ---> Fetching automake ---> Attempting to fetch automake-1.11.tar.bz2 from ftp://ftp.dti.ad.jp/pub/GNU/automake ---> Verifying checksum(s) for automake ---> Extracting automake ---> Configuring automake ---> Building automake ---> Staging automake into destroot ---> Deactivating automake @1.10.2_0 ---> Installing automake @1.11_0 ---> Activating automake @1.11_0 ---> Cleaning automake ---> Fetching rsync ...
なお、インストール時に設定したオプションは引き継がれますので、安心してアップデートを行う事ができます。