extras-repoclosure rc-run.py,1.23,1.24 rc-report.py,1.38,1.39
Michael Schwendt (mschwendt)
fedora-extras-commits at redhat.com
Tue Feb 27 00:42:16 UTC 2007
- Previous message: rpms/git/FC-4 .cvsignore, 1.35, 1.36 git.spec, 1.24, 1.25 sources, 1.35, 1.36 cvsserver-Avoid-miscounting-bytes-in-Perl-v5.8.x.patch, 1.1, NONE git-install-non-executable-doc-files.patch, 1.1, NONE
- Next message: extras-buildsys/utils/pushscript Config_Extras.py,1.23,1.24
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: mschwendt
Update of /cvs/fedora/extras-repoclosure
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7778/d
Modified Files:
rc-run.py rc-report.py
Log Message:
Add options --mail=owners and --mail=summary to rc-run.py and
rc-report.py and make them default to sending no mail.
Index: rc-run.py
===================================================================
RCS file: /cvs/fedora/extras-repoclosure/rc-run.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- rc-run.py 25 Feb 2007 16:29:59 -0000 1.23
+++ rc-run.py 27 Feb 2007 00:42:14 -0000 1.24
@@ -72,15 +72,22 @@
rs = RepoSupport.RepoSupport(cfg)
releases = []
combinedreport = False
+reportcmd = "./rc-report.py"
try:
- opts, args = getopt.getopt(sys.argv[1:], "", ["needsign="])
+ opts, args = getopt.getopt(sys.argv[1:], "", ["mail=","needsign="])
except getopt.GetoptError:
print 'SYNTAX: %s [--needsign=path] <release>' % sys.argv[0]
sys.exit(errno.EINVAL)
for o, a in opts:
+ if o == "--mail":
+ if a == "owners":
+ reportcmd += " --mail=owners"
+ if a == "summary":
+ reportcmd += " --mail=summary"
if o == "--needsign":
rs.AddRepo('fedora-extras-needsign','Fedora Extras Needsign',a)
+
if sys.argv[0].endswith('rc-run-all.py'): # process all releases
combinedreport = True
for release in rs.AllReleases():
@@ -88,11 +95,11 @@
else: # process one release given as command-line argument
if len(args) != 1:
print 'SYNTAX: %s <release>' % sys.argv[0]
- sys.exit(22)
+ sys.exit(errno.EINVAL)
release = args[0]
if release not in rs.ReleaseArchsDict():
print 'ERROR: release %s is not supported' % release
- sys.exit(22)
+ sys.exit(errno.EINVAL)
releases = [release]
conffile = rs.GenerateConfig(rs.AllReleases(),cachedir)
@@ -118,10 +125,10 @@
args = ''
for (release,logfilename) in goodlogs:
args += ('%s %s ' % (release,logfilename))
- rc = os.system('./rc-report.py %s' % args)
+ rc = os.system('%s %s' % (reportcmd,args))
else:
for (release,logfilename) in goodlogs:
- rc = os.system('./rc-report.py %s %s' % (release,logfilename))
+ rc = os.system('%s %s %s' % (reportcmd,release,logfilename))
os.remove(conffile)
fcntl.flock(f, fcntl.LOCK_UN)
Index: rc-report.py
===================================================================
RCS file: /cvs/fedora/extras-repoclosure/rc-report.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- rc-report.py 25 Feb 2007 16:48:21 -0000 1.38
+++ rc-report.py 27 Feb 2007 00:42:14 -0000 1.39
@@ -7,6 +7,7 @@
import pickle
import re
import smtplib
+import getopt
from PackageOwners import PackageOwners
from History import History
@@ -15,7 +16,6 @@
import Utils
cfg = Utils.load_config_module('Extras')
-domail = True
combinedreport = False
maxmailsize = 39*1024
@@ -120,9 +120,24 @@
# ====================================================================
-if len(sys.argv) < 3:
- print 'SYNTAX: %s <release> <logfile> [release] [logfile]...' % sys.argv[0]
- sys.exit(22)
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "", ["mail="])
+ if len(args) < 2:
+ raise getopt.GetoptError
+except getopt.GetoptError:
+ print 'SYNTAX: %s [--mail=<owners|summary>] <release> <logfile> [release] [logfile]...' % sys.argv[0]
+ sys.exit(errno.EINVAL)
+
+mailowners = False
+mailsummary = False
+for o, a in opts:
+ if o == "--mail":
+ if a == "owners":
+ mailowners = True
+ if a == "summary":
+ mailsummary = True
+
+domail = (mailowners or mailsummary)
owners = PackageOwners()
#owners.FromCVS(workdir=ownersworkdir)
@@ -132,7 +147,6 @@
summail = ''
errcache = []
-args = sys.argv[1:]
if len(args) > 2:
combinedreport = True
while args:
@@ -263,7 +277,7 @@
# Send mail to every package owner with broken package dependencies.
mailtext = 'This is an automated mail created by an experimental script.\nYour following packages in the repository contain broken dependencies:\n\n'
mailtext += body
- if domail and toaddr!='UNKNOWN OWNER':
+ if mailowners and toaddr!='UNKNOWN OWNER':
mailsplit( srv, fromaddr, toaddr, replytoaddr, mailsubject, mailtext )
summail += reportssummary
@@ -294,16 +308,15 @@
timestamp = 0
f = open(timestampfile,'w')
f.close()
-if len(reportssummary) or (datetime.date.fromtimestamp(timestamp)+datetime.timedelta(days=7) < today):
+if mailsummary and (len(reportssummary) or (datetime.date.fromtimestamp(timestamp)+datetime.timedelta(days=7) < today)):
f = open(timestampfile,'w')
f.close()
- mailsummary = True
else:
mailsummary = False
# Send summary to mailing-list
# if there are new reports.
-if domail and mailsummary and (len(summail) or mailsubject.find('development') >= 0): # avoid sending empty reports for stable/old branches
+if mailsummary and (len(summail) or mailsubject.find('development') >= 0): # avoid sending empty reports for stable/old branches
if not len(summail):
summail = 'no broken dependencies'
toaddr = replytoaddr # mail summary to list
- Previous message: rpms/git/FC-4 .cvsignore, 1.35, 1.36 git.spec, 1.24, 1.25 sources, 1.35, 1.36 cvsserver-Avoid-miscounting-bytes-in-Perl-v5.8.x.patch, 1.1, NONE git-install-non-executable-doc-files.patch, 1.1, NONE
- Next message: extras-buildsys/utils/pushscript Config_Extras.py,1.23,1.24
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list