【问题标题】:Cannot sync with MacPorts from SVN无法从 SVN 与 MacPorts 同步
【发布时间】:2023-12-05 09:39:01
【问题描述】:

运行 10.7.4,我运行了以下内容:

mkdir -p /opt/mports
cd /opt/mports
svn checkout https://svn.macports.org/repository/macports/trunk
cd trunk/base
./configure --enable-readline
make
sudo make install
make distclean

然后我运行nano /opt/local/etc/macports/sources.conf,注释掉rsync://rsync.macports.org/release/tarballs/ports.tar并添加file://opt/mports/trunk/dports [default]

运行sudo port -d sync后我收到了

DEBUG: Copying /Volumes/Storagestar/Users/themikemasterson/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
--->  Updating the ports tree
Synchronizing local ports tree from file:///opt/mports/trunk/dports
DEBUG: /usr/bin/svn update --non-interactive /opt/mports/trunk/dports
DEBUG: changing euid/egid - current euid: 0 - current egid: 0
svn: OPTIONS of 'https://svn.macports.org/repository/macports/trunk': Server certificate verification failed: issuer is not trusted (https://svn.macports.org)
Command failed: /usr/bin/svn update --non-interactive /opt/mports/trunk/dports
Exit code: 1
DEBUG: command execution failed
while executing
"system $svn_commandline"
Error: Synchronization of the local ports tree failed doing an svn update
DEBUG: Synchronization of 1 source(s) failed
while executing
"mportsync [array get global_options]"
port sync failed: Synchronization of 1 source(s) failed

通过 rsync 更新可以正常工作,但在使用本地资源时不行。另外,我在开始结账时可以选择接受证书,我选择永久接受。

【问题讨论】:

    标签: macos svn sync macports


    【解决方案1】:

    @Vortexfive 提供的答案是对的。照他说的做然后复制.subversion从你的主目录到/opt/local/var/macports/home

    $ sudo bash
    # find ~/.subversion/auth -type f -exec rm -f {} \;
    # cd /opt/mports/trunk
    # svn update     (press 'p' to store the certificate)
    # cd /opt/local/var/macports/home
    # cp -R ~/.subversion .
    # port selfupdate
    

    完成!

    【讨论】:

    • 这是我在 OS X 10.11.4 上使用macports 中的说明绕过工作防火墙的最后一个障碍
    【解决方案2】:

    尝试手动执行(与日志文件相同,但没有 --non-interactive):

    /usr/bin/svn update /opt/mports/trunk/dports
    

    现在,您应该会收到消息:

    Error validating server certificate for 'https://svn.macports.org:443':
     - The certificate is not issued by a trusted authority. Use the
       fingerprint to validate the certificate manually!
    Certificate information:
     - Hostname: *.macports.org
     - Valid: from Tue, 22 Feb 2011 17:29:43 GMT until Tue, 18 Mar 2014 23:36:56 GMT
     - Issuer: 07969287, http://certificates.godaddy.com/repository, GoDaddy.com, Inc., Scottsdale, Arizona, US
     - Fingerprint: ...
    (R)eject, accept (t)emporarily or accept (p)ermanently?
    

    如果你选择p,svn 会在你下次做port sync 时接受macports 的证书。

    【讨论】:

    • 我的环境和原版海报差不多。当我发出上述命令时,我没有永久接受的选项。
    • 其实取消上面的。原来是因为.subversion/config 包含store_auth_creds = no。一旦我改变了它,我就可以再次存储。
    • 查看我的答案以获得该问题的完整解决方案。