[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn as change management toos?

From: Lieven Govaerts <lgo_at_mobsol.be>
Date: 2005-09-16 14:06:09 CEST

We use something similar here for the hook scripts of our repositories, our
structure is:
http://repo/branch/[hostname]/svn/hooks/
                                        common/
                                        repo1/
                                        repo2/

In the hook scripts on that host, we have a simple bash script that
allows us to export the hook scripts for a specific repository. It
works like this:
1. Check if the common folder for this host contains files
2. If yes, export these files to repo/hooks
3. Check if there is a specific folder for this host
4. If yes, export these files also to repo/hooks

We use export instead of checkout to avoid the .svn folder.
------------------------
TOREPO="repo1"
HOSTNAME=`hostname`
REPOBASE="http://repo/branch/$HOSTNAME/svn/hooks/"

# first export the common hook scripts, redirect errors to /dev/null
# ( folders may not exist in the repo )
svn ls $REPOBASE | grep common > /dev/null
if [ $? = 0 ]; then
    info "Exporting common folder to $TOREPO"
        svn export $REPOBASE/common ./$TOREPO/hooks --force -q
else
        info "No specific folder for $TOREPO found in repository."
fi

# then export the custom scripts for this repository
svn ls $REPOBASE | grep $TOREPO > /dev/null
if [ $? = 0 ]; then
    info "Exporting specific folder for $REPO to $TOREPO"
        svn export $REPOBASE/$TOREPO ./$TOREPO/hooks --force -q
else
        info "No specific folder for $TOREPO found in repository."
fi
--------------------------

Local changes are lost at each run of the script. You can always
backup the other file first.

Lieven.

Citeren "Langjahr, Uwe" <uwe.langjahr@hp.com>:

> Hello,
> I thing this is a newbie question?
> I want use subversion (svn) to maintain host configuration files
> (e.g. /etc/hosts) under a perspective of change management to
> track the changes in this files.
> If I put this files under version control and check-in them after a
> modification, I can use the logging as documentation, fine. I know who
> to
> implement this with svn.
>
> But in my example scenario:
> - several unix host (e.g: 10)
> - each system has the same /etc/nsswich.conf
> I want to share this file over all system and use svn as rollout tool
> (Modify, check-in, check-out on all hosts)
> - each system has an individual /etc/hosts
> Every file from every system should be under control.
>
> I was able to implement this scenario with svn in the
> following directory structure:
> common:
> /etc/nsswitch.conf
> /etc/hosts (a master example)
> specific:
> hostA:
> /etc/hosts
> hostB:
> /etc/hosts
>
> To setup the workcopy (wc), I have done the following logical steps:
> 1.) svn checkout .../common to /etc (wc)
> 2.) svn copy .../common/etc/hosts .../specific/hostA/etc/hosts
> 3.) svn switch /etc/hosts .../specific/hostA/etc/hosts
> 4.) Edit /etc/hosts, check-in, check-out works fine, this changes has
> only influence to this host
> 5.) Edit /etc/nsswitch.conf, check-in, check-out on other hosts reflect
> the change on every host, fine.
> (Sorry, I have done all this steps with TortoiseSVN, so the list above
> is
> a logical sequence and hope this reflect my steps).
>
> My main questions:
> - Is this a good way to implement my requirement.
> It's a complex setup and I need a concept who to organize the
> repository.
> - Has somebody a better/easier way/idea to implement the scenario
> - If I loose the svn meta-directory (.svn), I must know, that I
> first have to checkout the common tree and than "overlay" the
> specific host with it's specific changes from specific directory.
> I think this is easy to script, if the concept about the
> respository organization is done
>
> Thanks for reading this and I hope you can understand my question.
> Uwe
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Sep 16 14:08:53 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.