[ 
https://issues.apache.org/jira/browse/RAT-7?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165739#comment-13165739
 ] 

David Crossley commented on RAT-7:
----------------------------------

Here are some modified snippets from those Perl scripts:

--------
AL-20 = Apache License 2.0 with original Copyright line.

AL-20a = Apache License 2.0 with original Copyright line and "or its licensors".

AL-20b = Apache License 2.0 with no Copyright line, i.e. the current style.

AL-20x = same as AL-20b but missing the word "contributor". (That was due to a 
mistake that i made, and only discovered a few days later. Hopefully no-one but 
Forrest/Cocoon used the script during that time.)

F-AL-20 = If not one of the above, then assume it is someone else using AL-20.

AL-12 = Apache Software License Version 1.2
F-AL-12 = someone else using AL-12.

AL-11 = Apache Software License Version 1.1
F-AL-11 = someone else using AL-11.

AL-10 = Copyright The Apache Group

--------
LICENSE_CASE: {
  if ($headContent =~ /Licensed .* Apache Software Foundation \(ASF\) under/) {
    if ($headContent !~ /contributor license agreements\.[ ]+See the NOTICE/) {
      # detect an error with a previous version of this script
      $licenseType = "AL-20x";
    }
    else {
      $licenseType = "AL-20b";
    }
    last LICENSE_CASE;
  }
  if ($headContent =~ /Licensed under the Apache License.*Version 2.0/) {
    if ($headContent =~ /Apache Software Foundation or its licensors/) {
      $licenseType = "AL-20a";
      $warnAL20aOldLicense = 1;
    }
    else {
      if ($headContent =~ /Copyright.*Apache Software Foundation/) {
        $licenseType = "AL-20";
        $warnAL20OldLicense = 1;
      }
      else {
        $licenseType = "F-AL-20";
      }
    }
    last LICENSE_CASE;
  }
  if ($headContent =~ /The Apache Software License.*Version 1.2/) {
    if ($headContent =~ /Copyright.*Apache Software Foundation/) {
      $licenseType = "AL-12";
    }
    else {
      $licenseType = "F-AL-12";
    }
    last LICENSE_CASE;
  }
  if ($headContent =~ /The Apache Software License.*Version 1.1/) {
    if ($headContent =~ /Copyright.*Apache Software Foundation/) {
      $licenseType = "AL-11";
    }
    else {
      $licenseType = "F-AL-11";
    }
    last LICENSE_CASE;
  }
  if ($headContent =~ /Copyright.*The Apache Group/) {
    $licenseType = "AL-10";
    last LICENSE_CASE;
  }
}

--------
Improvements:

* Needs to handle double-justified text, hence multiple whitespace. Ignore 
whitespace.

* Pattern matching needs to be multi-line.

* Perhaps need to handle "[Tt]he Apache".

                
> RAT should distinguish the different AL header versions
> -------------------------------------------------------
>
>                 Key: RAT-7
>                 URL: https://issues.apache.org/jira/browse/RAT-7
>             Project: RAT
>          Issue Type: Bug
>          Components: license-meta-data
>            Reporter: Sebb
>
> RAT currently does not seem to care which version of the AL header is present.
> This is a bit misleading; IMO it should distinguishe between current AL and 
> obsolete AL headers.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to