macport selfupdate usando sudo falha por trás do proxy

0

Acabei de instalar o macport, mas a atualização automática falha. Eu suspeito que isso é porque eu estou na rede corporativa por trás de um proxy, mas não consigo descobrir como posso corrigi-lo.

Para o fundo, eu configurei o proxy:

$> typeset -p http_proxy
declare -x http_proxy="http://proxy:8080"

Mas o macports falha em getaddrinfo :

$> sudo port -d selfupdate
DEBUG: Copying /Users/i063510/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

Curiosamente, curl é bem-sucedida, mas ping falha:

$> curl http://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
$> ping google.com
ping: cannot resolve google.com: Unknown host
    
por Miserable Variable 04.06.2013 / 20:32

1 resposta

0

Você está configurando um proxy para conexões http. Enrole e seu navegador da Web use http, mas o rsync não. Assim explicando os erros.

Idealmente, você precisa pedir ao seu administrador de proxy para alterar o proxy para permitir a execução do rsync,

Se não, então você pode ser capaz de obter a sincronização para trabalhar sobre um proxy http como por este blog

There are three steps. The prerequisites required for this to work are that you have the proxy address, admin access to your mac, and that the proxy supports the rsync port (873/tcp).

You can test the connectivity by going to http://rsync.macports.org:873, you should get the following error:

@RSYNCD: 30.0
@ERROR: protocol startup error

If that works ok, then you need to set up the sudo environment for osx to let proxy environment settings through.

  1. Edit your sudoers file with sudo visudo. You need to append these lines:

    Defaults env_keep += "http_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY" Defaults env_keep += "ALL_PROXY NO_PROXY"

  2. Set your http proxy

    export http_proxy=http://proxy.example.com:8080

    where 8080 is the port number of the proxy

  3. Make rsync use the proxy. By default, port uses rsync to manage its updates. RSync can use a proxy environment setting (man rsync for mre)

    export RSYNC_PROXY=proxy.example.com:8080

    Note the rsync proxy capitalisation, and the fact that it does not need http://

That should do it. You can then run selfupdate to get port to the latest version.

    
por 11.06.2013 / 00:02