• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            牽牛散步
            仗劍走天涯

            一、安裝

            1 linux 安裝好后已經裝好了 cvs ,可用 rpm -qa|grep cvs 查看。

            如果沒有安裝你可以在 Redhat 2 張光盤上找到,另外你也可以在網上下載到最新的 rpm 包。很容易找,其實不存在什么 linux 版本。

            ?

            2 、創建 cvs 使用的目錄: mkdir /home/mycvstest

            ?

            3 、創建 cvs 使用的用戶和組

            groupadd cvs

            useradd -g cvs -G cvs –d /home/mycvstest cvs

            passwd cvs

            ?

            4 、修改 mycvstest 的用戶: chown -R cvs:cvs /home/mycvstest

            ??????????????????????? chmod 755 /home/mycvstest

            ?

            5 、切換用戶: su cvs

            ?

            6 、創建源碼倉庫: mkdir /home/mycvstest/drcls drclgw

            ?

            7 、初始化源碼倉庫: cvs -d /home/mycvstest/drcls init

            ?????????????????? cvs -d /home/mycvstest/drclgw init

            ??????????????? ???chmod 755 /home/mycvstest/drcls drclgw

            初始化后可以在目錄下見到新增加的 CVSROOT 目錄, cvs 所有的控制信息都在這個目錄里。

            ?

            8 、退回到 root 用戶,建立 CVS 服務啟動文件, CVS 使用 xinetd 方式啟動。 ?

            ?

            vi /etc/xinetd.d/cvspserver

            ?

            service cvspserver

            {

            disable = no

            flags = REUSE

            socket_type = stream

            wait = no

            user = root

            server= /usr/bin/cvs

            server_args= -f --allow-root=/home/mycvstest/drcls

            --allow-root=/home/mycvstest/drclgw pserver

            log_on_failure += USERID

            }

            ?

            注:紅色的參數很重要,由于 xinetd server_args 長度限制 , 當你想運行很多的單個倉庫的時候 ( 就是有很多個模塊時,比如 drcrgw), 但在 server_args 中無法輸入這么多單個的倉庫, 可以采取以下方式解決(現在實驗室 90 上就用的這種方式):

            ?

            #> vi cvspserver

            ?

            service cvspserver

            {

            ??????? disable = no

            ??????? socket_type = stream

            ??????? wait = no

            ??????? user = root

            ??????? server = /usr/bin/cvs.run

            ??????? server_args =""

            }

            編寫 cvs.run 腳本

            vi /cvsroot/cvs.run

            #!/bin/bash

            /usr/bin/cvs -f

            --allow-root=/home/mycvstest/drcls

            --allow-root= /home/mycvstest/drclgw

            pserver

            ?

            chmod a+x cvs.run

            ?

            9 、加入 cvs 服務:

            ?

            #>vi /etc/services

            ?

            cvspserver 2401/tcp #pserver cvs service

            cvspserver 2401/udp #pserver cvs service

            ?

            10 、啟動 cvs 服務:

            ?

            #> service xinetd restart

            ?

            11 、檢查 cvspserver 服務是否已經啟動:

            ?

            #> netstat -l |grep cvspserver

            應該有如下結果:

            tcp 0 0 *:cvspserver *:* LISTEN

            ?

            ?

            二、使用和管理

            1 、創建 cvs 用戶:

            cd /home/mycvstest/drcls/CVSROOT

            htpasswd –c passwd zhangcan (htpasswd 命令要安裝 apache 后才有,此命令創建一個 passwd 文件,里面內容為新建 cvs 用戶的用戶名和密碼 )

            vi passwd ( 在新建的用戶后手工加入用戶屬于的組 cvs)

            例如: zhangcan:dgeagasdgasdr:cvs? 藍色字符串表示加密后的密碼。

            ?

            2 、賦予用戶讀寫權限

            手工在 CVSROOT 目錄中建立 readers writers 文件。 Readers 文件中的用戶只有讀權限, writers 中的用戶具有讀寫權限,一行只寫一個用戶名。

            ?

            3 、登錄 cvs

            在客戶機 Linux 下面用命令:

            export CVSROOT=:pserver:zhangcan@192.168.100.197:/home/mycvstest/drcls

            cvs login

            ?

            4 、向源碼倉庫中導入源碼

            首先進入你本機上安裝源碼的目錄,然后使用以下命令:

            cvs import –m “this is my soure code” drcls NISEC test start

            -m 表示在 cvs 歷史文件顯示的消息, drclst 為你指定的源碼目錄名, NISEC 為供應商標簽, test 為發行標簽(這兩項可以不要), start 必須要。

            ?

            5 checkout 出需要修改的源代碼

            cvs co drcls? 在你的當前目錄下會發現多了一個 drcls 目錄,要修改的源碼都在里面

            co checkout 的簡寫

            ?

            6 、提交修改

            假設剛才對 readme 文件進行了修改,現在提交

            cvs commit –m “modify a few of wrong words”? readme

            命令執行后會提示版本已經改為 1.2

            ?

            7 checkout 出以前的版本

            如果想檢出以前的版本可以用以下命令:

            cvs co –r 1.1 drcls/readme 或者 cvs –D yesterday drcls/readme

            ?

            8 、刪除文件

            若想從源碼倉庫中刪除 readme 文件,首先應把客戶機工作目錄中的 readme 文件刪除,然后使用 cvs 的刪除命令,最后提交刪除,流程如下:

            rm readme

            cvs rm readme

            cvs commit –m “ 現在不需要這個 readme 文件 ? readme

            如果系統類似錯誤: cannot remove file `INSTALL' which has a numeric sticky tag of `1.1'

            可以用命令 cvs update –A readme 后再刪除文件。


            以上為火山哥提供的,以下是我添加的部份:
            1.在reader和writes文件中添加使用用戶時要注意,當在reader中添加了某一只讀用戶后就不要在writers中添加此用戶,如果在兩個文件中都添加同一用戶的話,在使用cvs時,CVS服務器會把此用戶當做只讀用戶看待,當使用一些命令如import時會產生權限問題,以下是linux關于此問題的說明:
            /* This command has the potential to modify the repository, so
            ? ?* we check if the user have permission to do that.
            ? ?*
            ? ?* (Only relevant for remote users -- local users can do
            ? ?* whatever normal Unix file permissions allow them to do.)
            ? ?*
            ? ?* The decision method:
            ? ?*
            ? ?*? ? If $CVSROOT/CVSADMROOT_READERS exists and user is listed
            ? ?*? ? in it, then read-only access for user.
            ? ?*
            ? ?*? ? Or if $CVSROOT/CVSADMROOT_WRITERS exists and user NOT
            ? ?*? ? listed in it, then also read-only access for user.
            ? ?*
            ? ?*? ? Else read-write access for user.
            ? ?*/

            posted on 2006-11-28 16:18 牽牛散步 閱讀(2031) 評論(3)  編輯 收藏 引用 所屬分類: C++學習資料
            Comments
            • # re: CVS服務器的相關配置及使用[ Server of CVS Configure and Usage for linux]
              canyon
              Posted @ 2006-11-29 11:46
              寫的太好了,不頂不行啊!  回復  更多評論   
            • # re: CVS服務器的相關配置及使用[ Server of CVS Configure and Usage for linux]---注,此教程是"火山哥"提供的:-)[未登錄]
              牽牛散步
              Posted @ 2007-07-09 13:14
              項目中添加二進制文件進CVS倉庫需要注意:
              添加文件 創建好新文件后,比如:touch new_file cvs add new_file 注意:對于圖片,Word文檔等非純文本的項目,需要使用cvs add -kb選項按2進制文件方式導入(k表示擴展選項,b表示binary),否則有可能出現文件被破壞的情況 比如: cvs add -kb new_file.gif cvs add -kb readme.doc  回復  更多評論   
            • # re: CVS服務器的相關配置及使用[ Server of CVS Configure and Usage for linux]---注,此教程是"火山哥"提供的:-)[未登錄]
              豬豬
              Posted @ 2007-10-15 11:26
              謝謝,剛好遇到了下面這個問題,很受用。
              如果系統類似錯誤: cannot remove file `INSTALL' which has a numeric sticky tag of `1.1'   回復  更多評論   
             
            精品国产乱码久久久久久郑州公司 | 国产一级持黄大片99久久| 伊人久久综合精品无码AV专区| 亚洲色欲久久久综合网| 精品久久一区二区三区| 久久亚洲色一区二区三区| 亚洲狠狠婷婷综合久久久久| 99久久精品国产麻豆| 久久久99精品一区二区| 亚洲综合伊人久久大杳蕉| 久久99中文字幕久久| 久久无码AV中文出轨人妻| 2020久久精品国产免费| 伊人久久国产免费观看视频 | 伊人久久五月天| 日韩精品国产自在久久现线拍| 久久99久国产麻精品66| 日本久久久久久中文字幕| 欧美午夜精品久久久久免费视| 99久久精品九九亚洲精品| 国产69精品久久久久久人妻精品| 国产福利电影一区二区三区久久久久成人精品综合 | 人人狠狠综合久久88成人| 国产精品99久久精品爆乳| 久久久久久亚洲精品成人| 一级a性色生活片久久无少妇一级婬片免费放| 无码国产69精品久久久久网站| 色婷婷久久久SWAG精品| 中文字幕亚洲综合久久2| 久久精品国产亚洲77777| 久久精品国产亚洲αv忘忧草| 91精品国产91久久| 久久精品国产一区| 99久久人妻无码精品系列| 久久人人爽人人爽人人片AV不 | 久久久精品人妻无码专区不卡| www.久久99| 伊人久久精品线影院| 亚洲国产精品久久久久| 亚洲国产精品久久久久婷婷软件| 韩国无遮挡三级久久|