From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/41505 Path: main.gmane.org!not-for-mail From: Michael Cook Newsgroups: gmane.emacs.gnus.general Subject: Re: Patches for cvs and cvslog Date: Thu, 03 Jan 2002 11:56:28 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035176891 6532 80.91.224.250 (21 Oct 2002 05:08:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:08:11 +0000 (UTC) Return-Path: Original-Received: (qmail 11095 invoked from network); 3 Jan 2002 16:58:07 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 3 Jan 2002 16:58:07 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16MBBH-0007yn-00; Thu, 03 Jan 2002 10:57:27 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 03 Jan 2002 10:57:17 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id KAA01103 for ; Thu, 3 Jan 2002 10:57:05 -0600 (CST) Original-Received: (qmail 11076 invoked by alias); 3 Jan 2002 16:56:59 -0000 Original-Received: (qmail 11071 invoked from network); 3 Jan 2002 16:56:59 -0000 Original-Received: from funnel.cisco.com (161.44.168.79) by gnus.org with SMTP; 3 Jan 2002 16:56:59 -0000 Original-Received: from spamsicle.cisco.com (mirapoint@spamsicle.cisco.com [161.44.172.225]) by funnel.cisco.com (8.8.5-Cisco.1/8.6.5) with ESMTP id LAA24067 for ; Thu, 3 Jan 2002 11:56:31 -0500 (EST) Original-Received: from zzz.cisco.com (zzz.cisco.com [10.89.5.93]) by spamsicle.cisco.com (Mirapoint) with ESMTP id ADE01362; Thu, 3 Jan 2002 11:56:28 -0500 (EST) Original-Received: (from zzz@localhost) by zzz.cisco.com (8.11.6/8.11.6) id g03GuSg09024; Thu, 3 Jan 2002 11:56:28 -0500 Original-To: ding@gnus.org X-Face: (::$,F}2XQ8GxBqsXCX?#09yY8mkcV?KEWi->CVJP*t3$PVv?E?;Fk34-6ppt@j'g?kWY_[ d:Xe(0a{$'N_Pv>/P&%U'\V`vimMH`er!2Z&*I]s-MWnUH]Ck+.D!"u`\LtI~'`N@I:o$a (Lars Magne Ingebrigtsen's message of "Thu, 03 Jan 2002 17:27:31 +0100") Original-Lines: 47 User-Agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.1 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:41505 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:41505 Lars Magne Ingebrigtsen writes: > I've included the patch below, but remember: I don't know any Perl, so > try not to hurt yourself too badly when you fall off your chair, > laughing. :-) it looks pretty reasonable. you probably want to close PASSWD. and a couple other performance tweaks would be easy if you're inclined: } $data{messages} = [ $data{message} ] unless $data{messages}; my $from_line = ""; if (open (PASSWD, "/usr/local/cvsroot/CVSROOT/passwd")) { my $passwd_user = $ENV{CVSUSER}; - my $full_name = "CVS"; - my $email_address = "cvs\@" . `hostname --fqdn`; - chomp $email_address; + my $full_name; + my $email_address; my $line; my @info; while ($line = ) { chomp $line; @info = split (/:/, $line); if ($info[0] eq $passwd_user) { $full_name = $info[3]; $email_address = $info[4]; + last; } + } + close PASSWD; + unless (defined $full_name) + { + $full_name = "CVS"; + $email_address = "cvs\@" . `hostname --fqdn`; + chomp $email_address; } $from_line = "From: \"$full_name\" <$email_address>\n"; } # Open our mail program. open (MAIL, '| /usr/lib/sendmail -t -oi -oem') or die "$0: can't fork /usr/lib/sendmail: $!\n"; m.