[NLUUG]   Welcome to ftp.nluug.nl
Current directory: /pub/FreeBSD/development/CVS-archive/exporter/
 
Current bandwidth utilization 2161.94 Mbit/s
Bandwidth utilization bar
Contents of README:
Brain dump. - peter@

The theory is simple enough.

Cron periodically runs run.sh under a lock / log

run.sh calls driver.sh for each exported branch with paths paths to svn and cvs checkouts.

driver.sh does:
while (svn checkout isn't top-of-tree)
 svn checkout "next rev on branch"
 compare file lists
 cvs add new files
 cvs rm old fles
 compare/copy/spam common files
 cvs commit (entire tree)
 if (number of commits > 10, stop)
}

The Fake-CVSROOT is special.  The real CVSROOT in /home/ncvs does not allow commits.
Fake-CVSROOT DOES allow commits and has $FreeBSD$ expansion turned off.  (This is so
that a copy of the svn co files will preserve $FreeBSD$).

Fake-CVSROOT/src -> ncvs/src and so on.

To set up a new exported branch..

cvs co -b RELENG_FOO into exportcvs/src.RELENG_FOO
(add RELENG_FOO to Fake-CVSROOT/val-tags if required)
svn co info svnco/base/stable/FOO
add mapping lines to run.sh
stand back

There is a very specific and hard limit to the number of branches.  The working set of
all branches (both svn + cvs) plus the cvs repository ,v files has to fit in ram.

There was roughly a 100x slowdown if disks were being thrashed due to working set
exceeding ram size.

To **force** a resync:
touch exportcvs/src.RELENG_FOO/force-commit


Script started on Fri May 30 03:08:57 2014
root@repoman2:/local/svnexp # ls -l
total 16321
-rw-------  1 svnexp  svnexp      89 May 21 03:36 .lesshst
drwxr-xr-x  3 svnexp  svnexp       6 Nov 17  2012 .subversion
drwxr-xr-x  3 svnexp  svnexp       6 Dec 31  2012 Fake-CVSROOT
drwxr-xr-x  2 svnexp  svnexp       5 Nov 28  2012 RCS
-rw-r--r--  1 svnexp  svnexp    1303 May 30 03:08 README
-rwxr-xr-x  1 svnexp  svnexp     516 Apr  2 21:44 deprecated.src
drwxrwxr-x  4 svnexp  svnexp       4 Dec 31  2012 distrib
-rw-r--r--  1 svnexp  svnexp    4269 May 21 04:12 driver.sh
-rw-r--r--  1 svnexp  svnexp    4151 May 21 04:12 driver.sh.old
-rw-r--r--  1 svnexp  svnexp    4183 May 21 04:12 driver84.sh
drwxr-xr-x  7 svnexp  svnexp       7 May 21 03:53 exportcvs
drwxrwxr-x  5 svnexp  svnexp       5 Dec 31  2012 lockdir
-rwxr-xr-x  1 svnexp  svnexp     232 Nov 28  2012 logrotate.sh
drwxr-xr-x  5 svnexp  svnexp       5 Nov 16  2012 real-checkout
-rw-r--r--  1 svnexp  svnexp   54871 May 21 03:02 run.log
-rw-r--r--  1 svnexp  svnexp  438246 May 21 00:00 run.log.1
-rw-r--r--  1 svnexp  svnexp  442607 May 12 00:00 run.log.10
-rw-r--r--  1 svnexp  svnexp  453808 May 11 00:00 run.log.11
-rw-r--r--  1 svnexp  svnexp  501645 May 10 00:00 run.log.12
-rw-r--r--  1 svnexp  svnexp  492019 May  9 00:00 run.log.13
-rw-r--r--  1 svnexp  svnexp  520225 May  8 00:00 run.log.14
-rw-r--r--  1 svnexp  svnexp  443307 May  7 00:00 run.log.15
-rw-r--r--  1 svnexp  svnexp  443860 May  6 00:00 run.log.16
-rw-r--r--  1 svnexp  svnexp  447129 May  5 00:00 run.log.17
-rw-r--r--  1 svnexp  svnexp  445379 May  4 00:00 run.log.18
-rw-r--r--  1 svnexp  svnexp  450337 May  3 00:00 run.log.19
-rw-r--r--  1 svnexp  svnexp  451442 May 20 00:00 run.log.2
-rw-r--r--  1 svnexp  svnexp  436482 May  2 00:00 run.log.20
-rw-r--r--  1 svnexp  svnexp  603897 May  1 00:00 run.log.21
-rw-r--r--  1 svnexp  svnexp  444861 Apr 30 00:00 run.log.22
-rw-r--r--  1 svnexp  svnexp  458264 Apr 29 00:00 run.log.23
-rw-r--r--  1 svnexp  svnexp  435288 Apr 28 00:00 run.log.24
-rw-r--r--  1 svnexp  svnexp  440862 Apr 27 00:00 run.log.25
-rw-r--r--  1 svnexp  svnexp  455199 Apr 26 00:00 run.log.26
-rw-r--r--  1 svnexp  svnexp  447332 Apr 25 00:00 run.log.27
-rw-r--r--  1 svnexp  svnexp  448027 Apr 24 00:00 run.log.28
-rw-r--r--  1 svnexp  svnexp  455250 Apr 23 00:00 run.log.29
-rw-r--r--  1 svnexp  svnexp  448496 May 19 00:00 run.log.3
-rw-r--r--  1 svnexp  svnexp  452384 Apr 22 00:00 run.log.30
-rw-r--r--  1 svnexp  svnexp  445084 Apr 21 00:00 run.log.31
-rw-r--r--  1 svnexp  svnexp  461754 May 18 00:00 run.log.4
-rw-r--r--  1 svnexp  svnexp  465230 May 17 00:00 run.log.5
-rw-r--r--  1 svnexp  svnexp  468016 May 16 00:00 run.log.6
-rw-r--r--  1 svnexp  svnexp  537767 May 15 00:00 run.log.7
-rw-r--r--  1 svnexp  svnexp  507206 May 14 00:00 run.log.8
-rw-r--r--  1 svnexp  svnexp  455276 May 13 00:00 run.log.9
-rwxr-xr-x  1 svnexp  svnexp     509 Apr  2 21:42 run.sh
drwxr-xr-x  3 svnexp  svnexp       3 Nov 28  2012 spam
drwxrwxr-x  3 svnexp  svnexp       3 Mar 28  2013 svnco
drwxr-xr-x  2 svnexp  svnexp      14 Nov 28  2012 tmp
drwxr-xr-x  4 svnexp  svnexp       4 Apr  7  2013 vuxml

root@repoman2:/local/svnexp # ls -l Fake-CVSROOT/
total 5
drwxrwxr-x  3 svnexp  svnexp  40 Nov 18  2012 CVSROOT
lrwxr-xr-x  1 svnexp  svnexp  18 Dec 31  2012 distrib -> ../../ncvs/distrib
lrwxr-xr-x  1 svnexp  svnexp  16 Nov 16  2012 ports -> ../../ncvs/ports
lrwxr-xr-x  1 svnexp  svnexp  14 Nov 16  2012 src -> ../../ncvs/src

root@repoman2:/local/svnexp # ls -l ../ncvs
total 16
drwxrwxr-x   3 svnexp  svnexp  44 Jan  3  2013 CVSROOT
drwxrwxr-x   3 svnexp  svnexp   3 May 19  2007 distrib
drwxrwxr-x   2 svnexp  svnexp   3 May 28 00:24 doc
drwxrwxr-x   2 svnexp  svnexp   3 May 28 00:24 ports
drwxrwxr-x   2 svnexp  svnexp   3 May 28 00:38 projects
drwxrwxr-x  28 svnexp  svnexp  29 May 30 02:50 src
drwxrwxr-x   2 svnexp  svnexp   3 May 28 00:40 www
root@repoman2:/local/svnexp # exit

Script done on Fri May 30 03:09:21 2014

Captured cron:

#* * * * *	/usr/bin/lockf -s -t 0 /local/svnexp/run.lock /bin/sh -c "/local/svnexp/run.sh >> /local/svnexp/run.log 2>&1"
#0 0 * * *	/local/svnexp/logrotate.sh
# once an hour
#1 * * * *	touch /local/svnexp/src.RELENG_9.RUN
#6 * * * *	touch /local/svnexp/src.RELENG_9_1.RUN
#21 * * * *	touch /local/svnexp/src.RELENG_8.RUN
#45 * * * *	touch /local/svnexp/src.RELENG_8_4.RUN

Directory structure:
peter@repoman2:/local/svnexp % ls -l svnco/
total 2
drwxr-xr-x  4 svnexp  svnexp  4 Apr  3 15:55 base
peter@repoman2:/local/svnexp % ls -l svnco/base/
total 4
drwxr-xr-x  5 svnexp  svnexp  5 Apr  3 15:52 releng
drwxr-xr-x  4 svnexp  svnexp  4 Mar 28  2013 stable
peter@repoman2:/local/svnexp % ls -l svnco/base/stable/
total 6
drwxr-xr-x  23 svnexp  svnexp  31 Mar 23 14:21 8
drwxr-xr-x  23 svnexp  svnexp  32 May 11 21:01 9
peter@repoman2:/local/svnexp % ls -l exportcvs/
total 16
drwxr-xr-x   3 svnexp  svnexp  15 Nov 17  2012 CVSROOT
drwxrwxr-x  27 svnexp  svnexp  35 May 21 03:53 src.RELENG_8
drwxr-xr-x  27 svnexp  svnexp  35 May 21 03:58 src.RELENG_8_4
drwxrwxr-x  27 svnexp  svnexp  36 May 21 03:59 src.RELENG_9
drwxrwxr-x  27 svnexp  svnexp  36 May 21 04:00 src.RELENG_9_1

:q!
peter@repoman2:/local/svnexp % ls svnco/base/stable/8
COPYRIGHT               Makefile.inc1           bin                     etc                     kerberos5               rescue                  sys
LOCKS                   ObsoleteFiles.inc       cddl                    games                   lib                     sbin                    tools
MAINTAINERS             README                  contrib                 gnu                     libexec                 secure                  usr.bin
Makefile                UPDATING                crypto                  include                 release                 share                   usr.sbin


Icon  Name                                  Last modified      Size  
[DIR] Parent Directory - [TXT] README 30-May-2014 05:13 6.9K [   ] deprecated.src 30-May-2014 05:13 516 [   ] driver.sh 30-May-2014 05:13 4.2K [   ] run.sh 30-May-2014 05:13 509

NLUUG - Open Systems. Open Standards
Become a member and get discounts on conferences and more, see the NLUUG website!