[vhffs-dev] [582] Applied St?\195?\169phane Bauland (rookmoot) patch to allow mailing of subversion commit messages ( compat script for existing repositories will come soon).

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 582
Author:   beuss
Date:     2007-04-19 10:50:04 +0000 (Thu, 19 Apr 2007)

Log Message:
-----------
Applied St?\195?\169phane Bauland (rookmoot) patch to allow mailing of subversion commit messages (compat script for existing repositories will come soon).
Added dependency test for SVN::Notify to ensure that post-commit script will execute smoothly.
Don't forget to add ml_name to you vhffs_svn table!
Added some missing scripts to Makefile.am.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Robots/Svn.pm
    trunk/vhffs-api/src/Vhffs/Services/Svn.pm
    trunk/vhffs-backend/src/pgsql/initdb.sql.in
    trunk/vhffs-compat/4.0.sql.in
    trunk/vhffs-panel/cvs/prefs.pl
    trunk/vhffs-panel/svn/prefs.pl
    trunk/vhffs-panel/svn/prefs_save.pl
    trunk/vhffs-panel/templates/svn/prefs.tmpl
    trunk/vhffs-robots/Makefile.am
    trunk/vhffs-robots/src/create_svn.pl
    trunk/vhffs-test-dependencies.in

Added Paths:
-----------
    trunk/vhffs-robots/misc/vhffs_post_commit.pl


Modified: trunk/vhffs-api/src/Vhffs/Robots/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Svn.pm	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-api/src/Vhffs/Robots/Svn.pm	2007-04-19 10:50:04 UTC (rev 582)
@@ -101,30 +101,30 @@
 	    	if( ! -e $dir ) {
 		        Vhffs::Functions::create_dir( $dir ) if( ! -d $dir );
 		        $svn->add_history("Ok, robots find the empty directory and will create subversion repository");
-    		    system("svnadmin create --fs-type fsfs $dir");
+    			system("svnadmin create --fs-type fsfs $dir");
 	    		Vhffs::Functions::chmod_recur( $dir , 0664 , 02775 );
 		        Vhffs::Functions::change_owner_recur( $dir , $svn->get_owneruid , $svn->get_ownergid );
-			    change_conf( $svn );
-    		    $svn->add_history("The Robots created the subversion repository");
-            } else {
-	    	    $ok = 0;
-		    	#TODO support syslog
-			    $svn->set_status( Vhffs::Constants::CREATING_ERROR );
+			change_conf( $svn );
+    			$svn->add_history("The Robots created the subversion repository");
+                } else {
+	    		$ok = 0;
+			#TODO support syslog
+			$svn->set_status( Vhffs::Constants::CREATING_ERROR );
     			$svn->commit();
-	    	    $svn->add_history("Error, directory of this subversion already exists ! Administrators must fix the problem");
-	    	}
-			if( $ok == 1 ) {
-    		    $svn->set_status( Vhffs::Constants::ACTIVATED );
+	    		$svn->add_history("Error, directory of this subversion already exists ! Administrators must fix the problem");
+	        }
+		if( $ok == 1 ) {
+			$svn->set_status( Vhffs::Constants::ACTIVATED );
 		    
-		        if( $svn->commit < 0 ) {
-			    	$svn->add_history( "Cannot commit changes on the object ! ");
-    		    } else {
-	    			$svn->add_history( "Subversion repository is now active");
+			if( $svn->commit < 0 ) {
+				$svn->add_history( "Cannot commit changes on the object ! ");
+	    	  	} else {
+		   	 	$svn->add_history( "Subversion repository is now active");
 		        }
-		    } else {
+		} else {
 		        $svn->add_history("Object is not created, problem while creating it");
     		}
-        }
+            }
 	}
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Services/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/Svn.pm	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-api/src/Vhffs/Services/Svn.pm	2007-04-19 10:50:04 UTC (rev 582)
@@ -80,7 +80,7 @@
 
         die('Unable to create parent object') unless(defined $parent);
 
-        my $sql = 'INSERT INTO vhffs_svn(reponame, owner_uid, owner_gid, public, object_id) VALUES(?, ?, ?, 1, ?)';
+        my $sql = 'INSERT INTO vhffs_svn(reponame, owner_uid, owner_gid, public, ml_name, object_id) VALUES(?, ?, ?, 1, \'\', ?)';
         my $sth = $dbh->prepare($sql);
         $sth->execute($rname, $user->get_uid, $group->get_gid, $parent->get_oid) or return undef;
 
@@ -100,7 +100,7 @@
     my ($main, $reponame) = @_;
     my @params;
 
-    my $sql = 'SELECT s.svn_id, s.reponame, s.owner_uid, s.owner_gid, s.public, o.object_id, o.date_creation, o.description, o.state FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id = s.object_id WHERE s.reponame = ?';
+    my $sql = 'SELECT s.svn_id, s.reponame, s.owner_uid, s.owner_gid, s.public, s.ml_name, o.object_id, o.date_creation, o.description, o.state FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id = s.object_id WHERE s.reponame = ?';
 
     my $dbh = $main->get_db_object();
 
@@ -112,7 +112,7 @@
 
 sub _new
 {
-    my ($class, $main, $svn_id, $reponame, $owner_uid, $owner_gid, $public, $oid, $date_creation, $description, $state) = @_;
+    my ($class, $main, $svn_id, $reponame, $owner_uid, $owner_gid, $public, $ml_name, $oid, $date_creation, $description, $state) = @_;
 
     my $self = $class->SUPER::_new($main, $oid, $owner_uid, $date_creation, $description, $state, Vhffs::Constants::TYPE_SVN);
     return undef unless(defined $self);
@@ -121,85 +121,93 @@
     $self->{reponame} = $reponame;
     $self->{owner_gid} = $owner_gid;
     $self->{public} = $public;
+    $self->{ml_name} = $ml_name;
 
     return $self;
 }
 
 sub commit
 {
-	my $self = shift;	
+    my $self = shift;    
 
-	my $query = "UPDATE vhffs_svn SET public= '".$self->{'public'}."' WHERE svn_id=$self->{'svn_id'}";
-	my $request = $self->{'db'}->prepare($query);
-	$request->execute;
+    my $query = "UPDATE vhffs_svn SET public= '".$self->{'public'}."' WHERE svn_id=$self->{'svn_id'}";
+    my $request = $self->{'db'}->prepare($query);
+    $request->execute;
 
-	$self->SUPER::commit;
+    $self->SUPER::commit;
 }
 
+sub commit_option
+{
+    my $self = shift;
 
+    my $query = "UPDATE vhffs_svn SET ml_name= '".$self->{'ml_name'}."' WHERE svn_id=$self->{'svn_id'}";
+    my $request = $self->{'db'}->prepare($query);
+    $request->execute;
+
+    $self->SUPER::commit;
+}
+
 sub set_public
 {
-	my $self = shift;
-	$self->{'public'} = 1;
+    my $self = shift;
+    $self->{'public'} = 1;
 }
 
 sub set_private
 {
-	my $self = shift;
-	$self->{'public'} = 0;
+    my $self = shift;
+    $self->{'public'} = 0;
 }
 
 sub is_public
 {
-	my $self = shift;
-	
-	return -1 if( ! defined $self->{'public'} );
+    my $self = shift;
+    
+    return -1 if( ! defined $self->{'public'} );
 
-	if( $self->{'public'} == 1 )
-	{
-		return 1;
-	}
-	else
-	{
-		return 0;
-	}
+    if( $self->{'public'} == 1 ) {
+        return 1;
+    } else {
+        return 0;
+    }
 }
 
 sub set_user
 {
-	my ( $self , $user ) = @_;
-	$self->{'user'} = $user;
+    my ( $self , $user ) = @_;
+    $self->{'user'} = $user;
 }
 
 sub set_group
 {
-	my ( $self , $group ) = @_;
-	$self->{'group'} = $group;
+    my ( $self , $group ) = @_;
+    $self->{'group'} = $group;
 }
 
 sub get_reponame
 {
-	my $self = shift;
-	return $self->{'reponame'};
+    my $self = shift;
+    return $self->{'reponame'};
 }
 
 
 sub get_owneruid
 {
-	my( $self ) = @_;
-	return $self->{'owner_uid'};
+    my( $self ) = @_;
+    return $self->{'owner_uid'};
 }
 
 sub get_ownergid
 {
-	my $self = shift;
-	return $self->{'owner_gid'};
+    my $self = shift;
+    return $self->{'owner_gid'};
 }
 
 sub get_title
 {
-	my $self = shift;
-	return $self->{'reponame'};
+    my $self = shift;
+    return $self->{'reponame'};
 }
 
 

Modified: trunk/vhffs-backend/src/pgsql/initdb.sql.in
===================================================================
--- trunk/vhffs-backend/src/pgsql/initdb.sql.in	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in	2007-04-19 10:50:04 UTC (rev 582)
@@ -277,6 +277,7 @@
 	owner_uid int4, 
 	owner_gid int4,
 	public int4 NOT NULL,
+	ml_name vachar;
 	object_id int4,
 	CONSTRAINT vhffs_svn_pkey PRIMARY KEY( reponame , owner_gid)
 ) WITH OIDS;

Modified: trunk/vhffs-compat/4.0.sql.in
===================================================================
--- trunk/vhffs-compat/4.0.sql.in	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-compat/4.0.sql.in	2007-04-19 10:50:04 UTC (rev 582)
@@ -209,3 +209,5 @@
 FROM vhffs_users users, vhffs_object object
 WHERE object.object_id=users.object_id;
 
+-- add ml_name to vhffs_svn for commit system.
+ALTER TABLE vhffs_svn ADD COLUMN ml_name varchar;

Modified: trunk/vhffs-panel/cvs/prefs.pl
===================================================================
--- trunk/vhffs-panel/cvs/prefs.pl	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-panel/cvs/prefs.pl	2007-04-19 10:50:04 UTC (rev 582)
@@ -67,33 +67,23 @@
 
 my $templatedir = $vhffs->get_config->get_templatedir;
 
-if( ! defined $repo_name )
-{
+if( ! defined $repo_name ) {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	$message = gettext( "CGI Error !");
 	$template->param( MESSAGE => $message );
-}
-elsif( !defined($cvs = Vhffs::Services::Cvs::get_by_cvsroot($vhffs, $repo_name) ) )
-{
+} elsif( !defined($cvs = Vhffs::Services::Cvs::get_by_cvsroot($vhffs, $repo_name) ) ) {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	$message = gettext( "Cannot get informations on this object");
 	$template->param( MESSAGE => $message );
-
-}
-elsif( ( Vhffs::Acl::what_perm_for_user( $user , $cvs , $vhffs ) < Vhffs::Constants::ACL_VIEW ) && ( $user->is_admin != 1 ) )
-{
+} elsif( ( Vhffs::Acl::what_perm_for_user( $user , $cvs , $vhffs ) < Vhffs::Constants::ACL_VIEW ) && ( $user->is_admin != 1 ) ) {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 	$message = gettext( "You're not allowed to do this (ACL rights)");
 	$template->param( MESSAGE => $message );
-}
-elsif( ( $cvs->get_status != Vhffs::Constants::ACTIVATED ) && ( $user->is_admin != 1 ) )
-{
+} elsif( ( $cvs->get_status != Vhffs::Constants::ACTIVATED ) && ( $user->is_admin != 1 ) ) {
 	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
     $message = gettext( "This object is not functionnal yet. Please wait creation, moderation or modification.");
 	$template->param( MESSAGE => $message );
-}
-else
-{
+} else {
 	$template = new HTML::Template( filename => $templatedir."/cvs/prefs.tmpl" );
 
 	$template->param( TEXT_TITLE => gettext("Admin CVS Repository") );
@@ -117,13 +107,9 @@
     $template->param( PERM_TEXT => "Fixing permissions on a repository solve permission access on the repository. Can be helpful if you encounter problems" );
     $template->param( PERM_BUTTON => "Fix it" );
 
-
-	if( $cvs->is_public == 1 )
-	{
+	if( $cvs->is_public == 1 ) {
     	$template->param( YES_SELECTED => "selected" );
-	}
-	else
-	{
+	} else {
     	$template->param( NO_SELECTED => "selected" );
 	}
 

Modified: trunk/vhffs-panel/svn/prefs.pl
===================================================================
--- trunk/vhffs-panel/svn/prefs.pl	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-panel/svn/prefs.pl	2007-04-19 10:50:04 UTC (rev 582)
@@ -70,7 +70,7 @@
 
 if( defined $cgigroupname )
 {
-	$group = Vhffs::Group::get_by_groupname( $vhffs , $cgigroupname );
+    $group = Vhffs::Group::get_by_groupname( $vhffs , $cgigroupname );
 }
 
 $svn = Vhffs::Services::Svn::get_by_reponame( $vhffs , $repo_name );
@@ -78,53 +78,53 @@
 
 if( ! defined $repo_name )
 {
-	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
-	$message = gettext( "CGI Error" );
-	$template->param( MESSAGE => $message );
+    $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+    $message = gettext( "CGI Error" );
+    $template->param( MESSAGE => $message );
 }
 elsif( ! defined $group )
 {
-	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
-	$template->param( MESSAGE => gettext("Grant an user access to this repository") );
+    $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+    $template->param( MESSAGE => gettext("Grant an user access to this repository") );
 }
 elsif( !defined $svn )
 {
-	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
-	$message = gettext( "Cannot get informations on this object");
-	$template->param( MESSAGE => $message );
+    $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+    $message = gettext( "Cannot get informations on this object");
+    $template->param( MESSAGE => $message );
 
 }
 elsif( ( Vhffs::Acl::what_perm_for_user( $user , $svn , $vhffs ) < Vhffs::Constants::ACL_VIEW ) && ( $user->is_admin != 1 ) )
 {
-	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
-	$message = gettext( "You're not allowed to do this (ACL rights)");
-	$template->param( MESSAGE => $message );
+    $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+    $message = gettext( "You're not allowed to do this (ACL rights)");
+    $template->param( MESSAGE => $message );
 }
 elsif( ( $svn->get_status != Vhffs::Constants::ACTIVATED ) && ( $user->is_admin != 1 ) )
 {
-	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+    $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
     $message = gettext( "This object is not functionnal yet. Please wait creation, moderation or modification.");
-	$template->param( MESSAGE => $message );
+    $template->param( MESSAGE => $message );
 }
 else
 {
-	$template = new HTML::Template( filename => $templatedir."/svn/prefs.tmpl" );
+    $template = new HTML::Template( filename => $templatedir."/svn/prefs.tmpl" );
 
-	$template->param( TEXT_TITLE => gettext("Admin Subversion Repository") );
-	
-	
-	$template->param( TEXT_REPONAME => $svn->get_reponame );
-	$template->param( TITLE_PUBLIC => gettext("Public") );
-	$template->param( TEXT_PUBLIC => gettext("Is this a public repository ?") );
-	$template->param( PUBLIC_YES => gettext("Yes") );
-	$template->param( PUBLIC_NO => gettext("No") );
-	$template->param( TEXT_SEND => gettext("Modify") );
-	$template->param( TEXT_DELETE_CVS => gettext("Delete this repository") );
-	$template->param( TEXT_BEFORE_DELETE => gettext("This action is non-reversible. All services associated to this project will be DESTROYED.") );
-	$template->param( ASK_DELETE_CVS => gettext("Are you SURE you want DELETE this  subversion repository ?") );
-	$template->param( YES => gettext("Yes I'm sure of what I do") );
-	$template->param( NO => gettext("No, I'm not sure, I prefer to keep this project.") );
-	$template->param( TEXT_DELETE => gettext("Delete") );
+    $template->param( TEXT_TITLE => gettext("Admin Subversion Repository") );
+    
+    
+    $template->param( TEXT_REPONAME => $svn->get_reponame );
+    $template->param( TITLE_PUBLIC => gettext("Public") );
+    $template->param( TEXT_PUBLIC => gettext("Is this a public repository ?") );
+    $template->param( PUBLIC_YES => gettext("Yes") );
+    $template->param( PUBLIC_NO => gettext("No") );
+    $template->param( TEXT_SEND => gettext("Modify") );
+    $template->param( TEXT_DELETE_CVS => gettext("Delete this repository") );
+    $template->param( TEXT_BEFORE_DELETE => gettext("This action is non-reversible. All services associated to this project will be DESTROYED.") );
+    $template->param( ASK_DELETE_CVS => gettext("Are you SURE you want DELETE this  subversion repository ?") );
+    $template->param( YES => gettext("Yes I'm sure of what I do") );
+    $template->param( NO => gettext("No, I'm not sure, I prefer to keep this project.") );
+    $template->param( TEXT_DELETE => gettext("Delete") );
 
     $template->param( TEXT_ACL_ADMIN => "Admin Rights on this object (ACL)" );
     $template->param( EXPLAIN_ADMIN_ACL => "You can Manage rights on this service for each user in the VHFFS database. Please read help before manage it." );
@@ -133,26 +133,33 @@
     $template->param( PERM_TEXT => "Fixing permissions on a repository solve permission access on the repository. Can be helpful if you encounter problems" );
     $template->param( TEXT_BUTTON_PERM => "Fix them !" );
 
+    $template->param( TITLE_OPT => "Options" );
+    $template->param( TEXT_OPT_ML => "Notify changes on mailing-list :");
 
-	
-	
-	if( $svn->is_public == 1 )
-	{
-    	$template->param( YES_SELECTED => "selected" );
-	}
-	else
-	{
-    	$template->param( NO_SELECTED => "selected" );
-	}
+    if ( $svn->{ml_name} ne '' )
+    {
+        $template->param( TEXT_ML_NAME => $svn->{ml_name});
+    } else {
+    	$template->param( TEXT_ML_NAME => gettext('ml adress here...') );
+    }
+    
+    if( $svn->is_public == 1 )
+    {
+            $template->param( YES_SELECTED => "selected" );
+    }
+    else
+    {
+            $template->param( NO_SELECTED => "selected" );
+    }
 
-	if( $user->is_admin == 1 )
-	{
-		$subtemplate = new HTML::Template( filename => $templatedir."/admin/misc/opart.tmpl" );
-		$subtemplate->param( OID => $svn->get_oid );
-		$subtemplate->param( OPART_TEXT => gettext("Go to object-part admin") );
-		$subtemplate->param( OPART_TITLE => gettext("Object part") );
-		$template->param( OPART => $subtemplate->output );
-	}
+    if( $user->is_admin == 1 )
+    {
+        $subtemplate = new HTML::Template( filename => $templatedir."/admin/misc/opart.tmpl" );
+        $subtemplate->param( OID => $svn->get_oid );
+        $subtemplate->param( OPART_TEXT => gettext("Go to object-part admin") );
+        $subtemplate->param( OPART_TITLE => gettext("Object part") );
+        $template->param( OPART => $subtemplate->output );
+    }
 
 
 }

Modified: trunk/vhffs-panel/svn/prefs_save.pl
===================================================================
--- trunk/vhffs-panel/svn/prefs_save.pl	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-panel/svn/prefs_save.pl	2007-04-19 10:50:04 UTC (rev 582)
@@ -64,7 +64,9 @@
 
 my $repo = $cgi->param( "REPO_NAME" );
 my $public = $cgi->param( "PUBLIC" );
+my $ml_name = $cgi->param( "ML_NAME" );
 
+
 my $svn = Vhffs::Services::Svn::get_by_reponame( $vhffs , $repo );
 
 my $templatedir = $vhffs->get_config->get_templatedir;
@@ -75,11 +77,11 @@
 }
 elsif( ! defined($svn) )
 {
-	$message = gettext( "Cannot retrieve informations about this Subversion repository" );
+    $message = gettext( "Cannot retrieve informations about this Subversion repository" );
 }
 elsif( ( Vhffs::Acl::what_perm_for_user( $user , $svn , $vhffs ) < Vhffs::Constants::ACL_MODIFY ) && ( $user->is_admin != 1 ) )
 {
-	$message = gettext( "You're not allowed to do this (ACL rights)" );
+    $message = gettext( "You're not allowed to do this (ACL rights)" );
 }
 elsif( ( $svn->get_status != Vhffs::Constants::ACTIVATED ) && ( $user->is_admin != 1 ) )
 {
@@ -88,28 +90,40 @@
 else
 {
 
-	if( defined $public )
-	{
-		if( $public == 1 )
-		{
-			$svn->set_public;
-		}
-		else
-		{
-			$svn->set_private;
-		}
-	}
+    if( defined $public )
+    {
+        if( $public == 1 )
+        {
+            $svn->set_public;
+        }
+        else
+        {
+            $svn->set_private;
+        }
 
-	$svn->set_status( Vhffs::Constants::WAITING_FOR_MODIFICATION );
-	
-	if( $svn->commit < 0 )
-	{
-	        $message = gettext("An error occured while updating the Subversion repository");
-	}  
-	else  
-	{
-        $message = gettext("Repository updated");
-	}
+        $svn->set_status( Vhffs::Constants::WAITING_FOR_MODIFICATION );
+        if( $svn->commit < 0 )
+        {
+                $message = gettext("An error occured while updating the Subversion repository");
+        }
+        else
+        {
+                $message = gettext("Repository updated");
+        }
+    }
+
+    if ( defined $ml_name && ( $ml_name ne gettext('ml adress here...'))) {
+        if(Vhffs::Functions::valid_mail($ml_name) > 0) {
+            $svn->{ml_name} = $ml_name;
+            if( $svn->commit_option < 0 ) {
+                $message = gettext("An error occured while updating the Subversion repository");
+            } else {
+                $message = gettext("Repository updated");
+            }
+        } else {
+            $message = gettext('Mailing list address is invalid');
+        }
+    }
 }
 
 my $template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );

Modified: trunk/vhffs-panel/templates/svn/prefs.tmpl
===================================================================
--- trunk/vhffs-panel/templates/svn/prefs.tmpl	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-panel/templates/svn/prefs.tmpl	2007-04-19 10:50:04 UTC (rev 582)
@@ -18,7 +18,19 @@
 	</p>
 </form>
 
+<h2><tmpl_var name="TITLE_OPT"></h2>
+<form method="post" action="/svn/prefs_save.pl">
+	<p>
+		<label for="OPTION"><tmpl_var name="TEXT_OPT_ML"></label>
+                <input type="text" name="ML_NAME" value="<tmpl_var name="TEXT_ML_NAME">" />
+	</p>
+	<p class="button" id="buttonModify">
+		<input type="hidden" name="REPO_NAME" value="<tmpl_var name="TEXT_REPONAME">" />
+		<input type="submit" value="<tmpl_var name="TEXT_SEND">" />
+	</p>
+</form>
 
+
 <h2><tmpl_var name="TITLE_PERM"></h2>
 <form method="post" action="/svn/prefs_save.pl">
 	<p>

Modified: trunk/vhffs-robots/Makefile.am
===================================================================
--- trunk/vhffs-robots/Makefile.am	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-robots/Makefile.am	2007-04-19 10:50:04 UTC (rev 582)
@@ -10,6 +10,9 @@
 	misc/repository.awstats.sample \
 	misc/viewvc.conf.tmpl
 
+nobase_bots_SCRIPTS = \
+    misc/vhffs_post_commit.pl
+
 bots_SCRIPTS = \
 	src/create_cvs.pl \
 	src/create_dns.pl \
@@ -36,6 +39,7 @@
 	src/delete_users.pl \
 	src/delete_web.pl \
 	src/dump_mysql.pl \
+	src/dump_pgsql.pl \
 	src/fix_quota.pl \
 	src/fix_quota.pl \
 	src/fix_quota_repository.pl \
@@ -64,7 +68,8 @@
 # Define the substitution we need to point perl script at correct location
 do_sed = $(SED) --in-place \
 	-e 's,%PERL%,$(PERL),g' \
-	-e 's,'%VHFFS_LIB_DIR%',$(VHFFS_LIBDIR),g'
+	-e 's,'%VHFFS_LIB_DIR%',$(VHFFS_LIBDIR),g' \
+	-e 's,'%VHFFS_BOTS_DIR%',$(botsdir),g'
 
 # Because automake, exec-hook is executed before install-scripts
 # so install-data is after. Here we use a data-hook
@@ -76,3 +81,6 @@
 		nf=`echo $$f | sed 's,^.*/,,'`; \
 		$(do_sed) $(DESTDIR)$(botsdir)/$$nf; \
 	done
+	for f in $(nobase_bots_SCRIPTS) ; do \
+		$(do_sed) $(DESTDIR)$(botsdir)/$$f; \
+	done

Added: trunk/vhffs-robots/misc/vhffs_post_commit.pl
===================================================================
--- trunk/vhffs-robots/misc/vhffs_post_commit.pl	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-robots/misc/vhffs_post_commit.pl	2007-04-19 10:50:04 UTC (rev 582)
@@ -0,0 +1,72 @@
+#!/usr/bin/perl
+#
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright 
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in 
+#   the documentation and/or other materials provided with the 
+#   distribution.
+#3. Neither the name of vhffs nor the names of its contributors 
+#   may be used to endorse or promote products derived from this 
+#   software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+# POSSIBILITY OF SUCH DAMAGE.
+
+use POSIX qw(locale_h);
+use locale;
+use Locale::gettext;
+use strict;
+
+use SVN::Notify;
+use File::Basename;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::Main;
+use Vhffs::User;
+use Vhffs::Conf;
+use Vhffs::Group;
+use Vhffs::Functions;
+use Vhffs::Services::Svn;
+
+my $vhffs        = init Vhffs::Main;
+my $repo_path    = $ARGV[0];
+my $repo         = basename($ARGV[0]);
+my $rev          = $ARGV[1];
+my $svn          = Vhffs::Services::Svn::get_by_reponame( $vhffs , $repo );
+my $from         = Vhffs::Conf::get_master_mail();
+my $notifier;
+
+# MODE : mailinglist
+if ($svn->{ml_name} ne '')
+{
+        my %params;
+	%params->{'repos_path'}   = $repo_path;
+	%params->{'revision'}     = $rev;
+	%params->{'from'}         = $from;
+	%params->{'to'}           = $svn->{ml_name};
+	%params->{'with_diff'}    = 1;
+        %params->{'attach_diff'}  = 1;
+
+	$notifier = SVN::Notify->new(%params);
+
+	$notifier->prepare;
+	$notifier->execute;
+}

Modified: trunk/vhffs-robots/src/create_svn.pl
===================================================================
--- trunk/vhffs-robots/src/create_svn.pl	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-robots/src/create_svn.pl	2007-04-19 10:50:04 UTC (rev 582)
@@ -46,9 +46,10 @@
 foreach $svn ( @{$repos} )
 {
 	if( Vhffs::Robots::Svn::create_repo( $vhffs , $svn ) < 0 ) {
-    	Vhffs::Robots::vhffs_log( sprintf( "Cannot create SVN %s" , $svn->get_reponame ), $vhffs);
+    		Vhffs::Robots::vhffs_log( sprintf( "Cannot create SVN %s" , $svn->get_reponame ), $vhffs);
 	} else {
 		Vhffs::Robots::vhffs_log( sprintf( "Create SVN %s" , $svn->get_reponame ), $vhffs);
+		symlink('%VHFFS_BOTS_DIR%/misc/vhffs_post_commit.pl', $svn->get_dir().'/hooks/post-commit');
 	}
 }
 

Modified: trunk/vhffs-test-dependencies.in
===================================================================
--- trunk/vhffs-test-dependencies.in	2007-04-19 09:53:37 UTC (rev 581)
+++ trunk/vhffs-test-dependencies.in	2007-04-19 10:50:04 UTC (rev 582)
@@ -41,6 +41,9 @@
 	('GD', ''),
 	('GD::Text::Wrap', '')];
 
+$dep{'robots'} = [
+    ('SVN::Notify', '')];
+
 &GetOptions( \%args,
 	'u|usage',
 	'h|help', 
@@ -54,7 +57,7 @@
 $args{'verify'} = 'api' if (!$args{'verify'});
 
 if ( $args{'verify'} eq 'all') {
-	@components = ('api', 'irc', 'jabber', 'listengine', 'panel');
+	@components = ('api', 'irc', 'jabber', 'listengine', 'panel', 'robots');
 } else {
 	@components = split ( /,/, $args{'verify'});
 }
@@ -139,6 +142,7 @@
     . jabber
     . listengine
     . panel
+    . robots
     . all (all of the above)
                     
 	


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/