I'm behind a http proxy and a wanna update macports using sudo port selfupdate
. But it always fails with the following output:
$ sudo port -d selfupdate
DEBUG: Copying /Users/simon/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync
rsync: getaddrinfo: rsync.macports.org 873: nodename nor servname provided, or not known
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed
Obviously the problem is that rsync
not connecting to the server, so I tried rsync
alone and it gives me a similar result.
$ sudo /usr/bin/rsync -rtzvvv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
opening tcp connection to rsync.macports.org port 873
rsync: getaddrinfo: rsync.macports.org 873: nodename nor servname provided, or not known
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
_exit_cleanup(code=10, file=/SourceCache/rsync/rsync-42/rsync/clientserver.c, line=105): about to call exit(10)
I do get my RSYNC_PROXY
environment variable set and the proxy is working, but according to the output of rsync
it seems it's not using the proxy I gave it but trying a direct connection instead. Can anyone help? Thanks!
Here's some more info in case needed.
$ echo $RSYNC_PROXY
127.0.0.1:3128
$ curl -x localhost:3128 http://rsync.macports.org:873/
@RSYNCD: 30.0
$ uname -a
Darwin Simon-MP.local 12.0.0 Darwin Kernel Version 12.0.0: Sun Jun 24 23:00:16 PDT 2012; root:xnu-2050.7.9~1/RELEASE_X86_64 x86_64