| From: | Sterling Hughes | Date: | Sat, 08 Sep 2001 00:22:19 +0000 |
| Subject: | |||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7305@lists.php.net to get a copy of this message | ||
sterling Fri Sep 7 20:22:19 2001 EDT
Modified files:
/CVSROOT loginfo.pl
Log:
Revert out commit, very odd how the subject was getting messed up...
For commits to the adt repository, the subject was not affected, when printing
out $common_header for both the adt and the regular repositories, the subject
was present...
Index: CVSROOT/loginfo.pl
diff -u CVSROOT/loginfo.pl:1.49 CVSROOT/loginfo.pl:1.50
--- CVSROOT/loginfo.pl:1.49 Fri Sep 7 20:10:24 2001
+++ CVSROOT/loginfo.pl Fri Sep 7 20:22:19 2001
@@ -11,8 +11,8 @@
use strict;
-use POSIX;
use Socket;
+use POSIX;
$SIG{PIPE} = 'IGNORE';
@@ -57,42 +57,43 @@
&bail if $args[0] eq '-' && $args[1] eq 'Imported';
# find out the last directory being processed
-open(FC, "$last_file.$id") || die "last file does not exist: $!\n";
+open FC, "$last_file.$id"
+ or die "last file does not exist";
my $last_directory = <FC>;
-chomp $last_directory;
-close(FC);
+chop $last_directory;
+close FC;
# remove the cvsroot from the front
$last_directory =~ s/^$cvsroot//;
# add our changed files to the summary
-open(FC, ">>$summary.$id") || die "cannot open summary file: $!\n";
-foreach (@args) {
- print FC "$directory/$_\n";
+open(FC, ">>$summary.$id") || die "cannot open summary file";
+foreach my $arg (@args) {
+ print FC "$directory/$arg\n";
}
close(FC);
# is this script already in the last changed directory?
# exit if this isn't the last directory
-bail() if $last_directory ne $directory;
+&bail if($last_directory ne $directory);
# get the log message and tag -- we throw away everything from STDIN
# before a line that begins with "Log Message"
-my ($logmsg,$tag) = get_log_message();
+my ($logmsg,$tag) = &get_log_message();
# now we fork off into the background and generate the email
-exit 0 if fork() != 0;
+exit 0 if(fork() ne 0);
$| = 1;
#print "Reading summary file\n";
-open(FC, "$summary.$id") || die "Cannot open summary file: $!\n";
+open(FC, "<$summary.$id");
my (@added_files, @removed_files, @modified_files, @modified_files_info);
while (<FC>) {
- chomp;
- my ($file, $old, $new) = split /,/;
+ chop;
+ my ($file, $old, $new) = split(",");
if($old eq "NONE") {
push @added_files, $file;
} elsif($new eq "NONE") {
@@ -102,7 +103,7 @@
push @modified_files_info, [ $file, $old, $new ];
}
}
-close(FC);
+close FC;
#print "Unlinking helper files\n";
@@ -118,8 +119,7 @@
foreach my $info (@modified_files_info) {
my ($file, $old, $new) = @$info;
- open(LOG, "$cvs -Qn rdiff -r $old -r $new -u $file|") ||
- die "Cannot diff $file from revision $old to $new: $!\n";
+ open(LOG, "$cvs -Qn rdiff -r $old -r $new -u $file|") || die;
while(<LOG>) { s/\r\n/\n/; $diffmsg .= $_; }
close(LOG);
}
@@ -130,7 +130,7 @@
next if $file =~ /\.(gif|jpe|jpe?g|pdf|png|exe|class|tgz|tar.gz|jar)$/i
or $file !~ /\./;
$diffmsg .= "\nIndex: $file\n+++ $file\n";
- open(LOG, "$cvs -Qn checkout -p -r1.1 $file |") || die "Cannot checkout $file:
$!\n";
+ open(LOG, "$cvs -Qn checkout -p -r1.1 $file |") || die;
while(<LOG>) { s/\r\n/\n/; $diffmsg .= $_; }
close(LOG);
}
@@ -160,7 +160,7 @@
my $subj = "";
my %dirfiles;
-my @dirs = get_dirs(@added_files, @removed_files, @modified_files);
+my @dirs = &get_dirs(@added_files, @removed_files, @modified_files);
foreach my $dir (@dirs) {
$subj .= "$dir @{ $dirfiles{$dir} } ";
@@ -169,15 +169,15 @@
my $msgid = "Message-ID: <cvs$cvsuser".time()."\@cvsserver>\n";
my %handles;
-
-open(FD, $cvsusers) || die "Cannot open cvsusers file: $!\n";
-while(<FD>) {
- chomp;
- if (/^([a-z_]{2,}?)\s(.*)\s+([a-z0-9-\._]+@[a-z0-9-\.]+).*$/i) {
- $handles{$1} = [trim($2), trim($3)];
+if (open FD, $cvsusers) {
+ while(<FD>) {
+ chop;
+ if (/^([a-z_]{2,}?)\s(.*)\s+([a-z0-9-\._]+@[a-z0-9-\.]+).*$/i) {
+ $handles{$1} = [trim($2), trim($3)];
+ }
}
+ close(FD);
}
-close(FD);
my $from;
if(defined($handles{$cvsuser})) {
@@ -188,10 +188,10 @@
# "Reply-to: $mailto\n".
# "Date: ".localtime()."\n".
-my @DAYABBR = qw(Sun Mon Tue Wed Thu Fri Sat);
-my @MONABBR = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
+my (@DAYABBR) = qw(Sun Mon Tue Wed Thu Fri Sat);
+my (@MONABBR) = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
-my @gmtime = gmtime();
+my (@gmtime) = gmtime();
my $rfc822date = sprintf("Date: %s, %02d %s %d %02d:%02d:%02d -0000\n",
$DAYABBR[$gmtime[6]], $gmtime[3], $MONABBR[$gmtime[4]],
$gmtime[5] + 1900, $gmtime[2], $gmtime[1], $gmtime[0]);
@@ -206,13 +206,11 @@
$rfc822date.
"Subject: cvs: $module$subj_tag $subj\n";
-print $common_header;
-
my $common_body = "".
"$cvsuser\t\t".localtime()." EDT\n".
"$msg".
" Log:\n".
- indent($logmsg,2)."\n";
+ &indent($logmsg,2)."\n";
my $boundary = $cvsuser.time();
@@ -249,24 +247,23 @@
#print $email;
-# Send the commit message to the appropriate addresses
-{
- require Net::SMTP;
-
- my $smtp = Net::SMTP->new($smtpserver,
- Hello => 'cvsserver');
- $smtp->mail('this-will-bounce@php.net');
- for (split(/,/, $envaddr)) {
- $smtp->to($_);
- }
-
- $smtp->data();
- $smtp->datasend($email . "\r\n");
- $smtp->dataend();
+my $paddr = sockaddr_in($smtpport, inet_aton($smtpserver));
+socket(SOCK, PF_INET, SOCK_STREAM, 0) || die "socket failed";
+connect(SOCK, $paddr) || die "connect $smtpserver:$smtpport failed";
+select(SOCK);
+$|=1;
+
+print "HELO cvsserver\r\n".
+"MAIL FROM:<this-will-bounce\@php.net>\r\n".
+"RCPT TO:<$envaddr>\r\n".
+"DATA\r\n".
+"$email\r\n".
+".\r\n".
+"QUIT\r\n";
- $smtp->quit();
-}
+while(<SOCK>) { alarm(20); };
+close(SOCK);
exit 0;
sub get_log_message {