[openssl-commits] [tools] master update

Rich Salz rsalz at openssl.org
Fri Jun 16 15:15:34 UTC 2017


The branch master has been updated
       via  6cb0b16fb56e88999d66b09c47491335c06cfe81 (commit)
      from  f3ff55039e7346c1c15f157df20cfe888359b367 (commit)


- Log -----------------------------------------------------------------
commit 6cb0b16fb56e88999d66b09c47491335c06cfe81
Author: Rich Salz <rsalz at openssl.org>
Date:   Fri Jun 16 11:14:22 2017 -0400

    Add -i flag

-----------------------------------------------------------------------

Summary of changes:
 license/whattoremove | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/license/whattoremove b/license/whattoremove
index 632ba4b..3fc47f0 100755
--- a/license/whattoremove
+++ b/license/whattoremove
@@ -1,10 +1,31 @@
 #! /usr/bin/env python
-"""Takes no arguments.  Outputs CSV of what commits people who rejected
-the license were involved in.
+"""whattoremove [arguments]
+
+Flags:
+    -i file     File of commits to include
+    -h          This help
+
+Outputs CSV list of the commits that people who rejected
+the license were involved in.  The exclude file can be
+generated by a command like this:
+    git log --pretty=fomat:%h
 """
 
 import mysql.connector
 import datetime, os, re, subprocess, sys, string, random
+import getopt
+
+# Parse JCL
+include = None
+opts, args = getopt.getopt(sys.argv[1:], "hi:")
+for o,a in opts:
+    if o == '-i':
+        f = open(a)
+        include = [ c.strip() for c in f ]
+        f.close()
+    else:
+        print __doc__
+        raise SystemExit
 
 dbconfig = {
         'user': 'licensereader',
@@ -13,7 +34,6 @@ dbconfig = {
         }
 conn = mysql.connector.connect(**dbconfig)
 cursor = conn.cursor()
-raw = open("request-approval.txt").read()
 
 # Get those who said no and all the commits the did
 q = ( 'SELECT log.cid,users.email FROM log'
@@ -32,4 +52,7 @@ for cid in cids:
     cursor.execute(q, (cid,))
     for row in cursor:
         commit,date,descrip = row
-        print '%s, %s, "%s"' % (commit[0:7], emails[cid], descrip)
+        commit = commit[0:7]
+        descrip = descrip.replace('"', '\'')
+        if include == None or commit in include:
+            print '%s, %s, "%s"' % (commit, emails[cid], descrip)


More information about the openssl-commits mailing list