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

RE: preserving file ownership/permissions?

From: Anthony J Fasano \(AJ\) <afasano_at_relayregistry.com>
Date: 2004-10-13 06:31:46 CEST

I ran into a similar problem so I wrote a perl script:

open(SVNEXPORT, "svn export --force ... |");
while (<SVNEXPORT>) {
        my($flag,$file)=split(/\t/);
        chmod 0600,$file;
}

The only issue one runs into is if the permissions vary. Then perhaps the
repository would have to reflect that.

Repos/0600/etc
Repos/0755/etc
        
Then something like this may work:
open(REPOSLS,"svn ls repos |");
while (<REPOSLS>) {
        $perm=$_;
        chomp($perm);
        open(SVNEXPORT, "svn export --force repos/$perm |");
        while (<SVNEXPORT>) {
                my($flag,$file)=split(/\t/);
                chmod $perm,$file;
        }
}

That way a config file is not needed to manage the config files... So to
speak.

A.J.

-----Original Message-----
From: HAND,Nathan [mailto:Nathan.HAND@dewr.gov.au]
Sent: Tuesday, October 12, 2004 11:40 PM
To: users@subversion.tigris.org
Subject: Q: preserving file ownership/permissions?

I want to use subversion to manage config files in a cluster. The
servers were historically maintained by hand so the configs have drifted
apart. The goal is to eventually have a single identical config on all
the servers but for practical reasons this won't happen overnight.

My plan is to have a trunk for the "ideal" config. Each server will
initially be imported into a branch using the in-place-import technique:

   http://subversion.tigris.org/project_faq.html#in-place-import

I'll then use svndiff and svnmerge until the branch equals the trunk, at
which point I'll use svnswitch. Then the server will be managed under
the trunk. Everything sound good so far?

My problem is that some configs need specific UNIX ownerships and
permissions. For example, 0600 is needed by several config files.
Subversion naturally doesn't preserve platform specific information like
that.

Has anybody written anything that ties into the svn:props and/or
repository hooks that does what I want? I really want to avoid
additional steps after checkout (eg, fixperms.sh or something equally
cumbersome).

Notice:
The information contained in this e-mail message and any attached files may
be confidential information, and may also be the subject of legal
professional privilege. If you are not the intended recipient any use,
disclosure or copying of this e-mail is unauthorised. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete all copies of this transmission together with any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 13 06:32:13 2004

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.