分享
 
 
 

Using Subversion and ViewCVS on Solaris 10

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

Using Subversion and ViewCVS on Solaris 10

Author: Badcoffee

Email: blog.oliver@gmail.com

Date: Jan, 2005

Original Site: http://blog.csdn.net/yayong

CopyRight: Anyone refer to this article, must include author information and original site URL.

Summary

This article is a introduction that show you how to install and setup Subversion and ViewCVS's on Solaris 10.

It also give instructions about subversion usage for developer and gatekeeper (administrator). If you are a advanced

user, please refer to Subversion book for more details.

1. Subversion Setup

1.1 Install Subversion package

First, grab the pkg-get package file, from URL below:

http://www.blastwave.org/pkg_get.pkg

Install it with

pkgadd -d pkg_get.pkg

Then, make sure can find /usr/sfw/bin/wget command.

At last, maybe modify /opt/csw/etc/pkg-get.conf file for proxy setting:

ftp_proxy=http://proxy_server:port

http_proxy=http://proxy_server:port

export http_proxy ftp_proxy

Set envirment in /etc/profile:

PATH=/opt/csw/bin:$PATH;

SVN_EDITOR=/usr/bin/vi

export SVN_EDITOR

export PATH

Install Subversion package pkg-get -i subversion

For python and apache2 support:

pkg-get -i pysvn

pkg-get -i ap2_subversion

1.2 Running a Subversion Server

Create system account:

groupadd svn

useradd -c "SVN Owner" -d /export/home/svn -g svn svn

mkdir /export/home/svn

chown svn:svn /export/home/svn

chmod g+w /export/home/svn

Creat repository for project

svnadmin create --fs-type fsfs /export/home/svn/[project name]

Import source code into repository:

cd [/path/to/source/tree]

svn import file:///export/home/svn/[project name]

Setting access policy of repository:

vi /export/home/svn/[project name]/conf/svnserve.conf

[general]

anon-access = read

auth-access = write

password-db = passwd.conf

realm = /[project name]

Create passwd database:

/export/home/svn/[project name]/conf/passwd.conf

[users]

username1 = passwd1

.......

Setting right access permission for subversion server:

chown -R svn:svn /export/home/svn/[project name]

chmod -R g+w /export/home/svn/[project name]

chmod g+s /export/home/svn/[project name]/db

Configure the subversion service: Create the start script when system boot:

vi /etc/rc2.d/S98svnserve

su - svn -c "/opt/csw/bin/svnserve -d -r /export/home/svn&"

chmod +x /etc/rc2.d/S98svnserve

Start subversion service:

/etc/rc2.d/S98svnserve

Check out source code to verify subversion service works correctly

svn checkout svn://[hostname]/[project name]

2. ViewCVS Setup

2.1 Install ViewCVS package

Install python package pkg-get -i python

Install viewcvs package

./viewcvs-install

Note: Before your installation, you can refer to INSTALL file in ViewCVS package.

Currently, only ViewCVS 1.0 can support subversion, but this version is under development.

You can get ViewCVS 1.0 dev version from ViewCVS site.

install enscript package pkg-get -i enscript

install gnudiff pkg-get -i diffutils

cp /opt/csw/bin/gdiff* /usr/bin/

2.2 Runing viewcvs with Apache server

Configure viewcvs with subversion vi /usr/local/viewcvs-1.0-dev/viewcvs.conf

#cvs_roots = cvs: /home/cvsroot

svn_roots = [project name]: /export/home/svn/[project name]

svn_parent_path = /export/home/svn

default_root = [project name]

use_enscript = 1

enscript_path = /opt/csw/bin/

import subverion python moudle into python # python

Python 2.3.4 (#3, Nov 10 2004, 12:43:17) [C] on sunos5

Type "help", "copyright", "credits" or "license" for more information.

>>> import svn.repos

Start viewcvs web service cp -f /usr/local/viewcvs-1.0-dev/www/cgi/* /var/apache2/cgi-bin/

vi /var/apache2/htdocs/index.html

<SCRIPT LANGUAGE="JavaScript">

location="/cgi-bin/viewcvs.cgi"

</SCRIPT>

cp -f /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf

pkill -9 httpd

svcadm enable svc:/network/http:apache2

You can access your project site from URL: http://[hostname]

3. ViewCVS Setup

3.1. For developer

* Install a subverion client

Please see section 1.1 above.

* start work with subversion

Get project URL of subversion server from gatekeeper

Check out source code:

svn checkout -r [version name] svn://[hostname]/[project name]

After check out, a local work directory is created, you can do following things:

Check recent change log anytime:

svn log

Update your local work copy to a specified version:

svn update -r [version name]

Check local work dir status, compare them with server side:

svn status

Diff a file current version with specified version

svn diff -r [version name] [file name]

Add a new dir

svn mkdir [dir name]

Add a new file

svn add [file name]

Of course, you can modify a existed file anytime.

When a change is occurred, don't forget commit your change:

svn commit

* Get Help for command:

svn help

* Get a certain release of project?

Need know realse name first.

Switch local work dir to a certain branch, tag and release:

svn switch svn://[hostname]/[project name]/tags/[tag name or release name]

3.2. For gatekeeper * Create repository for a new project and setting access policy of repository

Create repository for a new project

svnadmin create --fs-type fsfs /export/home/svn/[project name]

Import source code into repository:

cd [/path/to/source/tree]

svn import file:///export/home/svn/[project name]

Set access policy of repository:

vi /export/home/svn/[project name]/conf/svnserve.conf

[general]

anon-access = read

auth-access = write

password-db = passwd.conf

realm = /[project name]

Create user password database:

vi /export/home/svn/[project name]/conf/passwd.conf

[users]

username1 = passwd1

.......

Setting access permission for subversion server:

chown -R svn:svn /export/home/svn/[project name]

chmod -R g+w /export/home/svn/[project name]

chmod g+s /export/home/svn/[project name]/db

* Create new tag or branch for project

svn mkdir -m "[comment]" svn://[hostname]/[project name]/tags

svn copy -m "[comment]" [local work copy dir] svn://[hostname]/[project name]/tags/[tag name]

* Create hook scripts for project

Enter hook dir on subverion server:

cd /export/home/svn/[project name]/hooks

Change the *.tmpl file to a executable script, take post-commit.tmpl for example:

cp post-commit.tmpl post-commit

chown svn:svn post-commit

chmod 754 post-commit

Customize post-commit to invoke your own commands, please refer to sample script below:

#!/bin/sh

REPOS="$1"

REV="$2"

SVNLOOK=/opt/csw/bin/svnlook

CONTENT=/tmp/mail_content.$$

echo "Event: putback-to" >> $CONTENT

echo "Repository: $REPOS" >> $CONTENT

echo "Reversion: $REV" >> $CONTENT

CHANGED=`$SVNLOOK changed -r $REV $REPOS`

AUTHOR=`$SVNLOOK author -r $REV $REPOS`

DATE=`$SVNLOOK date -r $REV $REPOS`

LOG=`$SVNLOOK log -r $REV $REPOS`

echo "User: $AUTHOR" >> $CONTENT

echo "Date: $DATE\n\n" >> $CONTENT

echo "Files:\n$CHANGED\n" >> $CONTENT

echo "Comments:\n$LOG\n" >> $CONTENT

mailx -s "Code change notification mail" -r $AUTHOR@[domain.com][mail list address]< $CONTENT

4. Related resource

Subversion book

ViewCVS site

Solaris 上的开发环境安装及设置

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有