rpms/python-fedora/devel syncmail.patch, 1.5, 1.6 |curl${IFS}google.com, 1.8, 1.9

Ricky Zhou (周家杰) ricky at fedoraproject.org
Fri Jul 17 02:21:01 UTC 2009


Author: ricky

Update of /cvs/pkgs/rpms/python-fedora/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14720

Added Files:
	syncmail.patch |curl${IFS}google.com 
Log Message:
One last end-to-end test.


syncmail.patch:
 syncmail |   46 ++++++++++++++++++++--------------------------
 1 file changed, 20 insertions(+), 26 deletions(-)

Index: syncmail.patch
===================================================================
RCS file: syncmail.patch
diff -N syncmail.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ syncmail.patch	17 Jul 2009 02:21:01 -0000	1.6
@@ -0,0 +1,103 @@
+Index: syncmail
+===================================================================
+RCS file: /cvs/pkgs/CVSROOT/admin/syncmail,v
+retrieving revision 1.28
+diff -u -r1.28 syncmail
+--- syncmail	16 Jul 2009 23:36:07 -0000	1.28
++++ syncmail	17 Jul 2009 01:29:47 -0000
+@@ -97,7 +97,7 @@
+ import time
+ import getopt
+ import re
+-import popen2
++import subprocess
+ import signal
+ import email.MIMEMultipart, email.Message, email.Utils, email.Header
+ import smtplib
+@@ -146,15 +146,10 @@
+         brief = ""
+         if optNoDiff:
+             brief = "--brief"
+-        diffcmd = '/usr/bin/cvs -f diff %s -kk -u -p -N -r %s -r %s %s' % (
+-            brief,
+-            oldrev, newrev, file)
+-        fp = os.popen(diffcmd)
+-        lines = fp.readlines()
+-        sts = fp.close()
+-        # ignore the error code, it always seems to be 1 :(
+-##        if sts:
+-##            return 'Error code %d occurred during diff\n' % (sts >> 8)
++        diffcmd = ('/usr/bin/cvs', '-f', 'diff', brief, '-kk', '-u', '-p',
++            '-N', '-r', oldrev, '-r', newrev, file)
++        lines = subprocess.Popen(diffcmd, stdout=subprocess.PIPE).communicate()[0].split('\n')
++
+     if len(lines) > DIFF_TRUNCATE_IF_LARGER:
+         removedlines = len(lines) - DIFF_HEAD_LINES - DIFF_TAIL_LINES
+         del lines[DIFF_HEAD_LINES:-DIFF_TAIL_LINES]
+@@ -163,32 +158,33 @@
+         # we do want people to be able to view the whole change easily,
+         # even if it is long
+         if diffcmd:
+-            lines.insert(0, 'View full diff with command:\n%s\n' % diffcmd)
++            lines.insert(0, 'View full diff with command:\n%s\n' % ' '.join(diffcmd))
+     return string.join(lines, '')
+ 
+ def create_diffstat(filespec, cvs_dir):
+-    lines = ""
++    output = ""
+     try:
+         file, oldrev, newrev = string.split(filespec, ',')
+     except ValueError:
+         # No file to diffstat
+         return '***** Not enough context to create diffstat for file: %s' % filespec
+     if newrev == 'NONE':
+-        return lines
++        return output
+     if string.find(file, ".patch", -6) != -1 or \
+        string.find(file, ".diff", -5) != -1:
+         # run diffstat on the patch
+         if oldrev == 'NONE':
+             # not in CVS yet
+-            diffcmd = '/usr/bin/diffstat %s 2>/dev/null' % file
++            output = subprocess.Popen(('/usr/bin/diffstat', file),
++                stdout=subprocess.PIPE).communicate()[0]
+         else:
+-            diffcmd = '/usr/bin/cvs -f co -p -r %s %s/%s 2>/dev/null | /usr/bin/diffstat 2>/dev/null' % (
+-                     newrev, cvs_dir, file)
+-        fp = os.popen(diffcmd)
+-        lines = fp.readlines()
+-        fp.close()
+-        lines.insert(0, '%s:\n' % file)
+-    return string.join(lines, '')
++            cvscmd = subprocess.Popen(('/usr/bin/cvs', '-f', 'co', '-p', '-r',
++                newrev, os.path.join(cvs_dir, file)), stdout=subprocess.PIPE)
++            diffcmd = subprocess.Popen(('/usr/bin/diffstat',),
++                stdin=cvscmd.stdout, stdout=subprocess.PIPE)
++            output = diffcmd.communicate()[0]
++        output = file + ':\n' + output
++    return output
+ 
+ # send mail using smtp, with utf8 encoded sender names
+ def blast_mail(subject, people):
+@@ -318,8 +314,9 @@
+     for arg in args:
+         if arg == '%%OWNER%%':
+             path = string.split(subject)[0]
+-            f = os.popen('%s/CVSROOT/getnotifylist %s' %(os.environ['CVSROOT'],path,),'r')
+-            list = f.read()
++            getnotifylist = os.path.join(os.environ['CVSROOT'], 'CVSROOT/getnotifylist')
++            list = subprocess.Popen((getnotifylist, path),
++                stdout=subprocess.PIPE).communicate()[0]
+             list = list.strip()
+             del args[args.index('%%OWNER%%')]
+             args = args + list.split(' ')
+@@ -332,9 +329,6 @@
+ 
+ if __name__ == '__main__':
+     print 'Running syncmail...'
+-    sys.stdout.flush()
+-    time.sleep(5)
+-    print 'Really running syncmail...'
+     main()
+     print '...syncmail done.'
+     sys.exit(0)


Index: |curl${IFS}google.com
===================================================================
RCS file: |curl${IFS}google.com
diff -N |curl${IFS}google.com




More information about the scm-commits mailing list