This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
MacPorts 是一个基于源代码的包管理器。 这意味着每次您通过 MacPorts 安装软件包时,它都会下载源代码,可能会修补它,配置它,构建它,将其安装到临时位置(以便它可以跟踪端口需要哪些文件),并对其进行存档,然后将该存档安装到 MacPorts 根目录中,通常是
/opt/local
。如果您想在构建之前查看或编辑源代码,则可以执行下载和安装它所需的部分步骤。
port extract
将下载并提取端口的源代码,而无需实际构建或安装它。 然后,您可以使用port dir
找到提取的源代码:请参阅 MacPorts 指南 有关开发端口以及
man port
的更多信息。MacPorts is a source-based package manager. That means that each time you install a package via MacPorts, it downloads the source, potentially patches it, configures it, builds it, installs it to a temporary location (so it can track which files the port needs), makes an archive of it, then installs that archive into the MacPorts root, which is usually
/opt/local
.If you want to look at or edit the source before building it, you can execute a subset of the steps necessary to download and install it.
port extract <name>
will download and extract the source for the port, without actually building or installing it. You can then find the extracted source withport dir <portname>
:See the MacPorts guide for more information on developing ports, and also
man port
.大多数开源项目提供源代码的压缩存档或可读的版本控制存储库。 例如,wget 的源代码可在 http://ftp.gnu.org/gnu/wget/。 您需要做的就是决定要下载哪个版本,然后在终端窗口中输入类似的命令,
然后可以使用类似的命令解压源代码
如果代码位于版本控制存储库中,那么该项目还将列出命令您需要下载代码。 例如, cvs2svn 为您提供命令
可能有特定于 Mac 的方法,但我所描述的内容很美妙它适用于任何类 Unix 环境。
Most open source projects provide a compressed archive of their source code, or a readable version control repository. For instance, the source code for wget is available at http://ftp.gnu.org/gnu/wget/. All you need to do is decide which version you want to download and enter in the terminal window a command like
You can then unpack the source code with a command like
If the code is in a version control repository, then the project will also list the command you'll need to download the code. For instance, cvs2svn gives you the command
There may be Mac-specific methods, but the beauty of what I described is that it works for any Unix-like environment.
apt-get
是一个自动下载和安装软件包及其依赖项的程序; 它仅适用于某些基于 Linux 的平台,例如 Debian 和 Ubuntu。 Mac OS X 有两个类似的实用程序:Fink 和 MacPorts. 两者的用途与 apt-get 相同。 我个人更喜欢MacPorts,因为我认为它有更好的用户界面,但这两个软件的工作原理或多或少是相同的。apt-get
is a program for automatically downloading and installing software packages and their dependencies; it is only available on some Linux-based platforms like Debian and Ubuntu. Mac OS X has two similar utilities: Fink and MacPorts. Both serve the same purpose asapt-get
. I personally prefer MacPorts because I think it has a nicer UI, but both pieces of software work more or less the same.AFAIK,MacPorts 没有与 apt-get 源代码类似的功能。
但是,源 URL 位于 Portfiles 中。 键入来查看端口的端口文件
您可以通过在终端中
,例如:或者您可以只安装端口并在
/opt/local/var/macports/distfiles
中查找源代码。您甚至可以使用安装命令来下载(而不是构建或安装)端口。
AFAIK, MacPorts doesn't have a similar function to apt-get's source.
However, the source URL is in the Portfiles. You can view the portfile for a port by typing
in the terminal, for example:
Or you can just install the port and find the source in
/opt/local/var/macports/distfiles
.You might even be able to use the install command to just download (and not build or install) the port.
如果您想要开源项目的 apt 接口,请查看 Fink,这是一个适用于 Mac OS X 的 dpkg 系统,各种开源包。
If you want an apt interface onto open source projects, look at Fink, a dpkg system for Mac OS X with various open source packages.