简体   繁体   English

MacPorts安装-Shell命令/ Postflight脚本

[英]MacPorts Installation — Shell Commands/Postflight Script

I had run the MacPorts installer (2.0.3) for my OS X Leopard (10.5.8) which finished "successfully". 我为OS X Leopard(10.5.8)运行了MacPorts安装程序(2.0.3),该安装程序“成功”完成。 Unfortunately the port command was not available so I looked in the MacPorts Guide which says that the installer should have run a so-called "postflight" script that sets the necessary environment variables. 不幸的是,port命令不可用,因此我查看了MacPorts指南,该指南说安装程序应该运行所谓的“ postflight”脚本来设置必要的环境变量。 I tried to run the postflight script manually (which I downloaded from here ), but the execution fails with the following output: 我尝试手动运行postflight脚本(从此处下载),但是执行失败并显示以下输出:

    Detected the bash shell.
    Your shell already has the right PATH environment variable for use with
    MacPorts!
    Your shell already has the right MANPATH environment variable for use with
    MacPorts!
    Your shell already has the right DISPLAY environment variable for use with
    MacPorts!
    Adding [default] tag to sources.conf if needed...
    couldn't read file "/Contents/Resources/upgrade_sources_conf_default.tcl": no
   such file or directory
    Updating port image format...
    couldn't read file "/Contents/Resources/images_to_archives.tcl": no such file or
    directory
    Synchronizing the MacPorts installation with the project's rsync server...
    -bash: __PREFIX__/bin/port: No such file or directory
    An attempt to synchronize your recent MacPorts installation with the project's
    rsync server failed!
    Please run 'sudo port -d selfupdate' manually to find out the cause of the 
    error.
    You have succesfully installed the MacPorts system, launch a terminal and try it
    out!
    Read the port(1) manual page and http://guide.macports.org for help,
    http://www.macports.org/contact.php if you need to get in touch with The 
    MacPorts Project.

Any ideas? 有任何想法吗?

First invoke the port command directly: 首先直接调用port命令:

$ /opt/local/bin/port help

If that comes back with something reasonable (like the help text) then it's just that your $PATH isn't being used by your current shell. 如果返回的是合理的内容(例如帮助文本),则说明当前的shell并未使用$PATH Try logging off and back on again to resolve that in the short term (this will test that your .bashrc file is correctly configured) or you could just modify the PATH environment variable directly (which doesn't test .bashrc ): 尝试注销然后再次重新启动以在短期内解决该问题(这将测试您的.bashrc文件是否已正确配置),或者您可以直接修改PATH环境变量(不测试.bashrc ):

$ export PATH=$PATH:/opt/local/bin

You downloaded the postflight script but it alone cannot access the accessory scripts in Contents/ because those are located into the install package. 您下载了postflight脚本,但仅凭它无法访问Contents /中的附件脚本,因为它们位于安装包中。

Those missing Tcl scripts are for upgrading from an older install, the log says PATH was already correctly configured but the macports bin directory could have the wrong position in PATH variables, for instance being at the end of PATH. 那些丢失的Tcl脚本是用于从较早的安装进行升级的,日志显示PATH已经正确配置,但是macports bin目录在PATH变量中的位置可能错误,例如在PATH的末尾。

If you are doing a fresh install you can just only need PATH and MANPATH -you want man pages provided by macports before system's ones- as per [1] 如果您要进行全新安装,则只需[PATH]和[MANPATH]-您希望macports在系统的手册页之前提供手册页-按照[1]

[1] http://guide.macports.org/#installing.shell.postflight [1] http://guide.macports.org/#installing.shell.postflight

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM