|
A.3. 通过 CVSup 获取源代码使用匿名 CVS 检索 PostgreSQL 源码树的另一个方法是 CVSup 。 CVSup 是由 John Polstra 开发的,用于为 FreeBSD 项目 分发CVS 仓库和其他文件树。 使用 CVSup 的主要优点是它可以可靠地在你的本地机器上复制 整个 CVS 仓库,允许快速的本地使用cvs 操作, 象 log 和 diff 。 其他优点包括与 PostgreSQL 服务器的快速同步,因为它使用一种高效的流传输协议, 该协议只传输最后更新(以来)的修改。 A.3.1. 准备一个 CVSup 客户端系统做这件事需要为 CVSup 准备两个目录区域:一个本地 CVS 仓库(或者就是一个目录区域 — 如果你只是抓取一个快照而不是整个仓库; 见下文) 和一个本地 CVSup 簿记区域。 这些东西可以在同一个目录树里面共存。 确定你将在哪个目录里面安放你的 CVS 仓库的本地拷贝。在我们的一个系统中, 我们最近在 /home/cvs/ 设立了仓库, 但是以前我们把它放在 /opt/postgres/cvs/ 里的一个 PostgreSQL 开发版的目录树里。 如果你想把你的仓库放在 /home/cvs/ ,那么把 setenv CVSROOT /home/cvs 放到你的 .cshrc 文件, 或者根据你用的 shell 把类似的行放到你的 .bashrc 或 .profile 文件里。 cvs 仓库区域必须被初始化。一旦设置了 CVSROOT ,那么初始化可以简单地用下面的命令完成: $ cvs init 之后,你列举 CVSROOT 目录时,你至少能看到一个名为 CVSROOT 的目录。 $ ls $CVSROOT CVSROOT/
A.3.2. 运行 CVSup 客户端先证实 cvsup 在你的路径里; 在大多数系统上你可以键入下面命令核实这些 which cvsup 然后,只需要用下面命令运行 cvsup : $ cvsup -L 2 postgres.cvsup 这里的 -L 2 打开了一些状态消息, 这样你就可以监控更新的进展过程,而 postgres.cvsup 是你赋予你的 CVSup 配置文件的路径和名称。 这里是一份为特定安装修改过的 CVSup 配置文件,它维护着一个完整的本地 CVS 仓库:
# This file represents the standard CVSup distribution file
# for the
PostgreSQL
ORDBMS project
# Modified by lockhart@fourpalms.org 1997-08-28
# - Point to my local snapshot source tree
# - Pull the full CVS repository, not just the latest snapshot
#
# Defaults that apply to all the collections
*default host=cvsup.postgresql.org
*default compress
*default release=cvs
*default delete use-rel-suffix
# enable the following line to get the latest snapshot
#*default tag=.
# enable the following line to get whatever was specified above or by default
# at the date specified below
#*default date=97.08.29.00.00.00
# base directory where CVSup will store its 'bookmarks' file(s)
# will create subdirectory sup/
#*default base=/opt/postgres # /usr/local/pgsql
*default base=/home/cvs
# prefix directory where CVSup will store the actual distribution(s)
*default prefix=/home/cvs
# complete distribution, including all below
pgsql
# individual distributions vs 'the whole thing'
# pgsql-doc
# pgsql-perl5
# pgsql-src
下面的是PostgreSQL ftp 站点 (ftp://ftp.postgresql.org/pub/CVSup/README.cvsup) 建议的 CVSup 配置文件,它将只是抓取目前(版本)的快照:
# This file represents the standard CVSup distribution file
# for the
PostgreSQL
ORDBMS project
#
# Defaults that apply to all the collections
*default host=cvsup.postgresql.org
*default compress
*default release=cvs
*default delete use-rel-suffix
*default tag=.
# base directory where CVSup will store its 'bookmarks' file(s)
*default base=
/usr/local/pgsql
# prefix directory where CVSup will store the actual distribution(s)
*default prefix=
/usr/local/pgsql
# complete distribution, including all below
pgsql
# individual distributions vs 'the whole thing'
# pgsql-doc
# pgsql-perl5
# pgsql-src
A.3.3. 安装 CVSupCVSup 可以以源代码的形式、制作好了的二进制形式、或者 Linux RPM 的形式获得。 使用二进制的形式要远比从源代码里面制作要容易得多, 主要是因为编译需要高效但是庞大的 Modula-3 编译器。 从二进制包安装 CVSup 如果你拥有一个在 PostgreSQL ftp 站点 里贴出来的平台,或者你正在运行 FreeBSD, 你就可以使用制作好了的二进制形式,这时候 CVSup 是以一个已移植好了的形式获得的。
在写作这些的时候,可以获得下面平台的二进制 Alpha/Tru64,ix86/xBSD, HPPA/HP-UX10.20,MIPS/irix, ix86/linux-libc5,ix86/linux-glibc, Sparc/Solaris,and Sparc/SunOS。
A.3.4. 从源代码安装从源代码安装 CVSup 并非易如反掌, 主要是因为大多数系统将需要先安装一个 Modula-3 编译器。 这个编译器可以以Linux RPM , FreeBSD 的包或者源代码的形式获得。
Linux 安装
|