[vhffs-dev] [2266] added group section to cgit configurator

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


Revision: 2266
Author:   gradator
Date:     2015-01-25 22:26:37 +0100 (Sun, 25 Jan 2015)
Log Message:
-----------
added group section to cgit configurator

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Robots/Git.pm

Modified: trunk/vhffs-api/src/Vhffs/Robots/Git.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Git.pm	2015-01-25 20:29:00 UTC (rev 2265)
+++ trunk/vhffs-api/src/Vhffs/Robots/Git.pm	2015-01-25 21:26:37 UTC (rev 2266)
@@ -235,6 +235,7 @@
 	return undef unless defined $tmpfile;
 
 	binmode ($tmpfile, ':utf8');
+	my $group;
 
 	my $gits = Vhffs::Services::Git::getall( $vhffs, Vhffs::Constants::ACTIVATED );
 	foreach my $git ( @{$gits} )  {
@@ -247,12 +248,19 @@
 		$description =~ s/\n$//; # remove latest LF
 		$description =~ s/\n/ /g; # replace LF to space
 
+		if (not defined $group or $git->get_group->get_groupname ne $group->get_groupname) {
+			$group = $git->get_group;
+			my $realname = $group->get_realname;
+			$realname = $group->get_groupname unless $realname;
+			print $tmpfile 'section='.$realname."\n\n";
+		}
+
 		print $tmpfile 'repo.url='.$git->get_reponame."\n";
 		print $tmpfile 'repo.path='.$git->get_dir."\n";
 		print $tmpfile 'repo.desc='.$description."\n";
 
 		require Vhffs::Services::MailGroup;
-		my $mg = new Vhffs::Services::MailGroup( $vhffs, $git->get_group );
+		my $mg = new Vhffs::Services::MailGroup( $vhffs, $group );
 		print $tmpfile 'repo.owner='.$mg->get_localpart->get_localpart.'@'.$mg->get_domain."\n" if defined $mg and defined $mg->get_localpart;
 
 		print $tmpfile "\n";		


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