Monday, October 19, 2015

upgrade svn subversion 1.8 on CentOS 7

Remove the previous installed subversion:

# yum remove subversion

# yum remove subversion-libs

Add a new yum repository:

# vim /etc/yum.repos.d/wandisco-svn.repo

[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/7/svn-1.8/RPMS/$basearch/
enabled=1
gpgcheck=0

Clean up the cache:

# yum clean all

Install subversion:

# yum install subversion

Check svn version:

# svn --version

svn, version 1.8.11 (r1643975)
   compiled Jan 30 2015, 13:21:57 on x86_64-redhat-linux-gnu

Disable the yum repository:

# vim /etc/yum.repos.d/wandisco-svn.repo

enabled=0

Let svn command add the utf-8 encoding parameter automatically:

# mv /bin/svn /bin/svn.orig

# touch /bin/svn

# chmod 755 /bin/svn

# vim /bin/svn

#!/bin/sh

### initialize
svnarg=""

### use encoding utf-8 as default if run "svn ci" or "svn commit".
if [ "$1" != "help" ]; then
  for myarg in "$@"; do
    if [ "${myarg}" = "commit" ] || [ "${myarg}" = "ci" ]; then
      svnarg="--encoding utf-8"
      break
    fi
  done
fi

### wrapper script to set umask to 027 on subversion binaries
### Note: the meaning of each umask:
### umask 0002 // File permission 644. Owner can read/write. Group and Others can only read.
### umask 0007 // File permission 660. Owner and Group can read/write. Others can not read or write.
### umask 0027 // File permission 640. Owner can read/write. Group can read. Others can not read or write.
umask 0027

### svn command
/bin/svn.orig ${svnarg} "$@"

Setting up svn server:

# mkdir /home/srv/svn_repos
# cd /home/srv/svn_repos

# svnadmin create test
# cd test

# vim conf/svnserve.conf

anon-access = none
auth-access = write
password-db = passwd

# vim conf/passwd

[users]
myname = mypass

# /bin/svnserve -d --listen-port=3690 -r /home/srv/svn_repos

# ss -an | grep :3690

tcp    LISTEN     0      7                      *:3690                  *:*

No comments: