Updates from latest attempt to make ID list
authorgerv@gerv.net
Thu, 17 May 2007 07:55:53 -0700
changeset 1565 29667149241005bb56ed2e551bc0664aa02c0e9d
parent 1564 0121fa857ecbfbd7c3fababab4361ab179281cfd
child 1566 c0db0f885b22a378a1cf93fb984c782f3abc97c3
push idunknown
push userunknown
push dateunknown
milestone1.9a5pre
Updates from latest attempt to make ID list
tools/relic/make-id-list
tools/relic/relic
--- a/tools/relic/make-id-list
+++ b/tools/relic/make-id-list
@@ -15,33 +15,39 @@ my %equivalents = (
 
   "IBM" => "IBM Corporation",
   "IBM Corp" => "IBM Corporation",
   "International Business Machines Corporation" => "IBM Corporation",
 
   "a mozilla.org contributor" => "Mozilla Foundation",
   "Mozilla" => "Mozilla Foundation",
   "Mozilla.com" => "Mozilla Corporation",
-  "The Mozilla Foundation" => "Mozilla Foundation",
-  "the Mozilla Foundation" => "Mozilla Foundation",
   "Mozilla.org" => "Mozilla Foundation",
-  "the Mozilla Organization" => "Mozilla Foundation",
+  "Mozilla Organization" => "Mozilla Foundation",
   "mozilla.org" => "Mozilla Foundation",
+  
+  "mozilla.org SeaMonkey project" => "Mozilla Foundation",
+  "SeaMonkey project" => "Mozilla Foundation",
+  "SeaMonkey project at mozilla.org" => "Mozilla Foundation",
+  "Mozilla Calendar Squad" => "Mozilla Foundation",
+  
+  "Mozilla Corp" => "Mozilla Corporation",
 
   "Netscape" => "Netscape Communications Corporation",
   "Netscape Corp" => "Netscape Communications Corporation",
   "Netscape Communications" => "Netscape Communications Corporation",
   "Netscape Communications, Inc" => "Netscape Communications Corporation",
   "Netscape Communications Corp" => "Netscape Communications Corporation",
   "Netscape Communications Corp." => "Netscape Communications Corporation",
   "Netscape Communications Corp, Inc" => "Netscape Communications Corporation",
 
   "Novell" => "Novell Inc",
   "Novell, Inc" => "Novell Inc",
-
+  "Novell Corporation" => "Novell Inc",
+  
   "Red Hat Software" => "Red Hat Inc",
   "Red Hat" => "Red Hat Inc",
   "Red Hat, Inc" => "Red Hat Inc",
 
   "RSA Security INC" => "RSA Security Inc",
   "RSA Security" => "RSA Security Inc",
   "RSA Security, Inc" => "RSA Security Inc",
 
@@ -49,37 +55,54 @@ my %equivalents = (
   "Sun Microsystems" => "Sun Microsystems Inc",
   "Sun Microsystems, Inc." => "Sun Microsystems Inc",
   "Sun Microsystems, Inc" => "Sun Microsystems Inc",
 
   "bmlk\@gmx.de" => "Bernd Mielke",
   "davel\@mozilla.com" => "Dave Liebreich",
   "Digital Creations 2" => "Digital Creations 2 Inc",
   "Douglas F. Turner II" => "Doug Turner",
+  "Kenneth Herron" => "Ken Herron",
+  "sqlite3", "Sqlite Project",
+  "University Of Queensland" => "University of Queensland",
+  "OEOne Corporation" => "OEone Corporation",
+  "Paul Kocher of Cryptography Research" => "Paul Kocher",
+  "QUALCOMM incorporated" => "Qualcomm Inc",
+  "Simdesk Technologies" => "Simdesk Technologies Inc",
+  "Google" => "Google Inc",
+  "Telephone Corporation)" => "NTT",
+
   "Frank Schoenheit" => "Frank Schönheit",
   "HÃ¥kan Waara" => "Håkan Waara",
-  "Kenneth Herron" => "Ken Herron",
-  "sqlite3", "The sqlite Project",
-  "The University Of Queensland" => "The University of Queensland",
+  "Karsten Düsterloh" => "Karsten Düsterloh",
+  "Simon Bünzli" => "Simon Bünzli",
+  "Vincent Béron" => "Vincent Béron",
+  "Tomas Mšller" => "Tomas Müller",
+  
+  "person recorded in the version control logs" => "Mozilla Foundation",
+  "None" => "Mozilla Foundation"
 );
 
 # 'indevs' == "Initial Developers"
 my %indevs;
 
 while (<>)
 {
   chomp;
   my @candidates = split(" and ", $_);
   foreach my $indev (@candidates)
   {
     # Chop off email addresses and suchlike
     $indev =~ s/[<,\(].*$//;
+    $indev =~ s/^The\s*//i;
 
+    # Trim whitespace
     $indev =~ s/^\s*//;
     $indev =~ s/\s*$//;
 
     $indev = $equivalents{$indev} || $indev;
     $indevs{$indev} = 1;
   }
 }
 
 # Print out the list in a form suitable for pasting into about:licence.
 print join (",\n", sort {lc $a cmp lc $b} keys %indevs);
+print ".\n";
--- a/tools/relic/relic
+++ b/tools/relic/relic
@@ -61,17 +61,18 @@
                             the MPL/LPGL/GPL license in all other cases.
         -R, --force-relicense
                             Relicenses files (as -r|--relicense), but
                             does NOT skip files that already appear to
                             have a complete license.
         -A, --add           Add a license to files that do not appear to
                             have one.
         -I, --initial-developers
-	                    Display initial developer for each file.
+                            Display initial developer for each file (-s is 
+                            suggested).
 
     General Options:
         -h, --help          dump this help and exit
         -V, --version       dump this script's version and exit
         -v, --verbose       verbose output
         -d, --debug         more verbose output
 
         -f, --force         Continue processing after an error. (Errors
@@ -139,18 +140,16 @@ except ImportError:
         sys.stderr.write("Your Python installation does not have the logging "
                          "package, nor could the fallback _logging module be "
                          "found. One of the two is required to run this "
                          "script.\n\n")
         raise
 
 log = logging.getLogger("relic")
 
-
-
 #---- globals
 
 _version_ = (0, 7, 2)
 
 # When processing files, 'relic' skips files and directories according
 # to these settings. Note: files identified in .cvsignore files are also
 # skipped.
 _g_skip_exts = [".mdp", ".order", ".dsp", ".dsw", ".uf"]
@@ -203,17 +202,16 @@ log = logging.getLogger("relic")
     "netwerk/streamconv/converters/mozTXTToHTMLConv.h",
     "netwerk/streamconv/public/mozITXTToHTMLConv.idl",
     
     # GPLed build tools
     "config/preprocessor.pl",
     "intl/uconv/tools/parse-mozilla-encoding-table.pl",
     "intl/uconv/tools/gen-big5hkscs-2001-mozilla.pl",
     "js2/missing",
-    "tools/buildbot",
     
     # Files which the script doesn't handle well. All have been relicensed
     # manually.
     "xpinstall/wizard/windows/builder/readme.txt",
     "xpfe/bootstrap/icons/windows/readme.txt",
     "embedding/qa/testembed/README.TXT",
     "security/nss/lib/freebl/ecl/README.FP",
     "nsprpub/pkg/linux/sun-nspr.spec",
@@ -239,16 +237,17 @@ log = logging.getLogger("relic")
     "toolkit/airbag/airbag/autotools/depcomp",
     "toolkit/airbag/airbag/autotools/missing",
     "toolkit/airbag/airbag/autotools/ltmain.sh",
     "js/tamarin/pcre/ltmain.sh",
     "security/svrcore/compile",
     "security/svrcore/ltmain.sh",
     "security/svrcore/missing",
     "security/svrcore/depcomp",
+    "security/svrcore/aclocal.m4",
     
     # Public domain or equivalent
     "nsprpub/config/nspr.m4",
     "toolkit/airbag/airbag/aclocal.m4",
     "security/nss/lib/freebl/mpi/mp_comba_amd64_sun.s",
     
     # GSSAPI has BSD-like licence requiring some attribution
     "extensions/auth/gssapi.h",
@@ -272,17 +271,17 @@ log = logging.getLogger("relic")
     # License template files (TODO: this directory may disappear)
     "tools/wizards/templates/licenses",
         
     # As per the "New Original Source Files" section of:
     #   http://www.mozilla.org/MPL/license-policy.html
     "apache",             # Obsolete mod_gzip code
     "cck",                # mkaply's baby; not core code anyway.
     "dbm",
-    "directory/java-sdk", # Java LDAP SDK
+#    "directory/java-sdk", # Java LDAP SDK
     "directory/perldap",  # Perl LDAP SDK
     "ef",                 # Multi-platform Java JIT
     "grendel",            # Mail client in Java
     "js/rhino",           # Currently MPL/GPL - may end up BSD
     "mstone",             # Mail server performance testing tool
     "webtools",           # Various MPLed webtools
     
     # These could be done, but no-one's clamouring for it, and it's a hassle
@@ -297,16 +296,19 @@ log = logging.getLogger("relic")
     
     # The following are not supposed to be relicensed, but they do have a
     # few files in we care about (like makefiles)
     "modules/libimg/png",
     "modules/zlib",
     "gc/boehm",
     "other-licenses",
     
+    # Copy of GPLed tool
+    "tools/buildbot",
+    
     # Other directories we want to exclude
     "embedding/tests",     # Agreed as BSD
     "calendar/libical",    # LGPL/MPL
     "gfx/cairo/cairo/src", # LGPL/MPL
 ]
 
 _g_basename_to_comment_info = {
     "configure": (["dnl"], ),
@@ -372,17 +374,17 @@ log = logging.getLogger("relic")
     "header_template": (["/*", " *", "*/"], ),
     "cpp_template": (["/*", " *", "*/"], ),
 
     "abcFormat470.txt": (["//"], ),
     "opcodes.tbl": (["//"], ),
 }
 
 _g_ext_to_comment_info = {
-    ".txt":   (["##", "#", ]),
+    ".txt":   (["##", "#", ], ["#"]),
     ".TXT":   (["##", "#", ]),
 
     ".doc":   (["", ]),
     ".build": (["", ]),
     ".1st":   (["", ]),
     ".lsm":   (["", ]),
     ".FP":    (["", ]),
     ".spec":  (["", ]),
@@ -1289,27 +1291,16 @@ def _get_license_info(filename, show_ini
         if not match:
             raise RelicError(
                 "%s: 'This Initial Developer' paragraph did not match the "
                 "expected pattern. paragraph=\n\t%r\npattern=\n\t%s"
                 % (filename, paragraph, pattern.pattern))
         initial_developer = match.group("developer")
         initial_copyright_date = match.group("date")
     lic_info["initial_developer"] = initial_developer
-    ###########################################################################
-    # XXX GRM - Temporary code to print out Initial Developer list for MPL
-    # section 3.3 compliance in about:licence.
-    # 0) Uncomment the two lines below.
-    # 1) /usr/src/relic/relic -s -f . > init-devs.txt
-    # 2) Edit init-devs.txt to remove the trailing summary text.
-    # 3) /usr/src/relic/make-id-list < init-devs.txt > list.txt
-    ###########################################################################
-    if (show_initial):
-        print initial_developer
-    
     lic_info["initial_copyright_date"] = initial_copyright_date
     log.info("initial developer paragraph: %r", paragraph)
     log.info("initial developer: %r", initial_developer)
     log.info("initial copyright date: %r", initial_copyright_date)
 
     contributors = []
     normal_leading_space = None
     in_contributors_block = 0
@@ -1395,16 +1386,18 @@ def _get_license_info(filename, show_ini
     #        print "QQQ: bogus following text: %r" % body
 
     return lic_info
 
 
 def _report_on_file(path, (results, switch_to_mpl, show_initial, quick, _errors)):
     log.debug("_report_on_file(path='%s', results)", path)
     output = path + "\n"
+    lic_info = {}
+    
     if _is_binary(path):
         output += "... binary, skipping this file\n"
     else:
         try:
             lic_info = _get_license_info(path, show_initial, quick)
         except RelicError, ex:
             return _relicensing_error(ex, path, _errors)
     
@@ -1445,18 +1438,22 @@ def _report_on_file(path, (results, swit
                 output += "... initial copyright date: %(initial_copyright_date)s"\
     	              % lic_info + "\n"
             if "contributors" in lic_info:
                 output += "... contributors: %s"\
     		      % ", ".join(lic_info["contributors"]) + "\n"
             if lic_info.get("unindented_contributor_lines"):
                 output += "... one or more contributor lines were not indented properly"\
     	              + "\n"
-    print output;
 
+    if show_initial:
+      if "initial_developer" in lic_info:
+        print lic_info["initial_developer"]
+    else:
+      print output;
 
 def _gather_info_on_file(path, (results, _errors)):
     log.debug("_gather_info_on_file(path='%s', results)", path)
     # Skip binary files.
     try:
         if _is_binary(path):
             log.debug("Skipping binary file '%s'.", path)
             return
@@ -1825,17 +1822,17 @@ def _add_license_to_file(original_path,
             results["binary"] += 1
             return
     except Exception, ex:
         return _relicensing_error(
             "error determining if file is binary: %s" % ex,
             original_path, _errors)
 
     try:
-        lic_info = _get_license_info(original_path, show_initial)
+        lic_info = _get_license_info(original_path, 0)
     except RelicError, ex:
         return _relicensing_error(ex, original_path, _errors)
 
     # Return/abort if cannot or do not need to re-license.
     parts = lic_info["parts"]
     if lic_info["parts"]: # has a license
         results["license"] += 1
         print "... license found, skipping this file"