On Aug 20, 2008, at 14:13, Ryan Schmidt wrote:
>
> On Aug 20, 2008, at 09:32, Robert Dailey wrote:
>
>> On Tue, Aug 19, 2008 at 7:09 PM, Ryan Schmidt wrote:
>>
>>> There's not much to it. Assuming you have already checked out a
>>> working copy to /path/to/workingcopy, you probably don't need
>>> much more than this in your post-commit hook:
>>>
>>>
>>> #!/bin/sh
>>>
>>> /usr/local/bin/svn update --non-interactive /path/to/workingcopy
>>
>> Thanks for your help. This seems to work. However, for newly added
>> files when an update occurs on my server, I need to set the group
>> for those files (chown) and also need to set the permissions of
>> those files (chmod). Is there a way of getting a list of all newly
>> added files from subversion in the post-commit script? Or am I
>> stuck with just blindly doing a "chmod -R" on the entire working
>> copy every time an update occurs?
>
> Sure, that would be something like this:
>
> --------------------------------------
>
>
> #!/bin/sh
>
> REPO="$1"
> REV="$2"
>
> WC=/path/to/workingcopy
>
> SVN=/usr/local/bin/svn
> SVNLOOK=/usr/local/bin/svnlook
> SED=/usr/bin/sed
> CHOWN=/usr/sbin/chown
> CHMOD=/bin/chmod
>
> # Update working copy
> $SVN update --non-interactive $WC
>
> # Fix ownership and permissions of newly added files
> for i in `$SVNLOOK changed -r $REV $REPO | $SED -n 's%^A %%p'`; do
> chown someuser:somegroup $WC/$i
> chmod 644 $WC/$i
> done
Sorry, I forgot to use my variables there:
$CHOWN someuser:somegroup $WC/$i
$CHMOD 644 $WC/$i
But you get the idea.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-08-20 21:42:11 CEST