savannah-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-cvs] administration/infra/bin sv_gatekpr.pl


From: Sylvain Beucler
Subject: [Savannah-cvs] administration/infra/bin sv_gatekpr.pl
Date: Tue, 15 Mar 2005 17:45:58 -0500

CVSROOT:        /cvsroot/administration
Module name:    administration
Branch:         
Changes by:     Sylvain Beucler <address@hidden>        05/03/15 22:45:58

Modified files:
        infra/bin      : sv_gatekpr.pl 

Log message:
        Now handle concurrency with the frontend
        Some error handling

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/administration/administration/infra/bin/sv_gatekpr.pl.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: administration/infra/bin/sv_gatekpr.pl
diff -u administration/infra/bin/sv_gatekpr.pl:1.4 
administration/infra/bin/sv_gatekpr.pl:1.5
--- administration/infra/bin/sv_gatekpr.pl:1.4  Thu Jan 13 14:25:04 2005
+++ administration/infra/bin/sv_gatekpr.pl      Tue Mar 15 22:45:58 2005
@@ -33,10 +33,19 @@
 
 umask 0022; # first '0' is for Perl octal mode
 
+my %group_in_system;
+while (my @entry = getgrent()) {
+    $group_in_system{$entry[0]} = 1;
+}
+
+
 # Process active public projects
 for my $project_name (sort @projects) {
     chomp($project_name);
 
+    # Skip projects not yet created (frontend/backend concurrency)
+    next if (!defined($group_in_system{$project_name}));
+
     # Always recreated, since the user can update his key without changing
     # his groups membership
     CreateDownloadKeyring($project_name);
@@ -51,8 +60,10 @@
     my @download_keys;
     my @group_savannah = GetGroupAdmins($group);
 
-    open(EMAIL, ">/home/gatekpr/projects/$group/email")
-       or die "failed to open /home/gatekpr/projects/$group/email";
+    if (!open(EMAIL, ">/home/gatekpr/projects/$group/email")) {
+       warn "$0: Could not open /home/gatekpr/projects/$group/email: $!\n";
+       return;
+    }
     flock(EMAIL, LOCK_EX) or die "flock failed";
     
     




reply via email to

[Prev in Thread] Current Thread [Next in Thread]