CVSROOT: loginfo, ciabot.pl - cvsnt now

arekm arekm at pld-linux.org
Sun Jun 15 04:14:38 CEST 2008


Author: arekm                        Date: Sun Jun 15 02:14:38 2008 GMT
Module: CVSROOT                       Tag: HEAD
---- Log message:
- cvsnt now

---- Files affected:
CVSROOT:
   loginfo (1.216 -> 1.217) , ciabot.pl (1.23 -> 1.24) 

---- Diffs:

================================================================
cvs rdiff: E /cvsroot/CVSROOT/config: unrecognized keyword 'UseNewInfoFmtStrings'
Index: CVSROOT/loginfo
diff -u CVSROOT/loginfo:1.216 CVSROOT/loginfo:1.217
--- CVSROOT/loginfo:1.216	Wed Apr 16 23:10:52 2008
+++ CVSROOT/loginfo	Sun Jun 15 04:14:33 2008
@@ -25,12 +25,11 @@
 #DEFAULT		/cvsroot/CVSROOT/cvslog.pl %{sVv} $USER
 
 # distfiles filter, log kept for security.pld-linux.org
-^SPECS		/cvsroot/CVSROOT/logdiff.pl --distfiles dfadm at cvs-real.pld-linux.org --logfile commits.log --diffs --module SPECS %p %{sVv}
+^SPECS		/cvsroot/CVSROOT/logdiff.pl --distfiles dfadm at cvs-real.pld-linux.org --logfile commits.log --diffs --module SPECS %{sVv}
 
-^cdg    /cvsroot/CVSROOT/cdg.sh %p %{sVv}
+^cdg    /cvsroot/CVSROOT/cdg.sh %{sVv}
 
 #^test		/cvsroot/CVSROOT/cvslog.pl %{sVv} $USER
 
-
-ALL	/cvsroot/CVSROOT/ciabot.pl %p %{s} %n $USER
-ALL	/cvsroot/CVSROOT/cvslog.pl %p %{sVv} $USER
+ALL	/cvsroot/CVSROOT/ciabot.pl %{,,,s} $USER
+ALL	/cvsroot/CVSROOT/cvslog.pl %{sVv} $USER

================================================================
cvs rdiff: E /cvsroot/CVSROOT/config: unrecognized keyword 'UseNewInfoFmtStrings'
Index: CVSROOT/ciabot.pl
diff -u CVSROOT/ciabot.pl:1.23 CVSROOT/ciabot.pl:1.24
--- CVSROOT/ciabot.pl:1.23	Thu Mar 27 21:21:07 2008
+++ CVSROOT/ciabot.pl	Sun Jun 15 04:14:33 2008
@@ -22,10 +22,9 @@
 #
 # Its record in the loginfo file should look like:
 #
-#     ALL /usr/bin/perl $CVSROOT/CVSROOT/ciabot_cvs.pl %p %{s} %n $USER project from_email dest_email ignore_regexp
+#     ALL /usr/bin/perl $CVSROOT/CVSROOT/ciabot_cvs.pl %{,,,s} $USER project from_email dest_email ignore_regexp
 #
-# IMPORTANT: The loginfo line has been changed to bring it into compliance
-#            with the new 'common format' used in CVS administrative files.
+# IMPORTANT: The %{,,,s} in loginfo is new, and is required for proper operation.
 #
 #            Make sure that you add the script to 'checkoutlist' before
 #            committing it. You may need to change /usr/bin/perl to point to your
@@ -36,11 +35,9 @@
 #
 
 use strict;
-use POSIX 'setsid';
 use vars qw ($project $from_email $dest_email $rpc_uri $sendmail $sync_delay
 		$xml_rpc $ignore_regexp $alt_local_message_target);
 
-$| = 1;
 
 ### Configuration
 
@@ -128,43 +125,21 @@
 #
 $" = "\7";
 
-sub daemonize {
-  chdir '/'               or die "Can't chdir to /: $!";
-  open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
-  open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
-  defined(my $pid = fork) or die "Can't fork: $!";
-  exit if $pid;
-  setsid                  or die "Can't start a new session: $!";
-  open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
-}
-
-sub basename {
-	$_[0] =~ m{([^/]+)$};
-	$1;
-}
-
 ### Input data loading
 
-
 # These arguments are from %s; first the relative path in the repository
 # and then the list of files modified.
-# Modified by jcarlyle for cvs 1.12 (30-May-04)
-
-my $PROGRAM = basename $0;
 
-$dir[0] = shift @ARGV or die "$PROGRAM: no directory specified\n";
-
-while($ARGV[0])
-{
-  push @files, shift @ARGV;
-}
-
-$dirfiles[0] = "@files" or die "$PROGRAM: no files specified\n";
+ at files = split (' ,,,', ($ARGV[0] or ''));
+$dir[0] = shift @files or die "$0: no directory specified\n";
+$dirfiles[0] = "@files" or die "$0: no files specified\n";
 
 
 # Guess module name.
 
-$module = $dir[0]; $module =~ s#/.*##;
+$module = $dir[0]; 
+$module =~ s#^,+##;
+$module =~ s#/.*##;
 
 
 # Figure out who is doing the update.
@@ -200,7 +175,7 @@
 
 $dirfiles[0] = join (' ',
   grep {
-    my $f = "$module/$dir[0]/$_";
+    my $f = "$dir[0]/$_";
     $f !~ m/$ignore_regexp/;
   } split (/\s+/, $dirfiles[0])
 ) if ($ignore_regexp);
@@ -241,12 +216,8 @@
   open(FF, ">>$syncfile") or die "aieee... can't log, can't log! $syncfile blocked!";
   close(FF);
 
-  defined(my $pid = fork) or die "Can't fork: $!";
-  exit if $pid;
-
-  warn "$PROGRAM: sleeping $sync_delay seconds\n";
+  exit if (fork);
   sleep($sync_delay);
-  warn "$PROGRAM: collecting files and removing syncfile\n";
 
   open(FF, $syncfile);
   my ($dirnum) = 1; # 0 is the one we got triggerred for
@@ -265,7 +236,7 @@
 ### Compose the mail message
 
 
-my ($VERSION) = '2.3';
+my ($VERSION) = '2.4';
 my ($URL) = 'http://cia.vc/clients/cvs/ciabot_cvs.pl';
 my $ts = time;
 
@@ -326,14 +297,10 @@
 }
 
 
-
 ### Send out the XML-RPC message
 
 
 if ($xml_rpc) {
-  warn "$PROGRAM: send out xml-rpc message\n";
-  daemonize();
-
   # We gotta be careful from now on. We silence all the warnings because
   # RPC::XML code is crappy and works with undefs etc.
   $^W = 0;
@@ -355,7 +322,6 @@
 
 
 ### Send out the mail
-warn "$PROGRAM: send out the mail\n";
 
 
 # Open our mail program
@@ -379,6 +345,6 @@
 # Close the mail
 
 close MAIL;
-die "$PROGRAM: sendmail exit status " . ($? >> 8) . "\n" unless ($? == 0);
+die "$0: sendmail exit status " . ($? >> 8) . "\n" unless ($? == 0);
 
 # vi: set sw=2:
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/CVSROOT/loginfo?r1=1.216&r2=1.217&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/CVSROOT/ciabot.pl?r1=1.23&r2=1.24&f=u



More information about the pld-cvs-commit mailing list