使用 CVSup 的主要优点是它可以可靠地在你的本地机器上复制整个 CVS 仓库,允许快速的本地使用 cvs 操作,象 log 和 diff。其他优点包括与 Postgres 服务器的快速同步,因为它使用一种高效的流传输协议,该协议只传输最后更新(以来)的修改。
确定你将在哪个目录里面安放你的 CVS 仓库的本地拷贝。在我们的一个系统中,我们最近在 /home/cvs/ 设立了仓库,但是以前我们把它放在 /opt/postgres/cvs/ 里的一个 Postgres 开发版的目录树里。如果你想把你的仓库放在 /home/cvs/ 那么把
setenv CVSROOT /home/cvs放到你的 .cshrc 文件,或者根据你用的 shell 把类似的行放到你的 .bashrc 或 .profile 文件里。
cvs 仓库区域必须被初始化。一旦设置了
CVSROOT,那么初始化可以简单地用下面的命令完成:
$ cvs init之后,你列举 CVSROOT 目录时,你至少能看到一个名为 CVSROOT 的目录。
$ ls $CVSROOT CVSROOT/
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@alumni.caltech.edu 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=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 points to 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 points to 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下面的是 Postgres ftp 站点 建议的 CVSup 配置文件,它将只是抓取目前(版本)的快照:
# This file represents the standard CVSup distribution file # for the PostgreSQL ORDBMS project # # Defaults that apply to all the collections *default host=postgresql.org *default compress *default release=cvs *default delete use-rel-suffix *default tag=. # base directory points to where CVSup will store its 'bookmarks' file(s) *default base=/usr/local/pgsql # prefix directory points to 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
如果你拥有一个在 Postgresftp 站点 里贴出来的平台,或者你正在运行 FreeBSD,你就可以使用制作好了的二进制形式,这时候CVSup 是以一个已移植好了的形式获得的。
注意:CVSup 最初是作为一个用于分发 FreeBSD 源码树的工具开发的。对于那些运行 FreeBSD 的人来说,它可以当作 "port"(移植)获取,如果这些描述不足以说明如何获取和安装它的问题,那么请为我们在这里贡献一个过程。
如果你使用其他平台,在 Postgresftp
站点上 找出并下载适合你的二进制文件。
$ cd /usr/local/bin $ tar zxvf /usr/local/src/cvsup-16.0-linux-i386.tar.gz $ mv cvsup.1 ../doc/man/man1/如果 tar 文件里面有一个目录结构,那么把 tar 文件解包到 /usr/local/src 里,然后把二进制移动到上面对应的合适路径里。
$ rehash $ which cvsup $ set path=(path to cvsup $path) $ which cvsup /usr/local/bin/cvsup
注意:一个 Modula-3 的净代码安装大约需要 200MB 磁盘空间,当把源代码删除后大约只有 50MB。
小技巧:这些 rpm 包有许多RPM 文件,因此你可能会喜欢把它们放在独立的一个目录里。
# rpm -Uvh pm3*.rpm
# cd /usr/local/src # tar zxf cvsup-16.0.tar.gz制作 cvsup 的发布版,禁止 GUI 界面以避免要求 X11 库:
# make M3FLAGS="-DNOGUI"如果你想制作一个静态的二进制以便于装到一个没有安装 Modula-3 的系统,用:
# make M3FLAGS="-DNOGUI -DSTATIC"安装制作好了的二进制:
# make M3FLAGS="-DNOGUI -DSTATIC" install