在 Mac Ports 中添加变体

发布于 2024-09-28 09:53:55 字数 132 浏览 5 评论 0原文

我想知道如果您已经安装了端口,如何将变体附加到端口。例如,我安装了“vim”端口,并想返回并添加 python25 变体。我需要删除vim并重新安装吗?这只是一个例子,我真的很想知道为任何端口执行此操作的过程。

感谢您的帮助, 格雷格

I was wondering how you can append a variant to a port if you have already installed the port. For example I installed the 'vim' port and would like to go back and add the python25 variant. Do I need to delete vim and reinstall it? This is just an example, I would really like to know the process to do this for any port.

Thanks for any help,
Greg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

如梦 2024-10-05 09:53:55

任何时候只能激活 MacPorts 端口的一种变体。但是,在 MacPorts 术语中,可以同时安装端口的多个变体和/或版本。其中,至多有一个是活跃,任何其他都是非活跃。如果您偶尔需要在变体之间切换,您可以根据需要激活特定变体。这也将自动停用任何冲突的活动端口。例如,这是一个假设的 vim 示例(未经过充分测试!):

$ sudo port install vim +python26
$ sudo port clean vim
$ sudo port install vim +python31
$ sudo port echo installed |grep vim
vim                            @7.3.21_0+python26
vim                            @7.3.21_0+python31
$ sudo port activate vim @7.3.21_0+python26
# ... edit with Python 2
# ...
$ sudo port activate vim @7.3.21_0+python31
# ... edit with Python 3
# ...

Only one variant of a MacPorts port can be active at any one time. However, in MacPorts terminology, multiple variants and/or versions of a port can be installed simultaneously. Of those, at most one is active, any others are inactive. If you need to occasionally alternate between variants, you can activate a specific variant as needed. That will also automatically deactivate any conflicting active port. For example, here's a hypothetical vim example (not fully tested!):

$ sudo port install vim +python26
$ sudo port clean vim
$ sudo port install vim +python31
$ sudo port echo installed |grep vim
vim                            @7.3.21_0+python26
vim                            @7.3.21_0+python31
$ sudo port activate vim @7.3.21_0+python26
# ... edit with Python 2
# ...
$ sudo port activate vim @7.3.21_0+python31
# ... edit with Python 3
# ...
凹づ凸ル 2024-10-05 09:53:55

我相信 macports 现在通过 --enforce-variants 选项原生支持这一点。所以在上面的例子中,命令是

$ sudo port upgrade --enforce-variants vim +python25

I believe macports supports this natively now with the --enforce-variants option. So in the above case, the command would be

$ sudo port upgrade --enforce-variants vim +python25
在你怀里撒娇 2024-10-05 09:53:55

您确实需要重新安装。之后没有办法添加变体——这样做甚至没有意义。变体会影响构建过程中的设置。

You do need to reinstall. There's no way to add a variant on afterwards – nor does it even make sense to do so. Variants affect settings during the build process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文