CVS-RCS- (原始程式码版本控制系统) HOW-TO 文件 <!-- chapt change CVS-RCS HOW-TO Concurrent Version Control System and Revision Control System (原始程式码管理工具) --> <author> 作者:Al Dev (Alavoor Vasudevan) <htmlurl url="mailto:alavoor@yahoo.com" name="alavoor@yahoo.com"> <newline> 译者:Cyril Huang <htmlurl url="mailto:cyril_huang@yahoo.com" name="cyril_huang@yahoo.com"> <date>v7.0, 20 Feb 2000 翻译日期: 5 April 2000 <abstract> 这份文件是一份 "实际操作的说明" ,以便於能使您很快的设定 CVS/RCS 原始程式码控制系统。 这份文件里也有一些将 CVS 上常用的混合命令包成可设定的 shell scripts 。这些 scripts 为 CVS 提供了一个简单的使用者介面。这份文件的内容不仅能适用於 Linux 系统也适用於其他像 Unix 的系统,例如Solaris, HPUX, AIX, SCO, Sinix, BSD, SCO 等等。 </abstract> <!-- Table of contents --> <toc> <!-- Begin the document --> <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt>简介 --> <sect>简介 <p> 原始码控制系统是一个必须能管理那些在软体计划发展时原始码所做的改变。软体开发者需要一个完整的原始码改变历史纪录, 以便於在发生问题时,能够追溯到以前稳定的版本。 既然原始程式码对於任何的软体计划与开发,都是花时间与金钱中最关键的部分,所以花时间藉由使用原始码控制系统像 CVS 和 RCS 来<it><bf>安全的保护(safe-guarding)</bf></it>原始程式码是非常重要的。 <p> CVS (Concurrent Version Control System) 是一个能让很多程式开发者同时做软体开发的非常强大工具。它使用了RCS 的档案规定格式但多了一层像应用程式介面的包装,架在 RCS 的上层。 (译注: RCS 是较老的版本控制,一个受 RCS 管制的档案看起来是这样子的 proj1.c,v ,CVS 沿用了一些 RCS 的规定。) CVS 能够纪录你的档案的历史纪录( 通常是原始程式码,但是其他型态的档案则不一定)。 CVS 只存了不同版本中档案的差异,而不是你所建立的每个版本中的每个档案。 CVS 也保持了一个何时,何人更改档案,为什麽更改档案等等不同观点的历史纪录。 CVS 对於软体的发行和多人同时更改目前原始码的管理是非常的有帮助。 他并不只是要对单一目录下的档案提供版本控制, 相反的,CVS 更提供了多层有组织的目录档案的版本控制。 在这个目录下除了你的原始程式码外,还包含有一个 CVS 所建立的改版控制目录与档案。 这些目录与档案最後被合并在一起形成一个软体的发行。 CVS 能被使用在 "C", "C++", Java, Perl, HTML 和其他档案。 <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt> 那一种版本控制系统适合我? CVS 或 RCS --> <sect> 那一种版本控制系统适合我? CVS 或 RCS <p> CVS 实际上是架在 RCS 之上的, CVS 只是一堆更强大能控制一个有完整原始程式码阶层目录的工具。 我们<it><bf>非常强烈</bf></it>的推荐您使用 CVS,因为您能够很有弹性的用 perl , korn bash shell 等 scripts 语言设定您自己的 CVS 系统。 请看一些 korn shell scripts 的□例 <ref id="Shell Scripts">。 CVS 的优点 <itemize> <item> CVS 是非集中式的管理,使用者从储存柜 (repository) 登出一个档案目录, 并且有他自己的独立的稳定目录树。 <item> CVS 能够在发行整个计划的原始目录树中"盖上印记" ("STAMP")。 <item> CVS 能够使大家同时修改档案。 <item> CVS 能够用 shell scripts 或 perl 设定成档案锁住成单一使用或同时修改档案模式。 </itemize> CVS 的缺点 <itemize> <item> 需要比 RCS 多一点的管理。 <item> 非常成熟复杂的系统,是目前应用上已有的最高技术。(感谢网友tsaipaw@mars.seed.net.tw来信指证我的错误) <item> 有丰富的命令还有命令选项,因此对於初学者来说有很陡的学习曲线。 简单使用的 shell scripts 可在这里找到 <ref id="Shell Scripts">。 </itemize> RCS 的优点 <itemize> <item> RCS 非常容易设定。较少一些管理上的工作。 <item> RCS 用在一个每个人在一起工作的集中区域。 <item> RCS 对於简单的系统很有用。 <item> 非常严谨的单一档案修改模式 - 同步与同时是不允许的。 </itemize> RCS 的缺失 <itemize> <item> 由於使用单一目录控制与档案锁住,不可能由很多的程式设计者做同时的开发。因为单一目录下很多人对档案的改变,会造成 make 的使用错误。 <item> 不能对整个软体计划戳上发行(releases)的印记。 </itemize> 这份文件也包含一些 shell scripts 以提供简单的命令来作登出 (check-out), 登录 (check-in), 送交(commit) 档案的动作。 请看一些 shell scripts 的□例 <ref id="Shell Scripts">。 对於 RCS 而言,请看 Linux CD-ROM 里面的RCS mini-howto。 <CODE> cd /mnt/cdrom/Redhat/RPMS ls -l howto-6.0-*.noarch.rpm rpm -qpl howto-6* | grep -i rcs </CODE> 或者看 <url url="http://sunsite.unc.edu/LDP/HOWTO/mini/RCS-HOWTO.html"> <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt> 设定 CVS <label id="Setting up CVS"> --> <sect> 设定 CVS <label id="Setting up CVS"> <p> 首先,你需要安装 CVS 套件,在Redhat Linux 上请用 <CODE> cd /mnt/cdrom/Redhat/RPMS rpm -i rcs*.rpm rpm -i cvs*.rpm To see the list of files installed do - rpm -qpl cvs*.rpm | less </CODE> 然後用 j, k, CTRL+f, CTRL+D, CTRL+B, CTRL+U 或上下左右键, page up/down 浏览一下结果。 请用 'man less' 查看 less 的用法 在其他的 unix 机器上,你可能需要下载 RCS CVS 的 tar.gz 档案, 然後根据 README, INSTALL 档的指示来安装 CVS。 请到 <url url="http://www.cyclic.com"> 和 <url url="http://www.loria.fr/~molli/cvs-index.html"> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> CVS 的专有环境变数 <label id="CVS-Env"> <p> 下列的环境变数需要在 /etc/profile 档中设定,/etc/profile 是对所有使用者都有效的内定值设定档, 如果没有设定 /etc/profile,那麽你应该加这些设定到你自己的设定档 ~/.bash_profile 内。 <CODE> export EDITOR=/bin/vi export CVSROOT=/home/cvsroot export CVSREAD=yes </CODE> 建造一个目录来存你原始程式码的储藏柜 (repository) 并且给予 unix group 与 user 读写的权力。 (译注:这个目录下将会有很多你将来的原始码。) <CODE> export CVSROOT=/home/cvsroot mkdir $CVSROOT chmod o-rwx $CVSROOT chmod ug+rwx $CVSROOT </CODE> 要初始化你的 CVS ,并且从现在开始把你的原始程式码交给 CVS 管理。请做 - <CODE> cvs init (译注;这个初始化的动作在於建造一个储藏柜,是一个目录$CVSROOT/。 同时 $CVSROOT/CVSROOT 也在此时被建造,这个模组目录下面是控制你CVS的administration files, 里面的档案做一些修改後,可以使CVS更强大好用。 $CVSROOT 下的目录每个都是 module 的意思,一个 module 可以就是一个专案计划。 但也可能是你把一个计划拆成很多 module ,不同 module 交给不同的 team 去发展。) # 一定要换到想要 CVS 控制的计划目录下喔 cd $HOME/my_source_code_dir # 把整个目录纳入管理用 import 命令 cvs import my_source_code_dir V1_0 R1_0 (译注:其实是 cd 到你的project下後,cvs import 模组 vendor_tag release_tag, 不一定要是目录名称 my_source_code_dir,vendor_tag, release_tag 只是识别用的东西, 将来你可以用 tag 来存取你要的特定版本 这个动作会在 $CVSROOT/ 下开个" 模组 "的目录,然後把 my_source_code_dir 整个放到 CVS 下管理, $HOME/my_source_code_dir 就没用了。import 的动作是把已经写好的一堆 code 摆进来, 如果将来想新增档案xxxx.c,必须先写好xxxx.c,再用 cvs add xxxx.c) </CODE> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> 从 RCS 转换到 CVS 系统 <label id="RCS2CVS"> <p> 要转换已经存在的 RCS 档案到 CVS ,请使用下面的 script 。并确定你从你的 Linux CD-ROM 安装了 korn shell 套件 pdksh*.rpm。 <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> <CODE> #!/bin/ksh ############################################################# # Program to Migrate the existing source code in RCS to CVS # # Needs the korn shell RPM package pdksh*.rpm from Linux # contrib cdrom ############################################################# # # rcs2cvs - convert source tree from RCS to CVS # # project to convert PROJECT='project' # current RCS root RCSROOT="$HOME/rcs" if cd "$RCSROOT/$PROJECT" then cd "$RCSROOT" else echo >&2 "`basename "$0"`: can't change to RCS directory '$RCSROOT/$PROJECT'." exit 1 fi # current CVS root CVSROOT="$HOME/cvs" # create new CVS directory for project 'project' if mkdir "$CVSROOT/$PROJECT" then : else echo >&2 "`basename "$0"`: can't create CVS directory '$CVSROOT/$PROJECT'." exit 2 fi # create CVS project tree from RCS tree find "$PROJECT" -type d -name RCS -print | while read RCS do CVS="`dirname "$RCS"`" (if cd "$RCS" then # if find . -type f -name '*,v' -print | cpio -pdmv "$CVSROOT/$CVS" if find . -type f -print | cpio -pdmv "$CVSROOT/$CVS" then : else echo >&2 "`basename "$0"`: can't convert RCS subdirectory '$RCSROOT/$RCS' to CVS subdirectory '$CVSROOT/$CVS'." fi else echo >&2 "`basename "$0"`: can't change to RCS subdirectory '$RCSROOT/$RCS'." fi) done </CODE> 现在 RCS 已经被改成 CVS 系统下的 'project'. 你可以开始用CVS命令来存取 'project' 这个模组了. <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt> Shell Scripts <label id="Shell Scripts"> --> <sect> Shell Scripts <label id="Shell Scripts"> <p> 下面的 scripts 是基本 CVS 命令的集合,而且是 Korn shell 的 scripts 。你可以把他转成 perl 或者 bash。你可以自己修改成你想要的样子。 这些只是运用基本 CVS 命令但有些特殊的花样加在里面。例如, sedit 这个 script 提供了档案锁住的功能使得其他人知道有某人正在修改这个档案, 当然你也可以直接使用 CVS 命令而不用这些 scripts ,这些 scripts 只是在展示 CVS 是多麽的有弹性。 把这些 scripts 复制到 /usr/local/bin 下,并且此目录应该在你的 PATH 环境变数中。 <enum> <item> <bf>sget</bf> [-r revision_number] <file/directory name> 要从 CVS 获得一个唯读档案或整个唯读目录, 请按 <ref id="sget"> <item> <bf>sedit</bf> [-r revision_number] <filename> 要修改一个一个程式码时,这个 scripts 会做档案锁住的动作,因此没有别人可以登出这个档案了。当然你可以改变这个 script 成你想要的功能 - 例如不锁住,只出现警告讯息,或者相反的,非常严谨的锁档案。 请按 <ref id="sedit"> <item> <bf>scommit</bf> [-r revision_number] <filename> 要交出某个你修改的档案或整个目录。 把你的改变交给 CVS。 请按 <ref id="scommit"> <item> <bf>supdate</bf> <filename/directory> 要藉由从 CVS 得到最新的档案来update 一个档案或整个目录。 请按 <ref id="supdate"> <item> <bf>sunlock</bf> [-r revision_number] <filename> 要把因为用 sedit 後的档案锁关掉。这会释放档案锁(Release File Lock)。 请按 <ref id="sunlock"> <item> <bf>slist</bf> 要看目前正被你修改的档案列表。 做 'ls -l | grep | ...' 命令, 请按 <ref id="slist"> <item> <bf>sinfo</bf> <filename/directory> 要得到一个档案的改版资讯。 请按 <ref id="sinfo"> <item> <bf>slog</bf> <filename> 要得到一个 CVS 档案改版的历史纪录, 请按 <ref id="slog"> <item> <bf>sdif</bf> <filename> <p><bf>sdif</bf> -r rev1 -r rev2 <filename> 要得到你的档案与 CVS 柜子里的档案不同的地方在哪里。 请按 <ref id="sdif"> 注意: sdif 只有一个 'f' ,因为这里已经有一个 unix 命令叫 'sdiff'。 <item> <bf>sadd</bf> <filename> 要新增一个档案到 CVS 柜子里。 请按 <ref id="sadd"> <item> <bf>sdelete</bf> <filename> 要从 CVS 柜子里清掉一个档案。 请按 <ref id="sdelete"> <item> <bf>sfreeze</bf> <revision name> <directory name> 要冻结原始码 (freeze codes) ,这是将要发行 (release) 整个原始码目录树。 请按 <ref id="sfreeze"> <item> <bf>saddtree</bf> <revision name> <directory name> 要新增一个目录树到 CVS 。 请按 <ref id="saddtree"> <p> 例如 : <code> cd $HOME; sfreeze REVISION_1_0 srctree </code> 这将会冻结原始码,并贴上一个标签 REVISION_1_0 ,如此一来你就可以稍後用版本名字登出整个目录树。 </enum> <tscreen><verb> ****************************************************** </verb></tscreen> <p> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sget <label id="sget"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program sget # Program to check out the file from CVS read-only cmdname=`basename $0` Usage() { print "\nUsage: $cmdname [-r revision_number/symbolic_tag_name] <file/directory name> " print "The options -r are optional " print "For example - " print " $cmdname -r 1.1 foo.cpp" print " $cmdname foo.cpp " print " $cmdname some_directory " print "Extract by symbolic revision tag like - " print " $cmdname -r REVISION_1 some_directory " print " " exit } # Command getopt will not supported in next major release. # Use getopts instead. while getopts r: ii do case $ii in r) FLAG1=$ii; OARG1="$OPTARG";; ?) Usage; exit 2;; esac done shift ` expr $OPTIND - 1 ` #echo FLAG1 = $FLAG1 , OARG1 = $OARG1 if [ $# -lt 1 ]; then Usage fi bkextn=sget_bak hme=` echo $HOME | cut -f1 -d' ' ` if [ "$hme" = "" ]; then print "\nError: \$HOME is not set!!\n" exit fi # Check if file already exists.... if [ -f $1 ]; then user_perms=" " group_perms=" " other_perms=" " user_perms=`ls -l $1 | awk '{print $1 }' | cut -b3-3 ` group_perms=`ls -l $1 | awk '{print $1 }' | cut -b6-6 ` other_perms=`ls -l $1 | awk '{print $1 }' | cut -b9-9 ` if [ "$user_perms" = "w" -o "$group_perms" = "w" \ -o "$other_perms" = "w" ]; then print "\nError: The file is writable. Aborting $cmdname ......" print " You should either backup, scommit or delete the file and" print " try $cmdname again\n" exit fi fi cur_dir=`pwd` #echo $cur_dir len=${#hme} len=$(($len + 2)) #echo $len subdir=` echo $cur_dir | cut -b $len-2000 ` #echo $subdir if [ "$subdir" = "" ]; then fdname=$1 else fdname=$subdir"/"$1 fi # Move the file touch $1 2>/dev/null \mv -f $1 $1.$bkextn # Create subshell ( cd $hme #echo $fdname # Use -A option to clear all sticky flags if [ "$FLAG1" = "" ]; then cvs -r checkout -A $fdname else cvs -r checkout -A -$FLAG1 $OARG1 $fdname fi ) #pwd if [ -f $1 ]; then print "\nREAD-ONLY copy of the file $fdname obtained." print "Done $cmdname" #print "\nTip (Usage): $cmdname <file/directory name> \n" fi </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sedit <label id="sedit"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program sedit # Program to check out the file from CVS read/write mode with locking cmdname=`basename $0` Usage() { # print "\nUsage: $cmdname [-r revision_number] [-F] <filename>" # print "The options -r, -F are optional " # print "The option -F is FORCE edit even if file is " # print "locked by another developer" print "\nUsage: $cmdname [-r revision_number] <filename>" print "The options -r are optional " print "For example - " print " $cmdname -r 1.1 foo.cpp" print " $cmdname foo.cpp " # print " $cmdname -F foo.cpp " print " " } # Command getopt will not supported in next major release. # Use getopts instead. #while getopts r:F ii while getopts r: ii do case $ii in r) FLAG1=$ii; OARG1="$OPTARG";; # F) FLAG2=$ii; OARG2="$OPTARG";; ?) Usage; exit 2;; esac done shift ` expr $OPTIND - 1 ` #echo FLAG1 = $FLAG1 , OARG1 = $OARG1 if [ $# -lt 1 ]; then Usage exit fi hme=` echo $HOME | cut -f1 -d' ' ` if [ "$hme" = "" ]; then print "\nError: \$HOME is not set!!\n" exit fi bkextn=sedit_bak cur_dir=`pwd` #echo $cur_dir len=${#hme} len=$(($len + 2)) #echo $len subdir=` echo $cur_dir | cut -b $len-2000 ` #echo $subdir if [ "$subdir" = "" ]; then fdname=$1 else fdname=$subdir"/"$1 fi # If file is already checked out by another developer.... cvs_root=` echo $CVSROOT | cut -f1 -d' ' ` if [ "$cvs_root" = "" ]; then print "\nError: \$CVSROOT is not set!!\n" exit fi cldir=$CVSROOT/$subdir/Locks mkdir $cldir 2>/dev/null rcsfile=$CVSROOT/$subdir/$1,v #echo $rcsfile if [ ! -e $rcsfile ]; then print "\nError: File $1 does not exist in CVS repository!!\n" exit fi # Get the tip revision number of the file.... # Use tmpfile as the arg cannot be set inside the sub-shell tmpfile=$hme/sedit-lock.tmp \rm -f $tmpfile 2>/dev/null if [ "$FLAG1" = "" ]; then ( cd $hme cvs log $fdname | head -6 | grep head: | awk '{print $2}' > $tmpfile ) OARG1=`cat $tmpfile` \rm -f $tmpfile 2>/dev/null fi lockfile=$cldir/$1-$OARG1 #if [ -e $lockfile -a "$FLAG2" = "" ]; then if [ -e $lockfile ]; then print "\nError: File $1 Revision $OARG1 already locked by another developer !!" aa=` ls -l $lockfile | awk '{print "Locking developers unix login name is = " $3}' ` print $aa print "That developer should do scommit OR sunlock to release the lock" print " " # print "You can also use -F option to force edit the file even if" # print "the file is locked by another developer. But you must talk to" # print "other developer to work concurrently on this file." # print "For example - this option is useful if you work on a seperate" # print "C++ function in the file which does not interfere with other" # print "developer." # print " " exit fi # Get read-only copy now.... if [ ! -e $1 ]; then ( cd $hme cvs -r checkout $fdname 1>/dev/null ) fi # Check if file already exists.... if [ -f $1 ]; then user_perms=" " group_perms=" " other_perms=" " user_perms=`ls -l $1 | awk '{print $1 }' | cut -b3-3 ` group_perms=`ls -l $1 | awk '{print $1 }' | cut -b6-6 ` other_perms=`ls -l $1 | awk '{print $1 }' | cut -b9-9 ` if [ "$user_perms" = "w" -o "$group_perms" = "w" \ -o "$other_perms" = "w" ]; then print "\nError: The file is writable. Aborting $cmdname ......" print " You must backup, scommit or delete file and" print " try $cmdname again\n" exit fi #print "\nNote: The file $1 is read-only." #print "Hence I am moving it to $1.$bkextn ....\n" \mv -f $1 $1.$bkextn chmod 444 $1.$bkextn elif [ -d $1 ]; then print "\nError: $1 is a directory and NOT a file. Aborting $cmdname ....\n" exit fi # Create subshell print "\nNow getting the file $1 from CVS repository ...\n" ( cd $hme #echo $fdname # Use -A option to clear the sticky tag and to get # the HEAD revision version if [ "$FLAG1" = "" ]; then cvs -w checkout -A $fdname else cvs -w checkout -A -$FLAG1 $OARG1 $fdname fi ) if [ -e $1 ]; then touch $lockfile fi #pwd print "\nDone $cmdname" #print "\nTip (Usage): $cmdname <filename> \n" </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> scommit <label id="scommit"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program scommit # Program to commit the changes and check in the file into CVS cmdname=`basename $0` Usage() { print "\nUsage: $cmdname [-r revision_number] <filename>" print "The options -r are optional " print "For example - " print " $cmdname -r 1.1 foo.cpp" print " $cmdname foo.cpp " print " " } # Command getopt will not supported in next major release. # Use getopts instead. while getopts r: ii do case $ii in r) FLAG1=$ii; OARG1="$OPTARG";; ?) Usage; exit 2;; esac done shift ` expr $OPTIND - 1 ` #echo FLAG1 = $FLAG1 , OARG1 = $OARG1 if [ $# -lt 1 ]; then Usage exit 2 fi if [ -d $1 ]; then Usage exit 2 fi hme=` echo $HOME | cut -f1 -d' ' ` if [ "$hme" = "" ]; then print "\nError: \$HOME is not set!!\n" exit fi # Find sub-directory cur_dir=`pwd` #echo $cur_dir len=${#hme} len=$(($len + 2)) #echo $len subdir=` echo $cur_dir | cut -b $len-2000 ` #echo $subdir if [ "$subdir" = "" ]; then fdname=$1 else fdname=$subdir"/"$1 fi # If file is already checked out by another user.... cvs_root=` echo $CVSROOT | cut -f1 -d' ' ` if [ "$cvs_root" = "" ]; then print "\nError: \$CVSROOT is not set!!\n" exit fi cldir=$CVSROOT/$subdir/Locks mkdir $cldir 2>/dev/null # Get the working revision number of the file.... # Use tmpfile as the arg cannot be set inside the sub-shell tmpfile=$hme/sedit-lock.tmp \rm -f $tmpfile 2>/dev/null if [ "$FLAG1" = "" ]; then ( cd $hme cvs status $fdname 2>/dev/null | grep "Working revision:" | awk '{print $3}' >$tmpfile ) OARG1=`cat $tmpfile` \rm -f $tmpfile 2>/dev/null fi if [ "$OARG1" = "" ]; then print "The file $fdname is NEW, it is not in the CVS repository" else lockfile=$cldir/$1-$OARG1 if [ -e $lockfile ]; then # Check if this revision is owned by you... aa=` ls -l $lockfile | awk '{print $3}' ` userid=`id | cut -d'(' -f2 | cut -d')' -f1 ` if [ "$aa" != "$userid" ]; then print " " print "The file $fdname is NOT locked by you!!" print "It is locked by unix user name $aa and your login name is $userid" # print "If you are working concurrently with other developer" # print "and you used -F option with sedit." print "You need to wait untill other developer does scommit" print "or sunlock" print "Aborting the $cmdname ...." print " " exit 2 fi else if [ -f $CVSROOT/$subdir/$1,v ]; then print "You did not lock the file $fdname with sedit!!" print "Aborting the $cmdname ...." exit 2 else print "\nThe file $fdname does not exist in CVS repository yet!!" print "You should have done sadd on $fdname ...." fi fi fi if [ -d $1 ]; then Usage exit 2 # Do not allow directory commits for now ... #cvs commit else cvs commit $1 exit_status=$? fi if [ $exit_status -eq 0 ]; then print "\nDone $cmdname. $cmdname successful" #print "\nTip (Usage): $cmdname <filename/directory name>\n" fi </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> supdate <label id="supdate"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program supdate # Program to update the file from CVS read/write mode cmdname=`basename $0` if [ $# -lt 1 ]; then print "\nUsage: $cmdname <filename>" exit fi # Check if file already exists.... if [ $# -gt 0 -a -f $1 ]; then user_perms=" " group_perms=" " other_perms=" " user_perms=`ls -l $1 | awk '{print $1 }' | cut -b3-3 ` group_perms=`ls -l $1 | awk '{print $1 }' | cut -b6-6 ` other_perms=`ls -l $1 | awk '{print $1 }' | cut -b9-9 ` if [ "$user_perms" = "w" -o "$group_perms" = "w" \ -o "$other_perms" = "w" ]; then while : do print "\n$cmdname will backup your working file " print "$1 to $1.supdate_bak before doing any merges." print "Are you sure you want the merge the changes from" print -n "CVS repository to your working file ? <y/n> [n]: " read ans if [ "$ans" = "y" -o "$ans" = "Y" ]; then if [ -f $1.supdate_bak ]; then print "\nWarning : File $1.supdate_bak already exists!!" print "Please examine the file $1.supdate_bak and delete it" print "and than re-try this $cmdname " print "Aborting $cmdname ...." exit else cp $1 $1.supdate_bak break fi elif [ "$ans" = "n" -o "$ans" = "N" -o "$ans" = "" -o "$ans" = " " ]; then exit fi done fi fi if [ -d $1 ]; then print "\nDirectory update is disabled as cvs update" print "merges the changes from repository to your working directory" print "So give the filename to update - as shown below: " print " Usage: $cmdname <filename>" exit # cvs update else cvs update $1 fi print "\nDone $cmdname. $cmdname successful" #print "\nTip (Usage): $cmdname <filename/directory name>\n" </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sunlock <label id="sunlock"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx. <code> #!/bin/ksh # CVS program sunlock # Program to unlock the file to release the lock done by sedit cmdname=`basename $0` Usage() { print "\nUsage: $cmdname [-r revision_number] <filename>" print " The options -r is optional " print "For example - " print " $cmdname -r 1.1 foo.cpp" print " $cmdname foo.cpp " print " " } # Command getopt will not supported in next major release. # Use getopts instead. while getopts r: ii do case $ii in r) FLAG1=$ii; OARG1="$OPTARG";; ?) Usage; exit 2;; esac done shift ` expr $OPTIND - 1 ` if [ $# -lt 1 ]; then Usage exit fi hme=` echo $HOME | cut -f1 -d' ' ` if [ "$hme" = "" ]; then print "\nError: \$HOME is not set!!\n" exit fi cur_dir=`pwd` #echo $cur_dir len=${#hme} len=$(($len + 2)) #echo $len subdir=` echo $cur_dir | cut -b $len-2000 ` #echo $subdir if [ "$subdir" = "" ]; then fdname=$1 else fdname=$subdir"/"$1 fi # If file is already checked out by another user.... cvs_root=` echo $CVSROOT | cut -f1 -d' ' ` if [ "$cvs_root" = "" ]; then print "\nError: \$CVSROOT is not set!!\n" exit fi cldir=$CVSROOT/$subdir/Locks rcsfile=$CVSROOT/$subdir/$1,v #echo $rcsfile if [ ! -e $rcsfile ]; then print "\nError: File $1 does not exist in CVS repository!!\n" exit fi # Get the tip revision number of the file.... # Use tmpfile as the arg cannot be set inside the sub-shell tmpfile=$hme/sedit-lock.tmp \rm -f $tmpfile 2>/dev/null if [ "$FLAG1" = "" ]; then ( cd $hme cvs log $fdname | head -6 | grep head: | awk '{print $2}' > $tmpfile ) OARG1=`cat $tmpfile` \rm -f $tmpfile 2>/dev/null fi lockfile=$cldir/$1-$OARG1 #echo lockfile is : $lockfile if [ ! -e $lockfile ]; then print "\nFile $1 revision $OARG1 is NOT locked by anyone" print " " exit fi ans="" while : do print "\n\n***************************************************" print "WARNING: $cmdname will release lock and enable other" print " developers to edit the file. It is advisable" print " to save your changes with scommit command" print "***************************************************" print -n "\nAre you sure you want to unlock the file <y/n>? [n]: " read ans if [ "$ans" = "" -o "$ans" = " " -o "$ans" = "n" -o "$ans" = "N" ]; then print "\nAborting $cmdname ...." exit fi if [ "$ans" = "y" -o "$ans" = "Y" ]; then print "\n\n\n\n\n " print "CAUTION: You may lose all the changes made to file!!" print -n "Do you really want to unlock the file <y/n>? [n]: " read ans if [ "$ans" = "y" -o "$ans" = "Y" ]; then break else exit fi else print "\n\nWrong entry. Try again..." sleep 1 fi done if [ -e $lockfile ]; then \rm -f $lockfile print "\nDone $cmdname" else print "\nFile $1 is NOT locked by anyone" print " " fi </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> slist <label id="slist"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program slist # Program to list all edited source files from CVS #cmdname=`basename $0` #echo "no of params : " $# #echo "all args : " $@ recurse_flag="" if [ "$1" = "" ]; then dir=. recurse_flag="" else dir=$@ recurse_flag=" -prune " fi FOUT=slist_temporary_file.out \rm -f $FOUT find $dir $recurse_flag -type f -exec ls -ltr {} \; \ | grep -v "/CVS/" \ | grep ^\-rw \ | grep -v \\.o \ | grep -v \\.log \ | grep -v \\.out \ | grep -v \\.pid \ | awk '{ if ($NF != "tags") print $0 }' \ | awk '{ if ($NF != "a.out") print $0 }' \ | awk '{ if ($NF != "core") print $0 }' \ | awk '{ print $NF }' > $FOUT aa=`cat $FOUT` \rm -f $FOUT for ii in $aa ; do ftype=" " ftype=`file $ii | awk '{print $2 }' ` # find . -type f -exec file {} \; # 1)ELF 2)commands 3)[nt]roff, 4)c 5)English 6)executable # 7)ascii 8)current 9)empty # Binaries are ELF, lib.a are current # if [ "$ftype" = "ascii" -o "$ftype" = "commands" \ -o "$ftype" = "[nt]roff," -o "$ftype" = "c" -o "$ftype" = "data" \ -o "$ftype" = "English" -o "$ftype" = "executable" ]; then pcfile=` echo $ii | cut -d'.' -f1` pcfile=${pcfile}".pc" if [ ! -f $pcfile ]; then ls -l $ii else if [ "$ii" = "$pcfile" ]; then ls -l $ii fi fi fi done; #| grep -v ^\-rwx \ #ls -l | grep ^\-rw | grep -v \\.o #ls -l | grep ^\-rw | grep -v \\.o | awk '{ if ($NF != "tags") print $0 }' #ls -l | grep ^\-rw | grep -v ^\-rwx | grep -v \\.o | awk '{ if ($NF != "tags") print $0 }' | awk '{ if ($NF != "core") print $0 }' #print "\nDone $cmdname. $cmdname successful" #print "\nTip (Usage): $cmdname <filename>\n" </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sinfo <label id="sinfo"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program sinfo # Program to get the status of files in working directory cmdname=`basename $0` if [ $# -lt 1 ]; then print "\nUsage: $cmdname [file/directory name] " print "For example - " print " $cmdname foo.cpp" print " $cmdname some_directory " print " " exit fi hme=` echo $HOME | cut -f1 -d' ' ` if [ "$hme" = "" ]; then print "\nError: \$HOME is not set!!\n" exit fi tmpfile=$hme/cvs_sinfo.tmp rm -f $tmpfile cur_dir=`pwd` #echo $cur_dir len=${#hme} len=$(($len + 2)) #echo $len subdir=` echo $cur_dir | cut -b $len-2000 ` #echo $subdir if [ "$subdir" = "" ]; then fdname=$1 else fdname=$subdir"/"$1 fi # Create subshell if [ -f $1 ]; then ( cd $hme clear cvs status $fdname ) elif [ -d $1 ]; then ( cd $hme clear echo " " >> $tmpfile echo " ****************************************" >> $tmpfile echo " Overall Status of Directory" >> $tmpfile echo " ****************************************" >> $tmpfile cvs release $fdname 1>>$tmpfile 2>>$tmpfile << EOF Y EOF echo "\n -------------------------------\n" >> $tmpfile aa=`cat $tmpfile | grep ^"M " | awk '{print $2}' ` for ii in $aa do jj="(cd $hme; cvs status $subdir/$ii );" echo $jj | /bin/sh \ | grep -v Sticky | awk '{if (NF != 0) print $0}' \ 1>>$tmpfile 2>>$tmpfile done cat $tmpfile | grep -v ^? | grep -v "Are you sure you want to release" \ | less rm -f $tmpfile ) else print "\nArgument $1 if not a file or directory" exit fi </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> slog <label id="slog"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program slog # Program to list history of the file in CVS cmdname=`basename $0` if [ $# -lt 1 ]; then print "\nUsage: $cmdname <filename> \n" exit fi # Check if file does not exist.... if [ ! -f $1 ]; then print "\nError: $1 is NOT a file. Aborting $cmdname ......" exit fi cvs log $1 | /usr/local/bin/less print "\nDone $cmdname. $cmdname successful" #print "\nTip (Usage): $cmdname <filename>\n" </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sdif <label id="sdif"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program sdif # Program to see difference of the working file with CVS copy cmdname=`basename $0` Usage() { print "\nUsage: $cmdname <filename> " print "$cmdname -r<rev1> -r<rev2> <filename> \n" exit } FLAG1="" FLAG2="" OARG1="" OARG2="" # Command getopt will not supported in next major release. # Use getopts instead. while getopts r:r: ii do case $ii in r) if [ "$FLAG1" = "" ]; then FLAG1=$ii; OARG1="$OPTARG" else FLAG2=$ii; OARG2="$OPTARG" fi ;; ?) Usage; exit 2;; esac done shift ` expr $OPTIND - 1 ` if [ "$FLAG2" = "" ]; then FLAG2=r OARG2=HEAD fi if [ "$FLAG1" = "" ]; then cvs diff -r HEAD $1 | less else cvs diff -$FLAG1 $OARG1 -$FLAG2 $OARG2 $1 | less fi </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sadd <label id="sadd"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # test # CVS program sadd # Program to add the file to CVS cmdname=`basename $0` if [ $# -lt 1 ]; then print "\nUsage: $cmdname <filename/directory> \n" exit fi # Check if file exists .... if [ -f $1 ]; then cvs add $1 exit fi if [ ! -d $1 ]; then print "\nArgument $1 is not a file and not a directory!" print "Usage: $cmdname <filename/directory> \n" exit fi # Argument is a directory name ..... hme=` echo $HOME | cut -f1 -d' ' ` if [ "$hme" = "" ]; then print "\nError: \$HOME is not set!!\n" exit fi cur_dir=`pwd` len=${#hme} len=$(($len + 2)) subdir=` echo $cur_dir | cut -b $len-2000 ` if [ "$subdir" = "" ]; then if [ -d $CVSROOT/$1 ]; then print "\nDirectory $1 already exists in CVSROOT" exit else # You are adding at root directory $CVSROOT if [ "$2" = "" -o "$3" = "" ]; then print "\nUsage: $cmdname <directory> <vendor tag> <release tag>" print "For example - " print " $cmdname foo_directory V_1_0 R_1_0" exit else ( cd $1; cvs import $1 $2 $3 ) fi fi else # If current directory exists in CVS... if [ -d $CVSROOT/$subdir ]; then if [ -d $CVSROOT/$subdir/$1 ]; then print "\nDirectory $1 already in CVS repository!" else cvs add $1 fi else print "\nSub-directory $subdir does not exist in CVS" print "You need to first add $subdir to CVS" exit fi fi </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sdelete <label id="sdelete"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program sdelete # Program to delete the file from CVS cmdname=`basename $0` if [ $# -lt 1 ]; then print "\nUsage: $cmdname <filename> \n" exit fi # Check if file does not exist.... if [ ! -f $1 ]; then # Try to get the file from CVS sget $1 if [ ! -f $1 ]; then print "\nError: $1 does NOT exist in CVS repository. Aborting $cmdname ......" exit fi fi bkextn=cvs_sdelete_safety_backup \mv -f $1 $1.$bkextn cvs remove $1 print "\nsdelete command removes the file from CVS repository" print "and archives the file in CVS Attic directory. In case" print "you need this file in future than contact your CVS administrator" print " " print "\nDone $cmdname. $cmdname successful" #print "\nTip (Usage): $cmdname <filename>\n" \mv -f $1.$bkextn $1 </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> sfreeze <label id="sfreeze"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx <code> #!/bin/ksh # CVS program sfreeze # Program to freeze and cut out the release of source tree from CVS cmdname=`basename $0` Usage() { print "\nUsage: $cmdname symbolic_tag <directory name> " print "\nFor example :- " print " cd \$HOME" print " $cmdname REVISION_1 mesa" print "To see the list of revisons do -" print "slog <filename> and see the symbolic name and do -" print "cvs history -T" print "\nTo create a branch off-shoot from main trunk, use" print "the -b and -r options which makes the tag a branch tag. This is" print "useful for creating a patch to previously released software" print "For example :- " print " cd \$HOME" print " cvs rtag -b -r REVISION_1 REVISION_1_1 mesa" print " " # print "\nTag info is located at \$CVSROOT/CVSROOT/taginfo,v" # print "You can do - cd $HOME; sget CVSROOT" # print "to see this file" exit } # Command getopt will not supported in next major release. # Use getopts instead. #while getopts r: ii #do # case $ii in # r) FLAG1=$ii; OARG1="$OPTARG";; # ?) Usage; exit 2;; # esac #done #shift ` expr $OPTIND - 1 ` #echo FLAG1 = $FLAG1 , OARG1 = $OARG1 if [ $# -lt 2 ]; then Usage fi if [ ! -d $2 ]; then print "\nError: Second argument $2 is not a directory!" print " Aborting $cmdname...." print " " exit fi # cvs rtag symbolic_tag <directory name> cvs rtag $1 $2 print "\nDone $cmdname. $cmdname successful" </code> <!-- ******************************************* ************ End of Section *************** ******************************************* --> <sect1> saddtree <label id="saddtree"> <p> <bf>注意 : <it>Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产生</it></bf> 请把他存成一般文字档并改变存取权限 chmod a+rx。 <code> #!/bin/ksh ################################################################ # Sample Program to checkin a directory tree (let's say SAMP) into CVS # Note that if SAMP directory is not in CVS than you would use sadd # command and - # cd SAMP; cvs import SAMP V_1_0 R_1_0 # After running this program do - # cd $HOME/foo/SAMP # cvs import foo/SAMP V1_0 Rev_1_0 ################################################################ hme=` echo $HOME | cut -f1 -d' ' ` if [ "$hme" = "" ]; then print "\nError: \$HOME is not set!!\n" exit fi sampdir=$hme/foo/SAMP check_out_files() { # Now check out the files tmp2f=$hme/tmp2.baksamp.sh cd $hme \rm -rf foo/SAMP cvs -w checkout foo/SAMP cd $hme/foo find SAMP -type f -print > $tmp2f cd $hme for ii in `cat $tmp2f` do iidir=`dirname $ii` iifile=`basename $ii` if [ "$iifile" = "Root" -o "$iifile" = "Repository" -o "$iifile" = "Entries" ]; then continue fi jjdir=` echo $iidir | cut -d'/' -f2-1000 ` cp $hme/foo/SAMP.tobe/$jjdir/$iifile $hme/foo/$iidir/$iifile echo "cp $hme/foo/SAMP.tobe/$jjdir/$iifile $hme/foo/$iidir/$iifile " cvs add foo/$iidir/$iifile done print print "================================================" print " Now run cvs commit foo/SAMP" print " After commit. Do - " print " cd foo; rm -rf SAMP and " print " get fresh copy, sget SAMP" print " Verify with slog filename.samp to see new revision" print "================================================" print } check_out_files </code> <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt> CVS 的其他文件 <label id="CVS Documentation"> --> <sect> CVS 的其他文件 <label id="CVS Documentation"> <p> 在 unix 提示符号下,请打 - <enum> <item> cvs --help <item> cvs --help-options <item> cvs --help-commands <item> cvs -H checkout <item> cvs -H commit <item> man cvs <item> man tkcvs <item> 网站 <url url="http://www.cyclic.com"> <item> 网站 <url url="http://www.loria.fr/~molli/cvs-index.html"> <item> (译注:或者在 unix 提示符号下打 info cvs 也可得到一样的讯息) <item> (译注:这篇也不错简单明了) <url url="http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/cvs/"> </enum> tkcvs <url url="http://www.tkcvs.org"> 是 CVS 的 Tcl/Tk GUI 介面。这里也有线上求助。 <itemize> <item> cd $HOME/src/foo.cpp <item> tkcvs <item> 在 foo.cpp 上点一下 <item> 在 'spectacle Icon' 旁边的 'Revision Log Icon' 点一下。 <item> 这将会显示一个 Tree 组织的图在视窗里。然後在文字 '1.3' 上用滑鼠的右键点一下还有 '1.1' 滑鼠的左键点一下,然後再点一下 "Diff" 。这样将会显示两个视窗出来!! <item> 在 "Next" 上点一下将会显示更多版本'1.3' 与 '1.1' 的 diffs。 请按 "Center" 将文字对齐置中。 (译注:这边原文好像有脱误) </itemize> 这里也有 Windows 95 用的 CVS 喔,叫 WinCVS。 <url url="http://www.wincvs.org"> WinCVS 可以用在 Samba 系统上喔 - <url url="http://www.samba.org"> 基本重要的命令 - <itemize> <item> cvs checkout <filename > <item> cvs update <filename> <item> cvs add <file, ..> <item> cvs remove <file, ..> <item> cvs commit <file> <item> cvs status <filename> <item> cvs log <filename> <item> cvs diff -r1.4 -r1.5 <filename> 这行指令将会输出档案 filename 1.4 版和 1.5 版的差异在哪里。 </itemize> <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt> Emacs 编辑器 <label id="Emacs"> --> <sect> Emacs 编辑器 <label id="Emacs"> <p> Emacs 是非常强大的编辑器而且还支援了 CVS/RCS - 尤其是对於改版後的合并和比较。 Emacs的主要网站在 <url url="http://www.emacs.org">. <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt> 问题反应系统 (Problem Reporting System) <label id="PRS"> --> <sect> 问题反应系统 (Problem Reporting System) <label id="PRS"> <p> 伴随著 CVS 的使用,你可能会想要用计划追踪系统(Project Tracking system)或问题反应系统(Problem Reporting System)。每一个软体计划需要问题反应系统来作 bugs 的回报与追踪,并且把相关负责部分,分配给不同的程式设计师。 想知道计划追踪系统(Project Tracking system)请看这个网站 <url url="http://www.stonekeep.com">。 <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt change> 这份文件的其他档案格式 --> <sect> 这份文件的其他档案格式 <p> 这份文件用了将近 10 个不同的档案格式来发行 - DVI, Postscript, Latex, LyX, GNU-info, HTML, RTF(Rich Text Format), Plain-text, Unix man pages and SGML。 <itemize> <item> 你可以在下面的 Web 获得单一的 HTML, DVI, Postscript or SGML 型式的 tar.gz 档案, <url url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/"> 或者 <url url="ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/other-formats/"> <item>Plain text 格式的在: <url url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO">, 或者 <url url="ftp://metalab.unc.edu/pub/Linux/docs/HOWTO"> <item>翻译成其他国家语言像是法文,德文,西班牙文,中文,日文等等可在下面网址找得到。 <url url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO"> 或者 <url url="ftp://metalab.unc.edu/pub/Linux/docs/HOWTO"> 对於任何想翻译这份文件到其他语言是都欢迎的。 </itemize> 这份文件是用一种叫 "SGML" 的工具写成的。你可以从下列网址得到 - <url url="http://www.xs4all.nl/~cg/sgmltools/"> 编译原始码後,你就会得到下列命令,像是 <itemize> <item>sgml2html cvs-rcs-howto.sgml (产生 html 档案) <item>sgml2rtf cvs-rcs-howto.sgml (产生 RTF 档案) <item>sgml2latex cvs-rcs-howto.sgml (产生 latex 档案) </itemize> 这份文件是位於 - <itemize> <item> <url url="http://sunsite.unc.edu/LDP/HOWTO/CVS-RCS-HOWTO.html"> </itemize> 你也可以在下面映射网站找到这份文件 - <itemize> <item> <url url="http://www.caldera.com/LDP/HOWTO/CVS-RCS-HOWTO.html"> <item> <url url="http://www.WGS.com/LDP/HOWTO/CVS-RCS-HOWTO.html"> <item> <url url="http://www.cc.gatech.edu/linux/LDP/HOWTO/CVS-RCS-HOWTO.html"> <item> <url url="http://www.redhat.com/linux-info/ldp/HOWTO/CVS-RCS-HOWTO.html"> <item> 其他比较靠近你的映射网站 <url url="http://sunsite.unc.edu/LDP/hmirrors.html"> 选择其中一个网站并到这个目录 /LDP/HOWTO/CVS-RCS-HOWTO.html </itemize> 想看 dvi 格式的文件,请用 xdvi 。若原本没安装,可在 Redhat Linux 下的 tetex-xdvi*.rpm 套件中找得到。要不然可以经由桌面上的ControlPanel | Applications | Publishing | TeX menu buttons找到他。 <tscreen><verb> 想看 dvi 格式的文件,请下命令 - xdvi -geometry 80x90 howto.dvi, 并且用滑鼠调整视窗大小。请看 xdvi 的线上求助 man xdvi。 使用方向键, Page Up, Page Down 来检视文件。你也可以用 'f', 'd', 'u', 'c', 'l', 'r', 'p', 'n'来移动。 要关掉专家模式 menu 请按 x 。 </verb></tscreen> 你可以用软体 'gv' (ghostview) 或 'ghostscript' 来读 postscript 档案。 在 Redhat Linux 下,ghostscript 在 ghostscript*.rpm 套件里, gv 在 gv*.rpm 套件里, 如果你已经装了这个应用程式,可以透过 ControlPanel | Applications | Graphics menu 里找到, gv 是比 ghostscript 更友善使用。Ghostscript 和 gv 也可以在其他作业平台如 OS/2, windows 95 和 NT 下使用。 <tscreen><verb> 要读 postscript 文件,请下这个命令 - gv howto.ps 用 ghostscript 请打 - ghostscript howto.ps </verb></tscreen> 你可以用 Netscape Navigator, Microsoft Internet explorer, Redhat Baron Web browser 或其他浏览器来读 HTML 格式的文件。 你可以用一个 latex 的 "X-Windows" 介面软体叫做 LyX 的,来读 latex 或 LyX 的输出。 <!-- ******************************************* ************ End of Section *************** ******************************************* <chapt change> 版权 --> <sect> 版权 <p> 这份文件版权为 GNU GPL,但是请在所有的复制中保留原作者的名字与电子邮件地址。 <!-- ******************************************* ************ End of Section *************** ******************************************* --> </article>