Macports upgrade outdated failed on OS X 10.9 Mavericks

bash-4.2# port upgrade outdated
---> Extracting expat
Error: org.macports.extract for port expat returned: command execution failed
Please see the log file for port expat for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
bash-4.2#
bash-4.2# tail /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log
:info:extract Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/expat/expat-2.1.0.tar.gz' | /usr/bin/gnutar --no-same-owner -xf -
:info:extract Exit code: 127
:error:extract org.macports.extract for port expat returned: command execution failed
:debug:extract Error code: NONE
:debug:extract Backtrace: command execution failed
while executing
"$procedure $targetname"
:info:extract Warning: targets not executed for expat: org.macports.destroot org.macports.extract org.macports.patch org.macports.configure org.macports.build
:notice:extract Please see the log file for port expat for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log

The /usr/bin/gnutar doesn’t exists on my mbp, but the tar command still exists.
Try to read /opt/local/bin/port, find Tcl scripts under /opt/local/share/macports/Tcl.

bash-4.2# grep -r gnutar /opt/local/share/macports/Tcl/
/opt/local/share/macports/Tcl//macports1.0/macports_autoconf.tcl: variable tar_command "/usr/bin/gnutar --no-same-owner"
/opt/local/share/macports/Tcl//port1.0/port_autoconf.tcl: variable tar_command "/usr/bin/gnutar --no-same-owner"

Edit these two file, change commands to “/usr/bin/tar -o“.

Macports upgrade outdated failed on OS X 10.9 Mavericks by @sskaje: https://sskaje.me/2013/10/macports-upgrade-outdated-failed-on-os-x-10-9-mavericks/