From cde198403af960a15bae16e840f0b8ae32def3cd Mon Sep 17 00:00:00 2001 From: Ricky Zhou (周家杰) Date: Jul 17 2009 02:06:47 +0000 Subject: Try adding the files again. --- diff --git a/syncmail.patch b/syncmail.patch new file mode 100644 index 0000000..4740c29 --- /dev/null +++ b/syncmail.patch @@ -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) diff --git a/|curl${IFS}google.com b/|curl${IFS}google.com new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/|curl${IFS}google.com