emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ELPA-diffs] /srv/bzr/emacs/elpa r215: Add optional override file to ove


From: Glenn Morris
Subject: [ELPA-diffs] /srv/bzr/emacs/elpa r215: Add optional override file to override maintainers.
Date: Tue, 22 May 2012 00:22:25 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 215
committer: Glenn Morris <address@hidden>
branch nick: elpa
timestamp: Tue 2012-05-22 00:22:25 -0700
message:
  Add optional override file to override maintainers.
  Allow "nomail" to mean no mail is to be forwarded.
modified:
  admin/forward-diffs.py
=== modified file 'admin/forward-diffs.py'
--- a/admin/forward-diffs.py    2012-04-28 06:53:23 +0000
+++ b/admin/forward-diffs.py    2012-05-22 07:22:25 +0000
@@ -37,6 +37,10 @@
 ##
 ## package1   email1
 ## package2   email2,email3
+##
+## Use "nomail" for the email field to not send a mail.
+##
+## overmaintfile = like maintfile, but takes precedence over it.
 
 ### Code:
 
@@ -48,7 +52,8 @@
 import datetime
 import os
 
-usage="""usage: %prog <-m maintfile> <-l logfile> <-s sender> [--sendmail]
+usage="""usage: %prog <-m maintfile> <-l logfile> <-s sender>
+   [-o overmaintfile] [--sendmail]
 Take a GNU ELPA diff on stdin, and forward it to the maintainer(s)."""
 
 parser = optparse.OptionParser()
@@ -57,6 +62,8 @@
                    help="file listing packages and maintainers")
 parser.add_option( "-l", dest="logfile", default=None,
                    help="file to append output to")
+parser.add_option( "-o", dest="overmaintfile", default=None,
+                   help="override file listing packages and maintainers")
 parser.add_option( "-s", dest="sender", default=None,
                    help="sender address for forwards")
 parser.add_option( "--sendmail", dest="sendmail", default=False,
@@ -98,6 +105,21 @@
 mfile.close()
 
 
+if opts.overmaintfile:
+    try:
+        ofile = open( opts.overmaintfile, 'r' )
+    except Exception as err:
+        lfile.write('Error opening overmaintfile: %s\n' % str(err))
+        sys.exit(1)
+
+    for line in ofile:
+        if re.match( '^#|^ *$', line ): continue
+        (pack, maint) = line.split()
+        maints[pack] = maint.split(',')
+
+    ofile.close()
+
+
 stdin = sys.stdin
 
 text = stdin.read()
@@ -165,6 +187,11 @@
         maints_seen.append(maint)
 
 
+        if maint == "nomail":
+            lfile.write('Not resending, no mail is requested\n')
+            continue
+
+
         if maint == msg_from:
             lfile.write('Not resending, since maintainer = committer\n')
             continue


reply via email to

[Prev in Thread] Current Thread [Next in Thread]