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

svn homdirs [was Re: newbie question: import and co to the same directory?]

From: <pll_at_lanminds.com>
Date: 2003-07-18 18:13:33 CEST

>>>>> On Thu, 17 Jul 2003, "Jack" == Jack Repenning wrote:

  Jack> I routinely do a simpler case, maintaining my home directory
  Jack> in SVN. As with /etc, there are lots of files there I don't
  Jack> want to put in to the repo, and all the files are expected to
  Jack> be "in the way" normally.

I do the same. The nice thing about svn is svn:ignore. As I use
exmh for my mail, each individual mail message is a separate file.
I obviously don't want versioned e-mail, as that would cause
uncontrollable growth of my svn repo. So I use a pretty detailed
svn:ignore propert on my Mail dir so I only version the config files
I really care about!

  Jack> FWIW, I use this script to migrate my home stuff to a new
  Jack> computer

I went a different direction. Since I don't use a lot of links in my
home dir, I organized all my dot-file/dot-dirs into versioned
directories. When I check out my home dir to another system,
I have a shell script in my ~/bin dir which creates symlinkss from
$HOME to $HOME/.dot[files|dirs]/* and I'm done.

But back to the OPs problem of maintaining /etc in svn. I've found
it's just easier to import only the files you really care about into
the repo, and set svn:ignore for those you don't want to know about.

The other thing I do is maintain things in /etc which apply to many
different systems. That way, when I build a new system, I just check
out the repo to the new system and I'm done. Things like passwd,
group, shadow, sysconfig/network, etc. It's very easy to migrate to
a new system with something like:

        svn ls -R http://your.repo.com/svn/etc | xargs rm

then 'svn co http://your.repo.com/svn/etc .' That way, you're not
actually overwriting unversioned files, since you've just removed all
the files which exist in the repo from the unversioned directory
structure.

Another possibility is to set a property on the versioned /etc dir
which is a list of owners/groups/perms of the files contained in the
repo, then run a script on that property which sets things
accordingly immediately after checkout. The script wouldn't even be
very complicated or long. Assuming something

        $ svn proplist http://your.repo.com/svn/etc
        perms
        $ svn propget perms http://your.repo.com/svn/etc
        passwd:root:root:644
        .
        .
        .

you could easily:

        $ svn co http://your.repo.com/svn/etc .
        $ svn proplist perms http://your.repo.com/svn/etc | \
            perl -F: -ane 'chown $F[1]:$F[2] $F[0]; chmod $F[3] $F[0];'

And that's it!

HTH,

-- 
Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.
	 If you're not having fun, you're not doing it right!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 18 18:14:38 2003

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

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