[Rt-commit] r5899 - commitbit/lib/CommitBit/Model

clkao at bestpractical.com clkao at bestpractical.com
Sun Sep 10 20:39:28 EDT 2006


Author: clkao
Date: Sun Sep 10 20:39:28 2006
New Revision: 5899

Modified:
   commitbit/lib/CommitBit/Model/Repository.pm

Log:
svnserve.conf.

Modified: commitbit/lib/CommitBit/Model/Repository.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/Repository.pm	(original)
+++ commitbit/lib/CommitBit/Model/Repository.pm	Sun Sep 10 20:39:28 2006
@@ -96,9 +96,9 @@
 sub remove_project {}
 
 sub write_password_files {
-        my $self = shift;
-        $self->write_htpasswd_file();
-        $self->write_svnserve_passwd_file();
+    my $self = shift;
+    $self->write_htpasswd_file();
+    $self->write_svnserve_passwd_file();
 }
 
 sub write_htpasswd_file {
@@ -110,8 +110,8 @@
 sub write_svnserve_passwd_file {
     my $self = shift;
     with_write_lock {
+	# all users that involves in any project in the repository
     };
-
 }
 
 sub write_authz_file {
@@ -123,9 +123,9 @@
 
     with_write_lock {
 
-        open( my $file, ">", $self->authz_file_path ) || die $@;
+        open( my $file, ">", $self->svnconf_file_path('authz') ) || die $@;
+        print $file $self->autogenerated_file_warning;
         while ( my $project = $projects->next ) {
-            print $file $self->autogenerated_file_warning;
             print $file "[" . $project->root_path . "]\n" || die $@;
             foreach my $user ( @{ $project->members->items_arrayref } ) {
                 print $file $user->username . " = rw\n" || die $@;
@@ -141,15 +141,27 @@
 
 }
 
-sub authz_file_path {
+sub svnconf_file_path {
     my $self = shift;
-    return File::Spec->catdir($self->path, 'conf', 'authz');
+    return File::Spec->catdir($self->path, 'conf', @_);
 }
 
 
 sub write_svnserv_config {
     my $self = shift;
     with_write_lock {
+        open my $file, ">", $self->svnconf_file_path('svnserve.conf') or die $@;
+	print $file $self->autogenerated_file_warning;
+	print $file <<"EOF";
+[general]
+anon-access = read
+auth-access = write
+password-db = passwd
+authz-db = authz
+# realm = My First Repository
+EOF
+
+	close $file or die $@;
     };
 
 


More information about the Rt-commit mailing list